exdump.c 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  1. /******************************************************************************
  2. *
  3. * Module Name: exdump - Interpreter debug output routines
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2016, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #include <acpi/acpi.h>
  43. #include "accommon.h"
  44. #include "acinterp.h"
  45. #include "amlcode.h"
  46. #include "acnamesp.h"
  47. #define _COMPONENT ACPI_EXECUTER
  48. ACPI_MODULE_NAME("exdump")
  49. /*
  50. * The following routines are used for debug output only
  51. */
  52. #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
  53. /* Local prototypes */
  54. static void acpi_ex_out_string(const char *title, const char *value);
  55. static void acpi_ex_out_pointer(const char *title, const void *value);
  56. static void
  57. acpi_ex_dump_object(union acpi_operand_object *obj_desc,
  58. struct acpi_exdump_info *info);
  59. static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc);
  60. static void
  61. acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
  62. u32 level, u32 index);
  63. /*******************************************************************************
  64. *
  65. * Object Descriptor info tables
  66. *
  67. * Note: The first table entry must be an INIT opcode and must contain
  68. * the table length (number of table entries)
  69. *
  70. ******************************************************************************/
  71. static struct acpi_exdump_info acpi_ex_dump_integer[2] = {
  72. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_integer), NULL},
  73. {ACPI_EXD_UINT64, ACPI_EXD_OFFSET(integer.value), "Value"}
  74. };
  75. static struct acpi_exdump_info acpi_ex_dump_string[4] = {
  76. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_string), NULL},
  77. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(string.length), "Length"},
  78. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(string.pointer), "Pointer"},
  79. {ACPI_EXD_STRING, 0, NULL}
  80. };
  81. static struct acpi_exdump_info acpi_ex_dump_buffer[5] = {
  82. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer), NULL},
  83. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(buffer.length), "Length"},
  84. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.pointer), "Pointer"},
  85. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(buffer.node), "Parent Node"},
  86. {ACPI_EXD_BUFFER, 0, NULL}
  87. };
  88. static struct acpi_exdump_info acpi_ex_dump_package[6] = {
  89. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_package), NULL},
  90. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(package.node), "Parent Node"},
  91. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(package.flags), "Flags"},
  92. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(package.count), "Elements"},
  93. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(package.elements), "Element List"},
  94. {ACPI_EXD_PACKAGE, 0, NULL}
  95. };
  96. static struct acpi_exdump_info acpi_ex_dump_device[4] = {
  97. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL},
  98. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[0]),
  99. "System Notify"},
  100. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[1]),
  101. "Device Notify"},
  102. {ACPI_EXD_HDLR_LIST, ACPI_EXD_OFFSET(device.handler), "Handler"}
  103. };
  104. static struct acpi_exdump_info acpi_ex_dump_event[2] = {
  105. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL},
  106. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"}
  107. };
  108. static struct acpi_exdump_info acpi_ex_dump_method[9] = {
  109. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
  110. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.info_flags), "Info Flags"},
  111. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count),
  112. "Parameter Count"},
  113. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
  114. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"},
  115. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
  116. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"},
  117. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"},
  118. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.aml_start), "Aml Start"}
  119. };
  120. static struct acpi_exdump_info acpi_ex_dump_mutex[6] = {
  121. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_mutex), NULL},
  122. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(mutex.sync_level), "Sync Level"},
  123. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(mutex.original_sync_level),
  124. "Original Sync Level"},
  125. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
  126. {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
  127. "Acquire Depth"},
  128. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
  129. };
  130. static struct acpi_exdump_info acpi_ex_dump_region[8] = {
  131. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region), NULL},
  132. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(region.space_id), "Space Id"},
  133. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(region.flags), "Flags"},
  134. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(region.node), "Parent Node"},
  135. {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(region.address), "Address"},
  136. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(region.length), "Length"},
  137. {ACPI_EXD_HDLR_LIST, ACPI_EXD_OFFSET(region.handler), "Handler"},
  138. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(region.next), "Next"}
  139. };
  140. static struct acpi_exdump_info acpi_ex_dump_power[6] = {
  141. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_power), NULL},
  142. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.system_level),
  143. "System Level"},
  144. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order),
  145. "Resource Order"},
  146. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[0]),
  147. "System Notify"},
  148. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[1]),
  149. "Device Notify"},
  150. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.handler), "Handler"}
  151. };
  152. static struct acpi_exdump_info acpi_ex_dump_processor[7] = {
  153. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_processor), NULL},
  154. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"},
  155. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"},
  156. {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"},
  157. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[0]),
  158. "System Notify"},
  159. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[1]),
  160. "Device Notify"},
  161. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"}
  162. };
  163. static struct acpi_exdump_info acpi_ex_dump_thermal[4] = {
  164. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL},
  165. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[0]),
  166. "System Notify"},
  167. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[1]),
  168. "Device Notify"},
  169. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"}
  170. };
  171. static struct acpi_exdump_info acpi_ex_dump_buffer_field[3] = {
  172. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer_field), NULL},
  173. {ACPI_EXD_FIELD, 0, NULL},
  174. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer_field.buffer_obj),
  175. "Buffer Object"}
  176. };
  177. static struct acpi_exdump_info acpi_ex_dump_region_field[5] = {
  178. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region_field), NULL},
  179. {ACPI_EXD_FIELD, 0, NULL},
  180. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(field.access_length), "AccessLength"},
  181. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(field.region_obj), "Region Object"},
  182. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(field.resource_buffer),
  183. "ResourceBuffer"}
  184. };
  185. static struct acpi_exdump_info acpi_ex_dump_bank_field[5] = {
  186. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_bank_field), NULL},
  187. {ACPI_EXD_FIELD, 0, NULL},
  188. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(bank_field.value), "Value"},
  189. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(bank_field.region_obj),
  190. "Region Object"},
  191. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(bank_field.bank_obj), "Bank Object"}
  192. };
  193. static struct acpi_exdump_info acpi_ex_dump_index_field[5] = {
  194. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_bank_field), NULL},
  195. {ACPI_EXD_FIELD, 0, NULL},
  196. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(index_field.value), "Value"},
  197. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.index_obj),
  198. "Index Object"},
  199. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.data_obj), "Data Object"}
  200. };
  201. static struct acpi_exdump_info acpi_ex_dump_reference[9] = {
  202. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL},
  203. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.class), "Class"},
  204. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"},
  205. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.value), "Value"},
  206. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
  207. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(reference.node), "Node"},
  208. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"},
  209. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.index_pointer),
  210. "Index Pointer"},
  211. {ACPI_EXD_REFERENCE, 0, NULL}
  212. };
  213. static struct acpi_exdump_info acpi_ex_dump_address_handler[6] = {
  214. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_address_handler),
  215. NULL},
  216. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(address_space.space_id), "Space Id"},
  217. {ACPI_EXD_HDLR_LIST, ACPI_EXD_OFFSET(address_space.next), "Next"},
  218. {ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET(address_space.region_list),
  219. "Region List"},
  220. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(address_space.node), "Node"},
  221. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"}
  222. };
  223. static struct acpi_exdump_info acpi_ex_dump_notify[7] = {
  224. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL},
  225. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(notify.node), "Node"},
  226. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(notify.handler_type), "Handler Type"},
  227. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.handler), "Handler"},
  228. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"},
  229. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[0]),
  230. "Next System Notify"},
  231. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[1]), "Next Device Notify"}
  232. };
  233. static struct acpi_exdump_info acpi_ex_dump_extra[6] = {
  234. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_extra), NULL},
  235. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(extra.method_REG), "_REG Method"},
  236. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(extra.scope_node), "Scope Node"},
  237. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(extra.region_context),
  238. "Region Context"},
  239. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(extra.aml_start), "Aml Start"},
  240. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(extra.aml_length), "Aml Length"}
  241. };
  242. static struct acpi_exdump_info acpi_ex_dump_data[3] = {
  243. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_data), NULL},
  244. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(data.handler), "Handler"},
  245. {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(data.pointer), "Raw Data"}
  246. };
  247. /* Miscellaneous tables */
  248. static struct acpi_exdump_info acpi_ex_dump_common[5] = {
  249. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_common), NULL},
  250. {ACPI_EXD_TYPE, 0, NULL},
  251. {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(common.reference_count),
  252. "Reference Count"},
  253. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common.flags), "Flags"},
  254. {ACPI_EXD_LIST, ACPI_EXD_OFFSET(common.next_object), "Object List"}
  255. };
  256. static struct acpi_exdump_info acpi_ex_dump_field_common[7] = {
  257. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_field_common), NULL},
  258. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.field_flags),
  259. "Field Flags"},
  260. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.access_byte_width),
  261. "Access Byte Width"},
  262. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(common_field.bit_length),
  263. "Bit Length"},
  264. {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.start_field_bit_offset),
  265. "Field Bit Offset"},
  266. {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(common_field.base_byte_offset),
  267. "Base Byte Offset"},
  268. {ACPI_EXD_NODE, ACPI_EXD_OFFSET(common_field.node), "Parent Node"}
  269. };
  270. static struct acpi_exdump_info acpi_ex_dump_node[7] = {
  271. {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL},
  272. {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"},
  273. {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
  274. {ACPI_EXD_LIST, ACPI_EXD_NSOFFSET(object), "Object List"},
  275. {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET(parent), "Parent"},
  276. {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET(child), "Child"},
  277. {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET(peer), "Peer"}
  278. };
  279. /* Dispatch table, indexed by object type */
  280. static struct acpi_exdump_info *acpi_ex_dump_info[] = {
  281. NULL,
  282. acpi_ex_dump_integer,
  283. acpi_ex_dump_string,
  284. acpi_ex_dump_buffer,
  285. acpi_ex_dump_package,
  286. NULL,
  287. acpi_ex_dump_device,
  288. acpi_ex_dump_event,
  289. acpi_ex_dump_method,
  290. acpi_ex_dump_mutex,
  291. acpi_ex_dump_region,
  292. acpi_ex_dump_power,
  293. acpi_ex_dump_processor,
  294. acpi_ex_dump_thermal,
  295. acpi_ex_dump_buffer_field,
  296. NULL,
  297. NULL,
  298. acpi_ex_dump_region_field,
  299. acpi_ex_dump_bank_field,
  300. acpi_ex_dump_index_field,
  301. acpi_ex_dump_reference,
  302. NULL,
  303. NULL,
  304. acpi_ex_dump_notify,
  305. acpi_ex_dump_address_handler,
  306. NULL,
  307. NULL,
  308. NULL,
  309. acpi_ex_dump_extra,
  310. acpi_ex_dump_data
  311. };
  312. /*******************************************************************************
  313. *
  314. * FUNCTION: acpi_ex_dump_object
  315. *
  316. * PARAMETERS: obj_desc - Descriptor to dump
  317. * info - Info table corresponding to this object
  318. * type
  319. *
  320. * RETURN: None
  321. *
  322. * DESCRIPTION: Walk the info table for this object
  323. *
  324. ******************************************************************************/
  325. static void
  326. acpi_ex_dump_object(union acpi_operand_object *obj_desc,
  327. struct acpi_exdump_info *info)
  328. {
  329. u8 *target;
  330. const char *name;
  331. u8 count;
  332. union acpi_operand_object *start;
  333. union acpi_operand_object *data = NULL;
  334. union acpi_operand_object *next;
  335. struct acpi_namespace_node *node;
  336. if (!info) {
  337. acpi_os_printf
  338. ("ExDumpObject: Display not implemented for object type %s\n",
  339. acpi_ut_get_object_type_name(obj_desc));
  340. return;
  341. }
  342. /* First table entry must contain the table length (# of table entries) */
  343. count = info->offset;
  344. while (count) {
  345. target = ACPI_ADD_PTR(u8, obj_desc, info->offset);
  346. name = info->name;
  347. switch (info->opcode) {
  348. case ACPI_EXD_INIT:
  349. break;
  350. case ACPI_EXD_TYPE:
  351. acpi_os_printf("%20s : %2.2X [%s]\n", "Type",
  352. obj_desc->common.type,
  353. acpi_ut_get_object_type_name(obj_desc));
  354. break;
  355. case ACPI_EXD_UINT8:
  356. acpi_os_printf("%20s : %2.2X\n", name, *target);
  357. break;
  358. case ACPI_EXD_UINT16:
  359. acpi_os_printf("%20s : %4.4X\n", name,
  360. ACPI_GET16(target));
  361. break;
  362. case ACPI_EXD_UINT32:
  363. acpi_os_printf("%20s : %8.8X\n", name,
  364. ACPI_GET32(target));
  365. break;
  366. case ACPI_EXD_UINT64:
  367. acpi_os_printf("%20s : %8.8X%8.8X\n", "Value",
  368. ACPI_FORMAT_UINT64(ACPI_GET64(target)));
  369. break;
  370. case ACPI_EXD_POINTER:
  371. case ACPI_EXD_ADDRESS:
  372. acpi_ex_out_pointer(name,
  373. *ACPI_CAST_PTR(void *, target));
  374. break;
  375. case ACPI_EXD_STRING:
  376. acpi_ut_print_string(obj_desc->string.pointer,
  377. ACPI_UINT8_MAX);
  378. acpi_os_printf("\n");
  379. break;
  380. case ACPI_EXD_BUFFER:
  381. ACPI_DUMP_BUFFER(obj_desc->buffer.pointer,
  382. obj_desc->buffer.length);
  383. break;
  384. case ACPI_EXD_PACKAGE:
  385. /* Dump the package contents */
  386. acpi_os_printf("\nPackage Contents:\n");
  387. acpi_ex_dump_package_obj(obj_desc, 0, 0);
  388. break;
  389. case ACPI_EXD_FIELD:
  390. acpi_ex_dump_object(obj_desc,
  391. acpi_ex_dump_field_common);
  392. break;
  393. case ACPI_EXD_REFERENCE:
  394. acpi_ex_out_string("Class Name",
  395. acpi_ut_get_reference_name
  396. (obj_desc));
  397. acpi_ex_dump_reference_obj(obj_desc);
  398. break;
  399. case ACPI_EXD_LIST:
  400. start = *ACPI_CAST_PTR(void *, target);
  401. next = start;
  402. acpi_os_printf("%20s : %p", name, next);
  403. if (next) {
  404. acpi_os_printf("(%s %2.2X)",
  405. acpi_ut_get_object_type_name
  406. (next), next->common.type);
  407. while (next->common.next_object) {
  408. if ((next->common.type ==
  409. ACPI_TYPE_LOCAL_DATA) && !data) {
  410. data = next;
  411. }
  412. next = next->common.next_object;
  413. acpi_os_printf("->%p(%s %2.2X)", next,
  414. acpi_ut_get_object_type_name
  415. (next),
  416. next->common.type);
  417. if ((next == start) || (next == data)) {
  418. acpi_os_printf
  419. ("\n**** Error: Object list appears to be circular linked");
  420. break;
  421. }
  422. }
  423. }
  424. acpi_os_printf("\n");
  425. break;
  426. case ACPI_EXD_HDLR_LIST:
  427. start = *ACPI_CAST_PTR(void *, target);
  428. next = start;
  429. acpi_os_printf("%20s : %p", name, next);
  430. if (next) {
  431. acpi_os_printf("(%s %2.2X)",
  432. acpi_ut_get_object_type_name
  433. (next),
  434. next->address_space.space_id);
  435. while (next->address_space.next) {
  436. if ((next->common.type ==
  437. ACPI_TYPE_LOCAL_DATA) && !data) {
  438. data = next;
  439. }
  440. next = next->address_space.next;
  441. acpi_os_printf("->%p(%s %2.2X)", next,
  442. acpi_ut_get_object_type_name
  443. (next),
  444. next->address_space.
  445. space_id);
  446. if ((next == start) || (next == data)) {
  447. acpi_os_printf
  448. ("\n**** Error: Handler list appears to be circular linked");
  449. break;
  450. }
  451. }
  452. }
  453. acpi_os_printf("\n");
  454. break;
  455. case ACPI_EXD_RGN_LIST:
  456. start = *ACPI_CAST_PTR(void *, target);
  457. next = start;
  458. acpi_os_printf("%20s : %p", name, next);
  459. if (next) {
  460. acpi_os_printf("(%s %2.2X)",
  461. acpi_ut_get_object_type_name
  462. (next), next->common.type);
  463. while (next->region.next) {
  464. if ((next->common.type ==
  465. ACPI_TYPE_LOCAL_DATA) && !data) {
  466. data = next;
  467. }
  468. next = next->region.next;
  469. acpi_os_printf("->%p(%s %2.2X)", next,
  470. acpi_ut_get_object_type_name
  471. (next),
  472. next->common.type);
  473. if ((next == start) || (next == data)) {
  474. acpi_os_printf
  475. ("\n**** Error: Region list appears to be circular linked");
  476. break;
  477. }
  478. }
  479. }
  480. acpi_os_printf("\n");
  481. break;
  482. case ACPI_EXD_NODE:
  483. node =
  484. *ACPI_CAST_PTR(struct acpi_namespace_node *,
  485. target);
  486. acpi_os_printf("%20s : %p", name, node);
  487. if (node) {
  488. acpi_os_printf(" [%4.4s]", node->name.ascii);
  489. }
  490. acpi_os_printf("\n");
  491. break;
  492. default:
  493. acpi_os_printf("**** Invalid table opcode [%X] ****\n",
  494. info->opcode);
  495. return;
  496. }
  497. info++;
  498. count--;
  499. }
  500. }
  501. /*******************************************************************************
  502. *
  503. * FUNCTION: acpi_ex_dump_operand
  504. *
  505. * PARAMETERS: *obj_desc - Pointer to entry to be dumped
  506. * depth - Current nesting depth
  507. *
  508. * RETURN: None
  509. *
  510. * DESCRIPTION: Dump an operand object
  511. *
  512. ******************************************************************************/
  513. void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
  514. {
  515. u32 length;
  516. u32 index;
  517. ACPI_FUNCTION_NAME(ex_dump_operand)
  518. /* Check if debug output enabled */
  519. if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_EXEC, _COMPONENT)) {
  520. return;
  521. }
  522. if (!obj_desc) {
  523. /* This could be a null element of a package */
  524. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
  525. return;
  526. }
  527. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
  528. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p Namespace Node: ",
  529. obj_desc));
  530. ACPI_DUMP_ENTRY(obj_desc, ACPI_LV_EXEC);
  531. return;
  532. }
  533. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
  534. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  535. "%p is not a node or operand object: [%s]\n",
  536. obj_desc,
  537. acpi_ut_get_descriptor_name(obj_desc)));
  538. ACPI_DUMP_BUFFER(obj_desc, sizeof(union acpi_operand_object));
  539. return;
  540. }
  541. /* obj_desc is a valid object */
  542. if (depth > 0) {
  543. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p ",
  544. depth, " ", depth, obj_desc));
  545. } else {
  546. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p ", obj_desc));
  547. }
  548. /* Decode object type */
  549. switch (obj_desc->common.type) {
  550. case ACPI_TYPE_LOCAL_REFERENCE:
  551. acpi_os_printf("Reference: [%s] ",
  552. acpi_ut_get_reference_name(obj_desc));
  553. switch (obj_desc->reference.class) {
  554. case ACPI_REFCLASS_DEBUG:
  555. acpi_os_printf("\n");
  556. break;
  557. case ACPI_REFCLASS_INDEX:
  558. acpi_os_printf("%p\n", obj_desc->reference.object);
  559. break;
  560. case ACPI_REFCLASS_TABLE:
  561. acpi_os_printf("Table Index %X\n",
  562. obj_desc->reference.value);
  563. break;
  564. case ACPI_REFCLASS_REFOF:
  565. acpi_os_printf("%p [%s]\n", obj_desc->reference.object,
  566. acpi_ut_get_type_name(((union
  567. acpi_operand_object
  568. *)
  569. obj_desc->
  570. reference.
  571. object)->common.
  572. type));
  573. break;
  574. case ACPI_REFCLASS_NAME:
  575. acpi_os_printf("- [%4.4s]\n",
  576. obj_desc->reference.node->name.ascii);
  577. break;
  578. case ACPI_REFCLASS_ARG:
  579. case ACPI_REFCLASS_LOCAL:
  580. acpi_os_printf("%X\n", obj_desc->reference.value);
  581. break;
  582. default: /* Unknown reference class */
  583. acpi_os_printf("%2.2X\n", obj_desc->reference.class);
  584. break;
  585. }
  586. break;
  587. case ACPI_TYPE_BUFFER:
  588. acpi_os_printf("Buffer length %.2X @ %p\n",
  589. obj_desc->buffer.length,
  590. obj_desc->buffer.pointer);
  591. /* Debug only -- dump the buffer contents */
  592. if (obj_desc->buffer.pointer) {
  593. length = obj_desc->buffer.length;
  594. if (length > 128) {
  595. length = 128;
  596. }
  597. acpi_os_printf
  598. ("Buffer Contents: (displaying length 0x%.2X)\n",
  599. length);
  600. ACPI_DUMP_BUFFER(obj_desc->buffer.pointer, length);
  601. }
  602. break;
  603. case ACPI_TYPE_INTEGER:
  604. acpi_os_printf("Integer %8.8X%8.8X\n",
  605. ACPI_FORMAT_UINT64(obj_desc->integer.value));
  606. break;
  607. case ACPI_TYPE_PACKAGE:
  608. acpi_os_printf("Package [Len %X] ElementArray %p\n",
  609. obj_desc->package.count,
  610. obj_desc->package.elements);
  611. /*
  612. * If elements exist, package element pointer is valid,
  613. * and debug_level exceeds 1, dump package's elements.
  614. */
  615. if (obj_desc->package.count &&
  616. obj_desc->package.elements && acpi_dbg_level > 1) {
  617. for (index = 0; index < obj_desc->package.count;
  618. index++) {
  619. acpi_ex_dump_operand(obj_desc->package.
  620. elements[index],
  621. depth + 1);
  622. }
  623. }
  624. break;
  625. case ACPI_TYPE_REGION:
  626. acpi_os_printf("Region %s (%X)",
  627. acpi_ut_get_region_name(obj_desc->region.
  628. space_id),
  629. obj_desc->region.space_id);
  630. /*
  631. * If the address and length have not been evaluated,
  632. * don't print them.
  633. */
  634. if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) {
  635. acpi_os_printf("\n");
  636. } else {
  637. acpi_os_printf(" base %8.8X%8.8X Length %X\n",
  638. ACPI_FORMAT_UINT64(obj_desc->region.
  639. address),
  640. obj_desc->region.length);
  641. }
  642. break;
  643. case ACPI_TYPE_STRING:
  644. acpi_os_printf("String length %X @ %p ",
  645. obj_desc->string.length,
  646. obj_desc->string.pointer);
  647. acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX);
  648. acpi_os_printf("\n");
  649. break;
  650. case ACPI_TYPE_LOCAL_BANK_FIELD:
  651. acpi_os_printf("BankField\n");
  652. break;
  653. case ACPI_TYPE_LOCAL_REGION_FIELD:
  654. acpi_os_printf
  655. ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
  656. "byte=%X bit=%X of below:\n", obj_desc->field.bit_length,
  657. obj_desc->field.access_byte_width,
  658. obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
  659. obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
  660. obj_desc->field.base_byte_offset,
  661. obj_desc->field.start_field_bit_offset);
  662. acpi_ex_dump_operand(obj_desc->field.region_obj, depth + 1);
  663. break;
  664. case ACPI_TYPE_LOCAL_INDEX_FIELD:
  665. acpi_os_printf("IndexField\n");
  666. break;
  667. case ACPI_TYPE_BUFFER_FIELD:
  668. acpi_os_printf("BufferField: %X bits at byte %X bit %X of\n",
  669. obj_desc->buffer_field.bit_length,
  670. obj_desc->buffer_field.base_byte_offset,
  671. obj_desc->buffer_field.start_field_bit_offset);
  672. if (!obj_desc->buffer_field.buffer_obj) {
  673. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL*\n"));
  674. } else if ((obj_desc->buffer_field.buffer_obj)->common.type !=
  675. ACPI_TYPE_BUFFER) {
  676. acpi_os_printf("*not a Buffer*\n");
  677. } else {
  678. acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj,
  679. depth + 1);
  680. }
  681. break;
  682. case ACPI_TYPE_EVENT:
  683. acpi_os_printf("Event\n");
  684. break;
  685. case ACPI_TYPE_METHOD:
  686. acpi_os_printf("Method(%X) @ %p:%X\n",
  687. obj_desc->method.param_count,
  688. obj_desc->method.aml_start,
  689. obj_desc->method.aml_length);
  690. break;
  691. case ACPI_TYPE_MUTEX:
  692. acpi_os_printf("Mutex\n");
  693. break;
  694. case ACPI_TYPE_DEVICE:
  695. acpi_os_printf("Device\n");
  696. break;
  697. case ACPI_TYPE_POWER:
  698. acpi_os_printf("Power\n");
  699. break;
  700. case ACPI_TYPE_PROCESSOR:
  701. acpi_os_printf("Processor\n");
  702. break;
  703. case ACPI_TYPE_THERMAL:
  704. acpi_os_printf("Thermal\n");
  705. break;
  706. default:
  707. /* Unknown Type */
  708. acpi_os_printf("Unknown Type %X\n", obj_desc->common.type);
  709. break;
  710. }
  711. return;
  712. }
  713. /*******************************************************************************
  714. *
  715. * FUNCTION: acpi_ex_dump_operands
  716. *
  717. * PARAMETERS: operands - A list of Operand objects
  718. * opcode_name - AML opcode name
  719. * num_operands - Operand count for this opcode
  720. *
  721. * DESCRIPTION: Dump the operands associated with the opcode
  722. *
  723. ******************************************************************************/
  724. void
  725. acpi_ex_dump_operands(union acpi_operand_object **operands,
  726. const char *opcode_name, u32 num_operands)
  727. {
  728. ACPI_FUNCTION_NAME(ex_dump_operands);
  729. if (!opcode_name) {
  730. opcode_name = "UNKNOWN";
  731. }
  732. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  733. "**** Start operand dump for opcode [%s], %u operands\n",
  734. opcode_name, num_operands));
  735. if (num_operands == 0) {
  736. num_operands = 1;
  737. }
  738. /* Dump the individual operands */
  739. while (num_operands) {
  740. acpi_ex_dump_operand(*operands, 0);
  741. operands++;
  742. num_operands--;
  743. }
  744. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  745. "**** End operand dump for [%s]\n", opcode_name));
  746. return;
  747. }
  748. /*******************************************************************************
  749. *
  750. * FUNCTION: acpi_ex_out* functions
  751. *
  752. * PARAMETERS: title - Descriptive text
  753. * value - Value to be displayed
  754. *
  755. * DESCRIPTION: Object dump output formatting functions. These functions
  756. * reduce the number of format strings required and keeps them
  757. * all in one place for easy modification.
  758. *
  759. ******************************************************************************/
  760. static void acpi_ex_out_string(const char *title, const char *value)
  761. {
  762. acpi_os_printf("%20s : %s\n", title, value);
  763. }
  764. static void acpi_ex_out_pointer(const char *title, const void *value)
  765. {
  766. acpi_os_printf("%20s : %p\n", title, value);
  767. }
  768. /*******************************************************************************
  769. *
  770. * FUNCTION: acpi_ex_dump_namespace_node
  771. *
  772. * PARAMETERS: node - Descriptor to dump
  773. * flags - Force display if TRUE
  774. *
  775. * DESCRIPTION: Dumps the members of the given.Node
  776. *
  777. ******************************************************************************/
  778. void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags)
  779. {
  780. ACPI_FUNCTION_ENTRY();
  781. if (!flags) {
  782. /* Check if debug output enabled */
  783. if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_OBJECTS, _COMPONENT)) {
  784. return;
  785. }
  786. }
  787. acpi_os_printf("%20s : %4.4s\n", "Name", acpi_ut_get_node_name(node));
  788. acpi_os_printf("%20s : %2.2X [%s]\n", "Type",
  789. node->type, acpi_ut_get_type_name(node->type));
  790. acpi_ex_dump_object(ACPI_CAST_PTR(union acpi_operand_object, node),
  791. acpi_ex_dump_node);
  792. }
  793. /*******************************************************************************
  794. *
  795. * FUNCTION: acpi_ex_dump_reference_obj
  796. *
  797. * PARAMETERS: object - Descriptor to dump
  798. *
  799. * DESCRIPTION: Dumps a reference object
  800. *
  801. ******************************************************************************/
  802. static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
  803. {
  804. struct acpi_buffer ret_buf;
  805. acpi_status status;
  806. ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
  807. if (obj_desc->reference.class == ACPI_REFCLASS_NAME) {
  808. acpi_os_printf(" %p ", obj_desc->reference.node);
  809. status = acpi_ns_handle_to_pathname(obj_desc->reference.node,
  810. &ret_buf, TRUE);
  811. if (ACPI_FAILURE(status)) {
  812. acpi_os_printf(" Could not convert name to pathname\n");
  813. } else {
  814. acpi_os_printf("%s\n", (char *)ret_buf.pointer);
  815. ACPI_FREE(ret_buf.pointer);
  816. }
  817. } else if (obj_desc->reference.object) {
  818. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
  819. ACPI_DESC_TYPE_OPERAND) {
  820. acpi_os_printf("%22s %p", "Target :",
  821. obj_desc->reference.object);
  822. if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
  823. acpi_os_printf(" Table Index: %X\n",
  824. obj_desc->reference.value);
  825. } else {
  826. acpi_os_printf(" [%s]\n",
  827. acpi_ut_get_type_name(((union
  828. acpi_operand_object
  829. *)
  830. obj_desc->
  831. reference.
  832. object)->
  833. common.
  834. type));
  835. }
  836. } else {
  837. acpi_os_printf(" Target: %p\n",
  838. obj_desc->reference.object);
  839. }
  840. }
  841. }
  842. /*******************************************************************************
  843. *
  844. * FUNCTION: acpi_ex_dump_package_obj
  845. *
  846. * PARAMETERS: obj_desc - Descriptor to dump
  847. * level - Indentation Level
  848. * index - Package index for this object
  849. *
  850. * DESCRIPTION: Dumps the elements of the package
  851. *
  852. ******************************************************************************/
  853. static void
  854. acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
  855. u32 level, u32 index)
  856. {
  857. u32 i;
  858. /* Indentation and index output */
  859. if (level > 0) {
  860. for (i = 0; i < level; i++) {
  861. acpi_os_printf(" ");
  862. }
  863. acpi_os_printf("[%.2d] ", index);
  864. }
  865. acpi_os_printf("%p ", obj_desc);
  866. /* Null package elements are allowed */
  867. if (!obj_desc) {
  868. acpi_os_printf("[Null Object]\n");
  869. return;
  870. }
  871. /* Packages may only contain a few object types */
  872. switch (obj_desc->common.type) {
  873. case ACPI_TYPE_INTEGER:
  874. acpi_os_printf("[Integer] = %8.8X%8.8X\n",
  875. ACPI_FORMAT_UINT64(obj_desc->integer.value));
  876. break;
  877. case ACPI_TYPE_STRING:
  878. acpi_os_printf("[String] Value: ");
  879. acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX);
  880. acpi_os_printf("\n");
  881. break;
  882. case ACPI_TYPE_BUFFER:
  883. acpi_os_printf("[Buffer] Length %.2X = ",
  884. obj_desc->buffer.length);
  885. if (obj_desc->buffer.length) {
  886. acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
  887. (u8,
  888. obj_desc->buffer.pointer),
  889. obj_desc->buffer.length,
  890. DB_DWORD_DISPLAY, _COMPONENT);
  891. } else {
  892. acpi_os_printf("\n");
  893. }
  894. break;
  895. case ACPI_TYPE_PACKAGE:
  896. acpi_os_printf("[Package] Contains %u Elements:\n",
  897. obj_desc->package.count);
  898. for (i = 0; i < obj_desc->package.count; i++) {
  899. acpi_ex_dump_package_obj(obj_desc->package.elements[i],
  900. level + 1, i);
  901. }
  902. break;
  903. case ACPI_TYPE_LOCAL_REFERENCE:
  904. acpi_os_printf("[Object Reference] Type [%s] %2.2X",
  905. acpi_ut_get_reference_name(obj_desc),
  906. obj_desc->reference.class);
  907. acpi_ex_dump_reference_obj(obj_desc);
  908. break;
  909. default:
  910. acpi_os_printf("[Unknown Type] %X\n", obj_desc->common.type);
  911. break;
  912. }
  913. }
  914. /*******************************************************************************
  915. *
  916. * FUNCTION: acpi_ex_dump_object_descriptor
  917. *
  918. * PARAMETERS: obj_desc - Descriptor to dump
  919. * flags - Force display if TRUE
  920. *
  921. * DESCRIPTION: Dumps the members of the object descriptor given.
  922. *
  923. ******************************************************************************/
  924. void
  925. acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
  926. {
  927. ACPI_FUNCTION_TRACE(ex_dump_object_descriptor);
  928. if (!obj_desc) {
  929. return_VOID;
  930. }
  931. if (!flags) {
  932. /* Check if debug output enabled */
  933. if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_OBJECTS, _COMPONENT)) {
  934. return_VOID;
  935. }
  936. }
  937. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
  938. acpi_ex_dump_namespace_node((struct acpi_namespace_node *)
  939. obj_desc, flags);
  940. acpi_os_printf("\nAttached Object (%p):\n",
  941. ((struct acpi_namespace_node *)obj_desc)->
  942. object);
  943. obj_desc = ((struct acpi_namespace_node *)obj_desc)->object;
  944. goto dump_object;
  945. }
  946. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
  947. acpi_os_printf("%p is not an ACPI operand object: [%s]\n",
  948. obj_desc, acpi_ut_get_descriptor_name(obj_desc));
  949. return_VOID;
  950. }
  951. /* Validate the object type */
  952. if (obj_desc->common.type > ACPI_TYPE_LOCAL_MAX) {
  953. acpi_os_printf("Not a known object type: %2.2X\n",
  954. obj_desc->common.type);
  955. return_VOID;
  956. }
  957. dump_object:
  958. /* Common Fields */
  959. acpi_ex_dump_object(obj_desc, acpi_ex_dump_common);
  960. /* Object-specific fields */
  961. acpi_ex_dump_object(obj_desc, acpi_ex_dump_info[obj_desc->common.type]);
  962. if (obj_desc->common.type == ACPI_TYPE_REGION) {
  963. obj_desc = obj_desc->common.next_object;
  964. if (obj_desc->common.type > ACPI_TYPE_LOCAL_MAX) {
  965. acpi_os_printf
  966. ("Secondary object is not a known object type: %2.2X\n",
  967. obj_desc->common.type);
  968. return_VOID;
  969. }
  970. acpi_os_printf("\nExtra attached Object (%p):\n", obj_desc);
  971. acpi_ex_dump_object(obj_desc,
  972. acpi_ex_dump_info[obj_desc->common.type]);
  973. }
  974. return_VOID;
  975. }
  976. #endif