exdump.c
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:25k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /******************************************************************************
  2.  *
  3.  * Module Name: exdump - Interpreter debug output routines
  4.  *              $Revision: 126 $
  5.  *
  6.  *****************************************************************************/
  7. /*
  8.  *  Copyright (C) 2000, 2001 R. Byron Moore
  9.  *
  10.  *  This program is free software; you can redistribute it and/or modify
  11.  *  it under the terms of the GNU General Public License as published by
  12.  *  the Free Software Foundation; either version 2 of the License, or
  13.  *  (at your option) any later version.
  14.  *
  15.  *  This program is distributed in the hope that it will be useful,
  16.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *  GNU General Public License for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License
  21.  *  along with this program; if not, write to the Free Software
  22.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23.  */
  24. #include "acpi.h"
  25. #include "acinterp.h"
  26. #include "amlcode.h"
  27. #include "acnamesp.h"
  28. #include "actables.h"
  29. #include "acparser.h"
  30. #define _COMPONENT          ACPI_EXECUTER
  31.  MODULE_NAME         ("exdump")
  32. /*
  33.  * The following routines are used for debug output only
  34.  */
  35. #if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
  36. /*****************************************************************************
  37.  *
  38.  * FUNCTION:    Acpi_ex_show_hex_value
  39.  *
  40.  * PARAMETERS:  Byte_count          - Number of bytes to print (1, 2, or 4)
  41.  *              *Aml_start            - Address in AML stream of bytes to print
  42.  *              Interpreter_mode    - Current running mode (load1/Load2/Exec)
  43.  *              Lead_space          - # of spaces to print ahead of value
  44.  *                                    0 => none ahead but one behind
  45.  *
  46.  * DESCRIPTION: Print Byte_count byte(s) starting at Aml_start as a single
  47.  *              value, in hex.  If Byte_count > 1 or the value printed is > 9, also
  48.  *              print in decimal.
  49.  *
  50.  ****************************************************************************/
  51. void
  52. acpi_ex_show_hex_value (
  53. u32                     byte_count,
  54. u8                      *aml_start,
  55. u32                     lead_space)
  56. {
  57. u32                     value;                  /*  Value retrieved from AML stream */
  58. u32                     show_decimal_value;
  59. u32                     length;                 /*  Length of printed field */
  60. u8                      *current_aml_ptr = NULL; /* Pointer to current byte of AML value    */
  61. FUNCTION_TRACE ("Ex_show_hex_value");
  62. if (!aml_start) {
  63. REPORT_ERROR (("Ex_show_hex_value: null pointern"));
  64. }
  65. /*
  66.  * AML numbers are always stored little-endian,
  67.  * even if the processor is big-endian.
  68.  */
  69. for (current_aml_ptr = aml_start + byte_count,
  70. value = 0;
  71. current_aml_ptr > aml_start; ) {
  72. value = (value << 8) + (u32)* --current_aml_ptr;
  73. }
  74. length = lead_space * byte_count + 2;
  75. if (byte_count > 1) {
  76. length += (byte_count - 1);
  77. }
  78. show_decimal_value = (byte_count > 1 || value > 9);
  79. if (show_decimal_value) {
  80. length += 3 + acpi_ex_digits_needed (value, 10);
  81. }
  82. for (length = lead_space; length; --length ) {
  83. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
  84. }
  85. while (byte_count--) {
  86. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *aml_start++));
  87. if (byte_count) {
  88. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
  89. }
  90. }
  91. if (show_decimal_value) {
  92. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%d]", value));
  93. }
  94. if (0 == lead_space) {
  95. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " "));
  96. }
  97. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "n"));
  98. return_VOID;
  99. }
  100. /*****************************************************************************
  101.  *
  102.  * FUNCTION:    Acpi_ex_dump_operand
  103.  *
  104.  * PARAMETERS:  *Entry_desc         - Pointer to entry to be dumped
  105.  *
  106.  * RETURN:      Status
  107.  *
  108.  * DESCRIPTION: Dump a stack entry
  109.  *
  110.  ****************************************************************************/
  111. acpi_status
  112. acpi_ex_dump_operand (
  113. acpi_operand_object     *entry_desc)
  114. {
  115. u8                      *buf = NULL;
  116. u32                     length;
  117. u32                     i;
  118. PROC_NAME ("Ex_dump_operand")
  119. if (!entry_desc) {
  120. /*
  121.  * This usually indicates that something serious is wrong --
  122.  * since most (if not all)
  123.  * code that dumps the stack expects something to be there!
  124.  */
  125. ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null stack entry ptrn"));
  126. return (AE_OK);
  127. }
  128. if (VALID_DESCRIPTOR_TYPE (entry_desc, ACPI_DESC_TYPE_NAMED)) {
  129. ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p NS Node: ", entry_desc));
  130. DUMP_ENTRY (entry_desc, ACPI_LV_INFO);
  131. return (AE_OK);
  132. }
  133. if (!VALID_DESCRIPTOR_TYPE (entry_desc, ACPI_DESC_TYPE_INTERNAL)) {
  134. ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p Is not a local object n", entry_desc));
  135. DUMP_BUFFER (entry_desc, sizeof (acpi_operand_object));
  136. return (AE_OK);
  137. }
  138. /*  Entry_desc is a valid object */
  139. ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p ", entry_desc));
  140. switch (entry_desc->common.type) {
  141. case INTERNAL_TYPE_REFERENCE:
  142. switch (entry_desc->reference.opcode) {
  143. case AML_ZERO_OP:
  144. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Zeron"));
  145. break;
  146. case AML_ONE_OP:
  147. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Onen"));
  148. break;
  149. case AML_ONES_OP:
  150. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Onesn"));
  151. break;
  152. case AML_REVISION_OP:
  153. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Revisionn"));
  154. break;
  155. case AML_DEBUG_OP:
  156. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Debugn"));
  157. break;
  158. case AML_NAME_OP:
  159. DUMP_PATHNAME (entry_desc->reference.object, "Reference: Name: ",
  160.   ACPI_LV_INFO, _COMPONENT);
  161. DUMP_ENTRY (entry_desc->reference.object, ACPI_LV_INFO);
  162. break;
  163. case AML_INDEX_OP:
  164. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Index %pn",
  165.  entry_desc->reference.object));
  166. break;
  167. case AML_ARG_OP:
  168. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Arg%d",
  169.  entry_desc->reference.offset));
  170. if (ACPI_TYPE_INTEGER == entry_desc->common.type) {
  171. /* Value is a Number */
  172. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]",
  173.   HIDWORD(entry_desc->integer.value),
  174.   LODWORD(entry_desc->integer.value)));
  175. }
  176. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "n"));
  177. break;
  178. case AML_LOCAL_OP:
  179. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Local%d",
  180.  entry_desc->reference.offset));
  181. if (ACPI_TYPE_INTEGER == entry_desc->common.type) {
  182. /* Value is a Number */
  183. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]",
  184.   HIDWORD(entry_desc->integer.value),
  185.   LODWORD(entry_desc->integer.value)));
  186. }
  187. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "n"));
  188. break;
  189. case AML_INT_NAMEPATH_OP:
  190. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %Xn",
  191.  entry_desc->reference.node->name));
  192. break;
  193. default:
  194. /*  unknown opcode  */
  195. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown opcode=%Xn",
  196. entry_desc->reference.opcode));
  197. break;
  198. }
  199. break;
  200. case ACPI_TYPE_BUFFER:
  201. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer len %X @ %p n",
  202.  entry_desc->buffer.length,
  203.  entry_desc->buffer.pointer));
  204. length = entry_desc->buffer.length;
  205. if (length > 64) {
  206. length = 64;
  207. }
  208. /* Debug only -- dump the buffer contents */
  209. if (entry_desc->buffer.pointer) {
  210. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer Contents: "));
  211. for (buf = entry_desc->buffer.pointer; length--; ++buf) {
  212. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " %02x", *buf));
  213. }
  214. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"n"));
  215. }
  216. break;
  217. case ACPI_TYPE_INTEGER:
  218. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Integer %8.8X%8.8Xn",
  219.  HIDWORD (entry_desc->integer.value),
  220.  LODWORD (entry_desc->integer.value)));
  221. break;
  222. case INTERNAL_TYPE_IF:
  223. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "If [Integer] %8.8X%8.8Xn",
  224.  HIDWORD (entry_desc->integer.value),
  225.  LODWORD (entry_desc->integer.value)));
  226. break;
  227. case INTERNAL_TYPE_WHILE:
  228. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "While [Integer] %8.8X%8.8Xn",
  229.  HIDWORD (entry_desc->integer.value),
  230.  LODWORD (entry_desc->integer.value)));
  231. break;
  232. case ACPI_TYPE_PACKAGE:
  233. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Package count %X @ %pn",
  234.  entry_desc->package.count, entry_desc->package.elements));
  235. /*
  236.  * If elements exist, package vector pointer is valid,
  237.  * and debug_level exceeds 1, dump package's elements.
  238.  */
  239. if (entry_desc->package.count &&
  240. entry_desc->package.elements &&
  241. acpi_dbg_level > 1) {
  242. acpi_operand_object**element;
  243. u16                 element_index;
  244. for (element_index = 0, element = entry_desc->package.elements;
  245.   element_index < entry_desc->package.count;
  246.   ++element_index, ++element) {
  247. acpi_ex_dump_operand (*element);
  248. }
  249. }
  250. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "n"));
  251. break;
  252. case ACPI_TYPE_REGION:
  253. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Region %s (%X)",
  254. acpi_ut_get_region_name (entry_desc->region.space_id),
  255. entry_desc->region.space_id));
  256. /*
  257.  * If the address and length have not been evaluated,
  258.  * don't print them.
  259.  */
  260. if (!(entry_desc->region.flags & AOPOBJ_DATA_VALID)) {
  261. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "n"));
  262. }
  263. else {
  264. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %8.8X%8.8X Length %Xn",
  265. HIDWORD(entry_desc->region.address),
  266. LODWORD(entry_desc->region.address),
  267. entry_desc->region.length));
  268. }
  269. break;
  270. case ACPI_TYPE_STRING:
  271. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "String length %X @ %p "",
  272.  entry_desc->string.length, entry_desc->string.pointer));
  273. for (i = 0; i < entry_desc->string.length; i++) {
  274. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "%c",
  275.  entry_desc->string.pointer[i]));
  276. }
  277. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, ""n"));
  278. break;
  279. case INTERNAL_TYPE_BANK_FIELD:
  280. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Bank_fieldn"));
  281. break;
  282. case INTERNAL_TYPE_REGION_FIELD:
  283. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
  284. "Region_field: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%X bit=%X of below:n",
  285. entry_desc->field.bit_length,    entry_desc->field.access_bit_width,
  286. entry_desc->field.lock_rule,     entry_desc->field.update_rule,
  287. entry_desc->field.base_byte_offset, entry_desc->field.start_field_bit_offset));
  288. DUMP_STACK_ENTRY (entry_desc->field.region_obj);
  289. break;
  290. case INTERNAL_TYPE_INDEX_FIELD:
  291. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Index_fieldn"));
  292. break;
  293. case ACPI_TYPE_BUFFER_FIELD:
  294. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
  295. "Buffer_field: %X bits at byte %X bit %X of n",
  296. entry_desc->buffer_field.bit_length, entry_desc->buffer_field.base_byte_offset,
  297. entry_desc->buffer_field.start_field_bit_offset));
  298. if (!entry_desc->buffer_field.buffer_obj)
  299. {
  300. ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "*NULL* n"));
  301. }
  302. else if (ACPI_TYPE_BUFFER !=
  303.   entry_desc->buffer_field.buffer_obj->common.type)
  304. {
  305. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "*not a Buffer* n"));
  306. }
  307. else
  308. {
  309. DUMP_STACK_ENTRY (entry_desc->buffer_field.buffer_obj);
  310. }
  311. break;
  312. case ACPI_TYPE_EVENT:
  313. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Eventn"));
  314. break;
  315. case ACPI_TYPE_METHOD:
  316. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
  317. "Method(%X) @ %p:%Xn",
  318. entry_desc->method.param_count,
  319. entry_desc->method.aml_start, entry_desc->method.aml_length));
  320. break;
  321. case ACPI_TYPE_MUTEX:
  322. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Mutexn"));
  323. break;
  324. case ACPI_TYPE_DEVICE:
  325. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Devicen"));
  326. break;
  327. case ACPI_TYPE_POWER:
  328. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Powern"));
  329. break;
  330. case ACPI_TYPE_PROCESSOR:
  331. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Processorn"));
  332. break;
  333. case ACPI_TYPE_THERMAL:
  334. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Thermaln"));
  335. break;
  336. default:
  337. /*  unknown Entry_desc->Common.Type value   */
  338. ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown Type %Xn",
  339. entry_desc->common.type));
  340. /* Back up to previous entry */
  341. entry_desc--;
  342. /* TBD: [Restructure]  Change to use dump object routine !! */
  343. /*       What is all of this?? */
  344. DUMP_BUFFER (entry_desc, sizeof (acpi_operand_object));
  345. DUMP_BUFFER (++entry_desc, sizeof (acpi_operand_object));
  346. DUMP_BUFFER (++entry_desc, sizeof (acpi_operand_object));
  347. break;
  348. }
  349. return (AE_OK);
  350. }
  351. /*****************************************************************************
  352.  *
  353.  * FUNCTION:    Acpi_ex_dump_operands
  354.  *
  355.  * PARAMETERS:  Interpreter_mode     - Load or Exec
  356.  *              *Ident              - Identification
  357.  *              Num_levels          - # of stack entries to dump above line
  358.  *              *Note               - Output notation
  359.  *
  360.  * DESCRIPTION: Dump the object stack
  361.  *
  362.  ****************************************************************************/
  363. void
  364. acpi_ex_dump_operands (
  365. acpi_operand_object     **operands,
  366. operating_mode          interpreter_mode,
  367. NATIVE_CHAR             *ident,
  368. u32                     num_levels,
  369. NATIVE_CHAR             *note,
  370. NATIVE_CHAR             *module_name,
  371. u32                     line_number)
  372. {
  373. NATIVE_UINT             i;
  374. acpi_operand_object     **entry_desc;
  375. PROC_NAME ("Ex_dump_operands");
  376. if (!ident)
  377. {
  378. ident = "?";
  379. }
  380. if (!note)
  381. {
  382. note = "?";
  383. }
  384. ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
  385. "************* Operand Stack Contents (Opcode [%s], %d Operands)n",
  386. ident, num_levels));
  387. if (num_levels == 0)
  388. {
  389. num_levels = 1;
  390. }
  391. /* Dump the stack starting at the top, working down */
  392. for (i = 0; num_levels > 0; i--, num_levels--)
  393. {
  394. entry_desc = &operands[i];
  395. if (ACPI_FAILURE (acpi_ex_dump_operand (*entry_desc)))
  396. {
  397. break;
  398. }
  399. }
  400. ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
  401. "************* Stack dump from %s(%d), %sn",
  402. module_name, line_number, note));
  403. return;
  404. }
  405. /*****************************************************************************
  406.  *
  407.  * FUNCTION:    Acpi_ex_dump_node
  408.  *
  409.  * PARAMETERS:  *Node           - Descriptor to dump
  410.  *              Flags               - Force display
  411.  *
  412.  * DESCRIPTION: Dumps the members of the given.Node
  413.  *
  414.  ****************************************************************************/
  415. void
  416. acpi_ex_dump_node (
  417. acpi_namespace_node     *node,
  418. u32                     flags)
  419. {
  420. FUNCTION_ENTRY ();
  421. if (!flags)
  422. {
  423. if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
  424. {
  425. return;
  426. }
  427. }
  428. acpi_os_printf ("%20s : %4.4sn", "Name",           (char*)&node->name);
  429. acpi_os_printf ("%20s : %sn",  "Type",             acpi_ut_get_type_name (node->type));
  430. acpi_os_printf ("%20s : %Xn",  "Flags",            node->flags);
  431. acpi_os_printf ("%20s : %Xn",  "Owner Id",         node->owner_id);
  432. acpi_os_printf ("%20s : %Xn",  "Reference Count",  node->reference_count);
  433. acpi_os_printf ("%20s : %pn",  "Attached Object",  node->object);
  434. acpi_os_printf ("%20s : %pn",  "Child_list",       node->child);
  435. acpi_os_printf ("%20s : %pn",  "Next_peer",        node->peer);
  436. acpi_os_printf ("%20s : %pn",  "Parent",           acpi_ns_get_parent_object (node));
  437. }
  438. /*****************************************************************************
  439.  *
  440.  * FUNCTION:    Acpi_ex_dump_object_descriptor
  441.  *
  442.  * PARAMETERS:  *Object             - Descriptor to dump
  443.  *              Flags               - Force display
  444.  *
  445.  * DESCRIPTION: Dumps the members of the object descriptor given.
  446.  *
  447.  ****************************************************************************/
  448. void
  449. acpi_ex_dump_object_descriptor (
  450. acpi_operand_object     *obj_desc,
  451. u32                     flags)
  452. {
  453. const acpi_opcode_info  *op_info;
  454. FUNCTION_TRACE ("Ex_dump_object_descriptor");
  455. if (!flags)
  456. {
  457. if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
  458. {
  459. return;
  460. }
  461. }
  462. if (!(VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)))
  463. {
  464. acpi_os_printf ("%p is not a valid ACPI objectn", obj_desc);
  465. return;
  466. }
  467. /* Common Fields */
  468. acpi_os_printf ("%20s : %Xn", "Reference Count", obj_desc->common.reference_count);
  469. acpi_os_printf ("%20s : %Xn", "Flags", obj_desc->common.flags);
  470. /* Object-specific Fields */
  471. switch (obj_desc->common.type)
  472. {
  473. case ACPI_TYPE_INTEGER:
  474. acpi_os_printf ("%20s : %sn", "Type", "Integer");
  475. acpi_os_printf ("%20s : %X%8.8Xn", "Value", HIDWORD (obj_desc->integer.value),
  476.   LODWORD (obj_desc->integer.value));
  477. break;
  478. case ACPI_TYPE_STRING:
  479. acpi_os_printf ("%20s : %sn", "Type", "String");
  480. acpi_os_printf ("%20s : %Xn", "Length", obj_desc->string.length);
  481. acpi_os_printf ("%20s : %pn", "Pointer", obj_desc->string.pointer);
  482. break;
  483. case ACPI_TYPE_BUFFER:
  484. acpi_os_printf ("%20s : %sn", "Type", "Buffer");
  485. acpi_os_printf ("%20s : %Xn", "Length", obj_desc->buffer.length);
  486. acpi_os_printf ("%20s : %pn", "Pointer", obj_desc->buffer.pointer);
  487. break;
  488. case ACPI_TYPE_PACKAGE:
  489. acpi_os_printf ("%20s : %sn", "Type", "Package");
  490. acpi_os_printf ("%20s : %Xn", "Flags", obj_desc->package.flags);
  491. acpi_os_printf ("%20s : %Xn", "Count", obj_desc->package.count);
  492. acpi_os_printf ("%20s : %pn", "Elements", obj_desc->package.elements);
  493. acpi_os_printf ("%20s : %pn", "Next_element", obj_desc->package.next_element);
  494. break;
  495. case ACPI_TYPE_BUFFER_FIELD:
  496. acpi_os_printf ("%20s : %sn", "Type", "Buffer_field");
  497. acpi_os_printf ("%20s : %Xn", "Bit_length", obj_desc->buffer_field.bit_length);
  498. acpi_os_printf ("%20s : %Xn", "Bit_offset", obj_desc->buffer_field.start_field_bit_offset);
  499. acpi_os_printf ("%20s : %Xn", "Base_byte_offset",obj_desc->buffer_field.base_byte_offset);
  500. acpi_os_printf ("%20s : %pn", "Buffer_obj", obj_desc->buffer_field.buffer_obj);
  501. break;
  502. case ACPI_TYPE_DEVICE:
  503. acpi_os_printf ("%20s : %sn", "Type", "Device");
  504. acpi_os_printf ("%20s : %pn", "Addr_handler", obj_desc->device.addr_handler);
  505. acpi_os_printf ("%20s : %pn", "Sys_handler", obj_desc->device.sys_handler);
  506. acpi_os_printf ("%20s : %pn", "Drv_handler", obj_desc->device.drv_handler);
  507. break;
  508. case ACPI_TYPE_EVENT:
  509. acpi_os_printf ("%20s : %sn", "Type", "Event");
  510. acpi_os_printf ("%20s : %Xn", "Semaphore", obj_desc->event.semaphore);
  511. break;
  512. case ACPI_TYPE_METHOD:
  513. acpi_os_printf ("%20s : %sn", "Type", "Method");
  514. acpi_os_printf ("%20s : %Xn", "Param_count", obj_desc->method.param_count);
  515. acpi_os_printf ("%20s : %Xn", "Concurrency", obj_desc->method.concurrency);
  516. acpi_os_printf ("%20s : %pn", "Semaphore", obj_desc->method.semaphore);
  517. acpi_os_printf ("%20s : %Xn", "Aml_length", obj_desc->method.aml_length);
  518. acpi_os_printf ("%20s : %Xn", "Aml_start", obj_desc->method.aml_start);
  519. break;
  520. case ACPI_TYPE_MUTEX:
  521. acpi_os_printf ("%20s : %sn", "Type", "Mutex");
  522. acpi_os_printf ("%20s : %Xn", "Sync_level", obj_desc->mutex.sync_level);
  523. acpi_os_printf ("%20s : %pn", "Owner", obj_desc->mutex.owner);
  524. acpi_os_printf ("%20s : %Xn", "Acquisition_depth", obj_desc->mutex.acquisition_depth);
  525. acpi_os_printf ("%20s : %pn", "Semaphore", obj_desc->mutex.semaphore);
  526. break;
  527. case ACPI_TYPE_REGION:
  528. acpi_os_printf ("%20s : %sn", "Type", "Region");
  529. acpi_os_printf ("%20s : %Xn", "Space_id", obj_desc->region.space_id);
  530. acpi_os_printf ("%20s : %Xn", "Flags", obj_desc->region.flags);
  531. acpi_os_printf ("%20s : %Xn", "Address", obj_desc->region.address);
  532. acpi_os_printf ("%20s : %Xn", "Length", obj_desc->region.length);
  533. acpi_os_printf ("%20s : %pn", "Addr_handler", obj_desc->region.addr_handler);
  534. acpi_os_printf ("%20s : %pn", "Next", obj_desc->region.next);
  535. break;
  536. case ACPI_TYPE_POWER:
  537. acpi_os_printf ("%20s : %sn", "Type", "Power_resource");
  538. acpi_os_printf ("%20s : %Xn", "System_level", obj_desc->power_resource.system_level);
  539. acpi_os_printf ("%20s : %Xn", "Resource_order", obj_desc->power_resource.resource_order);
  540. acpi_os_printf ("%20s : %pn", "Sys_handler", obj_desc->power_resource.sys_handler);
  541. acpi_os_printf ("%20s : %pn", "Drv_handler", obj_desc->power_resource.drv_handler);
  542. break;
  543. case ACPI_TYPE_PROCESSOR:
  544. acpi_os_printf ("%20s : %sn", "Type", "Processor");
  545. acpi_os_printf ("%20s : %Xn", "Processor ID", obj_desc->processor.proc_id);
  546. acpi_os_printf ("%20s : %Xn", "Length", obj_desc->processor.length);
  547. acpi_os_printf ("%20s : %Xn", "Address", obj_desc->processor.address);
  548. acpi_os_printf ("%20s : %pn", "Sys_handler", obj_desc->processor.sys_handler);
  549. acpi_os_printf ("%20s : %pn", "Drv_handler", obj_desc->processor.drv_handler);
  550. acpi_os_printf ("%20s : %pn", "Addr_handler", obj_desc->processor.addr_handler);
  551. break;
  552. case ACPI_TYPE_THERMAL:
  553. acpi_os_printf ("%20s : %sn", "Type", "Thermal_zone");
  554. acpi_os_printf ("%20s : %pn", "Sys_handler", obj_desc->thermal_zone.sys_handler);
  555. acpi_os_printf ("%20s : %pn", "Drv_handler", obj_desc->thermal_zone.drv_handler);
  556. acpi_os_printf ("%20s : %pn", "Addr_handler", obj_desc->thermal_zone.addr_handler);
  557. break;
  558. case INTERNAL_TYPE_REGION_FIELD:
  559. acpi_os_printf ("%20s : %pn", "Access_bit_width", obj_desc->field.access_bit_width);
  560. acpi_os_printf ("%20s : %pn", "Bit_length", obj_desc->field.bit_length);
  561. acpi_os_printf ("%20s : %pn", "Base_byte_offset",obj_desc->field.base_byte_offset);
  562. acpi_os_printf ("%20s : %pn", "Bit_offset", obj_desc->field.start_field_bit_offset);
  563. acpi_os_printf ("%20s : %pn", "Region_obj", obj_desc->field.region_obj);
  564. break;
  565. case INTERNAL_TYPE_BANK_FIELD:
  566. acpi_os_printf ("%20s : %sn", "Type", "Bank_field");
  567. acpi_os_printf ("%20s : %Xn", "Access_bit_width", obj_desc->bank_field.access_bit_width);
  568. acpi_os_printf ("%20s : %Xn", "Lock_rule", obj_desc->bank_field.lock_rule);
  569. acpi_os_printf ("%20s : %Xn", "Update_rule", obj_desc->bank_field.update_rule);
  570. acpi_os_printf ("%20s : %Xn", "Bit_length", obj_desc->bank_field.bit_length);
  571. acpi_os_printf ("%20s : %Xn", "Bit_offset", obj_desc->bank_field.start_field_bit_offset);
  572. acpi_os_printf ("%20s : %Xn", "Base_byte_offset", obj_desc->bank_field.base_byte_offset);
  573. acpi_os_printf ("%20s : %Xn", "Value", obj_desc->bank_field.value);
  574. acpi_os_printf ("%20s : %pn", "Region_obj", obj_desc->bank_field.region_obj);
  575. acpi_os_printf ("%20s : %Xn", "Bank_register_obj", obj_desc->bank_field.bank_register_obj);
  576. break;
  577. case INTERNAL_TYPE_INDEX_FIELD:
  578. acpi_os_printf ("%20s : %sn", "Type", "Index_field");
  579. acpi_os_printf ("%20s : %Xn", "Access_bit_width", obj_desc->index_field.access_bit_width);
  580. acpi_os_printf ("%20s : %Xn", "Lock_rule", obj_desc->index_field.lock_rule);
  581. acpi_os_printf ("%20s : %Xn", "Update_rule", obj_desc->index_field.update_rule);
  582. acpi_os_printf ("%20s : %Xn", "Bit_length", obj_desc->index_field.bit_length);
  583. acpi_os_printf ("%20s : %Xn", "Bit_offset", obj_desc->index_field.start_field_bit_offset);
  584. acpi_os_printf ("%20s : %Xn", "Value", obj_desc->index_field.value);
  585. acpi_os_printf ("%20s : %Xn", "Index", obj_desc->index_field.index_obj);
  586. acpi_os_printf ("%20s : %Xn", "Data", obj_desc->index_field.data_obj);
  587. break;
  588. case INTERNAL_TYPE_REFERENCE:
  589. op_info = acpi_ps_get_opcode_info (obj_desc->reference.opcode);
  590. acpi_os_printf ("%20s : %sn", "Type", "Reference");
  591. acpi_os_printf ("%20s : %Xn", "Target_type", obj_desc->reference.target_type);
  592. acpi_os_printf ("%20s : %sn", "Opcode", op_info->name);
  593. acpi_os_printf ("%20s : %Xn", "Offset", obj_desc->reference.offset);
  594. acpi_os_printf ("%20s : %pn", "Obj_desc", obj_desc->reference.object);
  595. acpi_os_printf ("%20s : %pn", "Node", obj_desc->reference.node);
  596. acpi_os_printf ("%20s : %pn", "Where", obj_desc->reference.where);
  597. break;
  598. case INTERNAL_TYPE_ADDRESS_HANDLER:
  599. acpi_os_printf ("%20s : %sn", "Type", "Address Handler");
  600. acpi_os_printf ("%20s : %Xn", "Space_id", obj_desc->addr_handler.space_id);
  601. acpi_os_printf ("%20s : %pn", "Next", obj_desc->addr_handler.next);
  602. acpi_os_printf ("%20s : %pn", "Region_list", obj_desc->addr_handler.region_list);
  603. acpi_os_printf ("%20s : %pn", "Node", obj_desc->addr_handler.node);
  604. acpi_os_printf ("%20s : %pn", "Handler", obj_desc->addr_handler.handler);
  605. acpi_os_printf ("%20s : %pn", "Context", obj_desc->addr_handler.context);
  606. break;
  607. case INTERNAL_TYPE_NOTIFY:
  608. acpi_os_printf ("%20s : %sn", "Type", "Notify Handler");
  609. acpi_os_printf ("%20s : %pn", "Node", obj_desc->notify_handler.node);
  610. acpi_os_printf ("%20s : %pn", "Handler", obj_desc->notify_handler.handler);
  611. acpi_os_printf ("%20s : %pn", "Context", obj_desc->notify_handler.context);
  612. break;
  613. case INTERNAL_TYPE_ALIAS:
  614. case INTERNAL_TYPE_FIELD_DEFN:
  615. case INTERNAL_TYPE_BANK_FIELD_DEFN:
  616. case INTERNAL_TYPE_INDEX_FIELD_DEFN:
  617. case INTERNAL_TYPE_IF:
  618. case INTERNAL_TYPE_ELSE:
  619. case INTERNAL_TYPE_WHILE:
  620. case INTERNAL_TYPE_SCOPE:
  621. case INTERNAL_TYPE_DEF_ANY:
  622. acpi_os_printf ("*** Structure display not implemented for type %X! ***n",
  623. obj_desc->common.type);
  624. break;
  625. default:
  626. acpi_os_printf ("*** Cannot display unknown type %X! ***n", obj_desc->common.type);
  627. break;
  628. }
  629. return_VOID;
  630. }
  631. #endif