exdump.c 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
  1. /******************************************************************************
  2. *
  3. * Module Name: exdump - Interpreter debug output routines
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2015, 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(char *title, char *value);
  55. static void acpi_ex_out_pointer(char *title, 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. char *name;
  331. const char *reference_name;
  332. u8 count;
  333. union acpi_operand_object *start;
  334. union acpi_operand_object *data = NULL;
  335. union acpi_operand_object *next;
  336. struct acpi_namespace_node *node;
  337. if (!info) {
  338. acpi_os_printf
  339. ("ExDumpObject: Display not implemented for object type %s\n",
  340. acpi_ut_get_object_type_name(obj_desc));
  341. return;
  342. }
  343. /* First table entry must contain the table length (# of table entries) */
  344. count = info->offset;
  345. while (count) {
  346. target = ACPI_ADD_PTR(u8, obj_desc, info->offset);
  347. name = info->name;
  348. switch (info->opcode) {
  349. case ACPI_EXD_INIT:
  350. break;
  351. case ACPI_EXD_TYPE:
  352. acpi_os_printf("%20s : %2.2X [%s]\n", "Type",
  353. obj_desc->common.type,
  354. acpi_ut_get_object_type_name(obj_desc));
  355. break;
  356. case ACPI_EXD_UINT8:
  357. acpi_os_printf("%20s : %2.2X\n", name, *target);
  358. break;
  359. case ACPI_EXD_UINT16:
  360. acpi_os_printf("%20s : %4.4X\n", name,
  361. ACPI_GET16(target));
  362. break;
  363. case ACPI_EXD_UINT32:
  364. acpi_os_printf("%20s : %8.8X\n", name,
  365. ACPI_GET32(target));
  366. break;
  367. case ACPI_EXD_UINT64:
  368. acpi_os_printf("%20s : %8.8X%8.8X\n", "Value",
  369. ACPI_FORMAT_UINT64(ACPI_GET64(target)));
  370. break;
  371. case ACPI_EXD_POINTER:
  372. case ACPI_EXD_ADDRESS:
  373. acpi_ex_out_pointer(name,
  374. *ACPI_CAST_PTR(void *, target));
  375. break;
  376. case ACPI_EXD_STRING:
  377. acpi_ut_print_string(obj_desc->string.pointer,
  378. ACPI_UINT8_MAX);
  379. acpi_os_printf("\n");
  380. break;
  381. case ACPI_EXD_BUFFER:
  382. ACPI_DUMP_BUFFER(obj_desc->buffer.pointer,
  383. obj_desc->buffer.length);
  384. break;
  385. case ACPI_EXD_PACKAGE:
  386. /* Dump the package contents */
  387. acpi_os_printf("\nPackage Contents:\n");
  388. acpi_ex_dump_package_obj(obj_desc, 0, 0);
  389. break;
  390. case ACPI_EXD_FIELD:
  391. acpi_ex_dump_object(obj_desc,
  392. acpi_ex_dump_field_common);
  393. break;
  394. case ACPI_EXD_REFERENCE:
  395. reference_name = acpi_ut_get_reference_name(obj_desc);
  396. acpi_ex_out_string("Class Name",
  397. ACPI_CAST_PTR(char, reference_name));
  398. acpi_ex_dump_reference_obj(obj_desc);
  399. break;
  400. case ACPI_EXD_LIST:
  401. start = *ACPI_CAST_PTR(void *, target);
  402. next = start;
  403. acpi_os_printf("%20s : %p", name, next);
  404. if (next) {
  405. acpi_os_printf("(%s %2.2X)",
  406. acpi_ut_get_object_type_name
  407. (next), next->common.type);
  408. while (next->common.next_object) {
  409. if ((next->common.type ==
  410. ACPI_TYPE_LOCAL_DATA) && !data) {
  411. data = next;
  412. }
  413. next = next->common.next_object;
  414. acpi_os_printf("->%p(%s %2.2X)", next,
  415. acpi_ut_get_object_type_name
  416. (next),
  417. next->common.type);
  418. if ((next == start) || (next == data)) {
  419. acpi_os_printf
  420. ("\n**** Error: Object list appears to be circular linked");
  421. break;
  422. }
  423. }
  424. }
  425. acpi_os_printf("\n");
  426. break;
  427. case ACPI_EXD_HDLR_LIST:
  428. start = *ACPI_CAST_PTR(void *, target);
  429. next = start;
  430. acpi_os_printf("%20s : %p", name, next);
  431. if (next) {
  432. acpi_os_printf("(%s %2.2X)",
  433. acpi_ut_get_object_type_name
  434. (next), next->common.type);
  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->common.type);
  445. if ((next == start) || (next == data)) {
  446. acpi_os_printf
  447. ("\n**** Error: Handler list appears to be circular linked");
  448. break;
  449. }
  450. }
  451. }
  452. acpi_os_printf("\n");
  453. break;
  454. case ACPI_EXD_RGN_LIST:
  455. start = *ACPI_CAST_PTR(void *, target);
  456. next = start;
  457. acpi_os_printf("%20s : %p", name, next);
  458. if (next) {
  459. acpi_os_printf("(%s %2.2X)",
  460. acpi_ut_get_object_type_name
  461. (next), next->common.type);
  462. while (next->region.next) {
  463. if ((next->common.type ==
  464. ACPI_TYPE_LOCAL_DATA) && !data) {
  465. data = next;
  466. }
  467. next = next->region.next;
  468. acpi_os_printf("->%p(%s %2.2X)", next,
  469. acpi_ut_get_object_type_name
  470. (next),
  471. next->common.type);
  472. if ((next == start) || (next == data)) {
  473. acpi_os_printf
  474. ("\n**** Error: Region list appears to be circular linked");
  475. break;
  476. }
  477. }
  478. }
  479. acpi_os_printf("\n");
  480. break;
  481. case ACPI_EXD_NODE:
  482. node =
  483. *ACPI_CAST_PTR(struct acpi_namespace_node *,
  484. target);
  485. acpi_os_printf("%20s : %p", name, node);
  486. if (node) {
  487. acpi_os_printf(" [%4.4s]", node->name.ascii);
  488. }
  489. acpi_os_printf("\n");
  490. break;
  491. default:
  492. acpi_os_printf("**** Invalid table opcode [%X] ****\n",
  493. info->opcode);
  494. return;
  495. }
  496. info++;
  497. count--;
  498. }
  499. }
  500. /*******************************************************************************
  501. *
  502. * FUNCTION: acpi_ex_dump_operand
  503. *
  504. * PARAMETERS: *obj_desc - Pointer to entry to be dumped
  505. * depth - Current nesting depth
  506. *
  507. * RETURN: None
  508. *
  509. * DESCRIPTION: Dump an operand object
  510. *
  511. ******************************************************************************/
  512. void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
  513. {
  514. u32 length;
  515. u32 index;
  516. ACPI_FUNCTION_NAME(ex_dump_operand)
  517. /* Check if debug output enabled */
  518. if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_EXEC, _COMPONENT)) {
  519. return;
  520. }
  521. if (!obj_desc) {
  522. /* This could be a null element of a package */
  523. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
  524. return;
  525. }
  526. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
  527. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p Namespace Node: ",
  528. obj_desc));
  529. ACPI_DUMP_ENTRY(obj_desc, ACPI_LV_EXEC);
  530. return;
  531. }
  532. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
  533. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  534. "%p is not a node or operand object: [%s]\n",
  535. obj_desc,
  536. acpi_ut_get_descriptor_name(obj_desc)));
  537. ACPI_DUMP_BUFFER(obj_desc, sizeof(union acpi_operand_object));
  538. return;
  539. }
  540. /* obj_desc is a valid object */
  541. if (depth > 0) {
  542. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p ",
  543. depth, " ", depth, obj_desc));
  544. } else {
  545. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p ", obj_desc));
  546. }
  547. /* Decode object type */
  548. switch (obj_desc->common.type) {
  549. case ACPI_TYPE_LOCAL_REFERENCE:
  550. acpi_os_printf("Reference: [%s] ",
  551. acpi_ut_get_reference_name(obj_desc));
  552. switch (obj_desc->reference.class) {
  553. case ACPI_REFCLASS_DEBUG:
  554. acpi_os_printf("\n");
  555. break;
  556. case ACPI_REFCLASS_INDEX:
  557. acpi_os_printf("%p\n", obj_desc->reference.object);
  558. break;
  559. case ACPI_REFCLASS_TABLE:
  560. acpi_os_printf("Table Index %X\n",
  561. obj_desc->reference.value);
  562. break;
  563. case ACPI_REFCLASS_REFOF:
  564. acpi_os_printf("%p [%s]\n", obj_desc->reference.object,
  565. acpi_ut_get_type_name(((union
  566. acpi_operand_object
  567. *)
  568. obj_desc->
  569. reference.
  570. object)->common.
  571. type));
  572. break;
  573. case ACPI_REFCLASS_NAME:
  574. acpi_os_printf("- [%4.4s]\n",
  575. obj_desc->reference.node->name.ascii);
  576. break;
  577. case ACPI_REFCLASS_ARG:
  578. case ACPI_REFCLASS_LOCAL:
  579. acpi_os_printf("%X\n", obj_desc->reference.value);
  580. break;
  581. default: /* Unknown reference class */
  582. acpi_os_printf("%2.2X\n", obj_desc->reference.class);
  583. break;
  584. }
  585. break;
  586. case ACPI_TYPE_BUFFER:
  587. acpi_os_printf("Buffer length %.2X @ %p\n",
  588. obj_desc->buffer.length,
  589. obj_desc->buffer.pointer);
  590. /* Debug only -- dump the buffer contents */
  591. if (obj_desc->buffer.pointer) {
  592. length = obj_desc->buffer.length;
  593. if (length > 128) {
  594. length = 128;
  595. }
  596. acpi_os_printf
  597. ("Buffer Contents: (displaying length 0x%.2X)\n",
  598. length);
  599. ACPI_DUMP_BUFFER(obj_desc->buffer.pointer, length);
  600. }
  601. break;
  602. case ACPI_TYPE_INTEGER:
  603. acpi_os_printf("Integer %8.8X%8.8X\n",
  604. ACPI_FORMAT_UINT64(obj_desc->integer.value));
  605. break;
  606. case ACPI_TYPE_PACKAGE:
  607. acpi_os_printf("Package [Len %X] ElementArray %p\n",
  608. obj_desc->package.count,
  609. obj_desc->package.elements);
  610. /*
  611. * If elements exist, package element pointer is valid,
  612. * and debug_level exceeds 1, dump package's elements.
  613. */
  614. if (obj_desc->package.count &&
  615. obj_desc->package.elements && acpi_dbg_level > 1) {
  616. for (index = 0; index < obj_desc->package.count;
  617. index++) {
  618. acpi_ex_dump_operand(obj_desc->package.
  619. elements[index],
  620. depth + 1);
  621. }
  622. }
  623. break;
  624. case ACPI_TYPE_REGION:
  625. acpi_os_printf("Region %s (%X)",
  626. acpi_ut_get_region_name(obj_desc->region.
  627. space_id),
  628. obj_desc->region.space_id);
  629. /*
  630. * If the address and length have not been evaluated,
  631. * don't print them.
  632. */
  633. if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) {
  634. acpi_os_printf("\n");
  635. } else {
  636. acpi_os_printf(" base %8.8X%8.8X Length %X\n",
  637. ACPI_FORMAT_UINT64(obj_desc->region.
  638. address),
  639. obj_desc->region.length);
  640. }
  641. break;
  642. case ACPI_TYPE_STRING:
  643. acpi_os_printf("String length %X @ %p ",
  644. obj_desc->string.length,
  645. obj_desc->string.pointer);
  646. acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX);
  647. acpi_os_printf("\n");
  648. break;
  649. case ACPI_TYPE_LOCAL_BANK_FIELD:
  650. acpi_os_printf("BankField\n");
  651. break;
  652. case ACPI_TYPE_LOCAL_REGION_FIELD:
  653. acpi_os_printf
  654. ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
  655. "byte=%X bit=%X of below:\n", obj_desc->field.bit_length,
  656. obj_desc->field.access_byte_width,
  657. obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
  658. obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
  659. obj_desc->field.base_byte_offset,
  660. obj_desc->field.start_field_bit_offset);
  661. acpi_ex_dump_operand(obj_desc->field.region_obj, depth + 1);
  662. break;
  663. case ACPI_TYPE_LOCAL_INDEX_FIELD:
  664. acpi_os_printf("IndexField\n");
  665. break;
  666. case ACPI_TYPE_BUFFER_FIELD:
  667. acpi_os_printf("BufferField: %X bits at byte %X bit %X of\n",
  668. obj_desc->buffer_field.bit_length,
  669. obj_desc->buffer_field.base_byte_offset,
  670. obj_desc->buffer_field.start_field_bit_offset);
  671. if (!obj_desc->buffer_field.buffer_obj) {
  672. ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL*\n"));
  673. } else if ((obj_desc->buffer_field.buffer_obj)->common.type !=
  674. ACPI_TYPE_BUFFER) {
  675. acpi_os_printf("*not a Buffer*\n");
  676. } else {
  677. acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj,
  678. depth + 1);
  679. }
  680. break;
  681. case ACPI_TYPE_EVENT:
  682. acpi_os_printf("Event\n");
  683. break;
  684. case ACPI_TYPE_METHOD:
  685. acpi_os_printf("Method(%X) @ %p:%X\n",
  686. obj_desc->method.param_count,
  687. obj_desc->method.aml_start,
  688. obj_desc->method.aml_length);
  689. break;
  690. case ACPI_TYPE_MUTEX:
  691. acpi_os_printf("Mutex\n");
  692. break;
  693. case ACPI_TYPE_DEVICE:
  694. acpi_os_printf("Device\n");
  695. break;
  696. case ACPI_TYPE_POWER:
  697. acpi_os_printf("Power\n");
  698. break;
  699. case ACPI_TYPE_PROCESSOR:
  700. acpi_os_printf("Processor\n");
  701. break;
  702. case ACPI_TYPE_THERMAL:
  703. acpi_os_printf("Thermal\n");
  704. break;
  705. default:
  706. /* Unknown Type */
  707. acpi_os_printf("Unknown Type %X\n", obj_desc->common.type);
  708. break;
  709. }
  710. return;
  711. }
  712. /*******************************************************************************
  713. *
  714. * FUNCTION: acpi_ex_dump_operands
  715. *
  716. * PARAMETERS: operands - A list of Operand objects
  717. * opcode_name - AML opcode name
  718. * num_operands - Operand count for this opcode
  719. *
  720. * DESCRIPTION: Dump the operands associated with the opcode
  721. *
  722. ******************************************************************************/
  723. void
  724. acpi_ex_dump_operands(union acpi_operand_object **operands,
  725. const char *opcode_name, u32 num_operands)
  726. {
  727. ACPI_FUNCTION_NAME(ex_dump_operands);
  728. if (!opcode_name) {
  729. opcode_name = "UNKNOWN";
  730. }
  731. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  732. "**** Start operand dump for opcode [%s], %u operands\n",
  733. opcode_name, num_operands));
  734. if (num_operands == 0) {
  735. num_operands = 1;
  736. }
  737. /* Dump the individual operands */
  738. while (num_operands) {
  739. acpi_ex_dump_operand(*operands, 0);
  740. operands++;
  741. num_operands--;
  742. }
  743. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  744. "**** End operand dump for [%s]\n", opcode_name));
  745. return;
  746. }
  747. /*******************************************************************************
  748. *
  749. * FUNCTION: acpi_ex_out* functions
  750. *
  751. * PARAMETERS: title - Descriptive text
  752. * value - Value to be displayed
  753. *
  754. * DESCRIPTION: Object dump output formatting functions. These functions
  755. * reduce the number of format strings required and keeps them
  756. * all in one place for easy modification.
  757. *
  758. ******************************************************************************/
  759. static void acpi_ex_out_string(char *title, char *value)
  760. {
  761. acpi_os_printf("%20s : %s\n", title, value);
  762. }
  763. static void acpi_ex_out_pointer(char *title, void *value)
  764. {
  765. acpi_os_printf("%20s : %p\n", title, value);
  766. }
  767. /*******************************************************************************
  768. *
  769. * FUNCTION: acpi_ex_dump_namespace_node
  770. *
  771. * PARAMETERS: node - Descriptor to dump
  772. * flags - Force display if TRUE
  773. *
  774. * DESCRIPTION: Dumps the members of the given.Node
  775. *
  776. ******************************************************************************/
  777. void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags)
  778. {
  779. ACPI_FUNCTION_ENTRY();
  780. if (!flags) {
  781. /* Check if debug output enabled */
  782. if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_OBJECTS, _COMPONENT)) {
  783. return;
  784. }
  785. }
  786. acpi_os_printf("%20s : %4.4s\n", "Name", acpi_ut_get_node_name(node));
  787. acpi_os_printf("%20s : %2.2X [%s]\n", "Type",
  788. node->type, acpi_ut_get_type_name(node->type));
  789. acpi_ex_dump_object(ACPI_CAST_PTR(union acpi_operand_object, node),
  790. acpi_ex_dump_node);
  791. }
  792. /*******************************************************************************
  793. *
  794. * FUNCTION: acpi_ex_dump_reference_obj
  795. *
  796. * PARAMETERS: object - Descriptor to dump
  797. *
  798. * DESCRIPTION: Dumps a reference object
  799. *
  800. ******************************************************************************/
  801. static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
  802. {
  803. struct acpi_buffer ret_buf;
  804. acpi_status status;
  805. ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
  806. if (obj_desc->reference.class == ACPI_REFCLASS_NAME) {
  807. acpi_os_printf(" %p ", obj_desc->reference.node);
  808. status = acpi_ns_handle_to_pathname(obj_desc->reference.node,
  809. &ret_buf, TRUE);
  810. if (ACPI_FAILURE(status)) {
  811. acpi_os_printf(" Could not convert name to pathname\n");
  812. } else {
  813. acpi_os_printf("%s\n", (char *)ret_buf.pointer);
  814. ACPI_FREE(ret_buf.pointer);
  815. }
  816. } else if (obj_desc->reference.object) {
  817. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
  818. ACPI_DESC_TYPE_OPERAND) {
  819. acpi_os_printf("%22s %p", "Target :",
  820. obj_desc->reference.object);
  821. if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
  822. acpi_os_printf(" Table Index: %X\n",
  823. obj_desc->reference.value);
  824. } else {
  825. acpi_os_printf(" [%s]\n",
  826. acpi_ut_get_type_name(((union
  827. acpi_operand_object
  828. *)
  829. obj_desc->
  830. reference.
  831. object)->
  832. common.
  833. type));
  834. }
  835. } else {
  836. acpi_os_printf(" Target: %p\n",
  837. obj_desc->reference.object);
  838. }
  839. }
  840. }
  841. /*******************************************************************************
  842. *
  843. * FUNCTION: acpi_ex_dump_package_obj
  844. *
  845. * PARAMETERS: obj_desc - Descriptor to dump
  846. * level - Indentation Level
  847. * index - Package index for this object
  848. *
  849. * DESCRIPTION: Dumps the elements of the package
  850. *
  851. ******************************************************************************/
  852. static void
  853. acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
  854. u32 level, u32 index)
  855. {
  856. u32 i;
  857. /* Indentation and index output */
  858. if (level > 0) {
  859. for (i = 0; i < level; i++) {
  860. acpi_os_printf(" ");
  861. }
  862. acpi_os_printf("[%.2d] ", index);
  863. }
  864. acpi_os_printf("%p ", obj_desc);
  865. /* Null package elements are allowed */
  866. if (!obj_desc) {
  867. acpi_os_printf("[Null Object]\n");
  868. return;
  869. }
  870. /* Packages may only contain a few object types */
  871. switch (obj_desc->common.type) {
  872. case ACPI_TYPE_INTEGER:
  873. acpi_os_printf("[Integer] = %8.8X%8.8X\n",
  874. ACPI_FORMAT_UINT64(obj_desc->integer.value));
  875. break;
  876. case ACPI_TYPE_STRING:
  877. acpi_os_printf("[String] Value: ");
  878. acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX);
  879. acpi_os_printf("\n");
  880. break;
  881. case ACPI_TYPE_BUFFER:
  882. acpi_os_printf("[Buffer] Length %.2X = ",
  883. obj_desc->buffer.length);
  884. if (obj_desc->buffer.length) {
  885. acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
  886. (u8,
  887. obj_desc->buffer.pointer),
  888. obj_desc->buffer.length,
  889. DB_DWORD_DISPLAY, _COMPONENT);
  890. } else {
  891. acpi_os_printf("\n");
  892. }
  893. break;
  894. case ACPI_TYPE_PACKAGE:
  895. acpi_os_printf("[Package] Contains %u Elements:\n",
  896. obj_desc->package.count);
  897. for (i = 0; i < obj_desc->package.count; i++) {
  898. acpi_ex_dump_package_obj(obj_desc->package.elements[i],
  899. level + 1, i);
  900. }
  901. break;
  902. case ACPI_TYPE_LOCAL_REFERENCE:
  903. acpi_os_printf("[Object Reference] Type [%s] %2.2X",
  904. acpi_ut_get_reference_name(obj_desc),
  905. obj_desc->reference.class);
  906. acpi_ex_dump_reference_obj(obj_desc);
  907. break;
  908. default:
  909. acpi_os_printf("[Unknown Type] %X\n", obj_desc->common.type);
  910. break;
  911. }
  912. }
  913. /*******************************************************************************
  914. *
  915. * FUNCTION: acpi_ex_dump_object_descriptor
  916. *
  917. * PARAMETERS: obj_desc - Descriptor to dump
  918. * flags - Force display if TRUE
  919. *
  920. * DESCRIPTION: Dumps the members of the object descriptor given.
  921. *
  922. ******************************************************************************/
  923. void
  924. acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
  925. {
  926. ACPI_FUNCTION_TRACE(ex_dump_object_descriptor);
  927. if (!obj_desc) {
  928. return_VOID;
  929. }
  930. if (!flags) {
  931. /* Check if debug output enabled */
  932. if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_OBJECTS, _COMPONENT)) {
  933. return_VOID;
  934. }
  935. }
  936. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
  937. acpi_ex_dump_namespace_node((struct acpi_namespace_node *)
  938. obj_desc, flags);
  939. acpi_os_printf("\nAttached Object (%p):\n",
  940. ((struct acpi_namespace_node *)obj_desc)->
  941. object);
  942. obj_desc = ((struct acpi_namespace_node *)obj_desc)->object;
  943. goto dump_object;
  944. }
  945. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
  946. acpi_os_printf("%p is not an ACPI operand object: [%s]\n",
  947. obj_desc, acpi_ut_get_descriptor_name(obj_desc));
  948. return_VOID;
  949. }
  950. /* Validate the object type */
  951. if (obj_desc->common.type > ACPI_TYPE_LOCAL_MAX) {
  952. acpi_os_printf("Not a known object type: %2.2X\n",
  953. obj_desc->common.type);
  954. return_VOID;
  955. }
  956. dump_object:
  957. /* Common Fields */
  958. acpi_ex_dump_object(obj_desc, acpi_ex_dump_common);
  959. /* Object-specific fields */
  960. acpi_ex_dump_object(obj_desc, acpi_ex_dump_info[obj_desc->common.type]);
  961. if (obj_desc->common.type == ACPI_TYPE_REGION) {
  962. obj_desc = obj_desc->common.next_object;
  963. if (obj_desc->common.type > ACPI_TYPE_LOCAL_MAX) {
  964. acpi_os_printf
  965. ("Secondary object is not a known object type: %2.2X\n",
  966. obj_desc->common.type);
  967. return_VOID;
  968. }
  969. acpi_os_printf("\nExtra attached Object (%p):\n", obj_desc);
  970. acpi_ex_dump_object(obj_desc,
  971. acpi_ex_dump_info[obj_desc->common.type]);
  972. }
  973. return_VOID;
  974. }
  975. #endif