acdebug.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. /******************************************************************************
  2. *
  3. * Name: acdebug.h - ACPI/AML debugger
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2005, R. Byron Moore
  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. #ifndef __ACDEBUG_H__
  43. #define __ACDEBUG_H__
  44. #define ACPI_DEBUG_BUFFER_SIZE 4196
  45. struct command_info
  46. {
  47. char *name; /* Command Name */
  48. u8 min_args; /* Minimum arguments required */
  49. };
  50. struct argument_info
  51. {
  52. char *name; /* Argument Name */
  53. };
  54. #define PARAM_LIST(pl) pl
  55. #define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
  56. #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
  57. acpi_os_printf PARAM_LIST(fp);}
  58. #define EX_NO_SINGLE_STEP 1
  59. #define EX_SINGLE_STEP 2
  60. /* Prototypes */
  61. /*
  62. * dbxface - external debugger interfaces
  63. */
  64. acpi_status
  65. acpi_db_initialize (
  66. void);
  67. void
  68. acpi_db_terminate (
  69. void);
  70. acpi_status
  71. acpi_db_single_step (
  72. struct acpi_walk_state *walk_state,
  73. union acpi_parse_object *op,
  74. u32 op_type);
  75. acpi_status
  76. acpi_db_start_command (
  77. struct acpi_walk_state *walk_state,
  78. union acpi_parse_object *op);
  79. void
  80. acpi_db_method_end (
  81. struct acpi_walk_state *walk_state);
  82. /*
  83. * dbcmds - debug commands and output routines
  84. */
  85. acpi_status
  86. acpi_db_disassemble_method (
  87. char *name);
  88. void
  89. acpi_db_display_table_info (
  90. char *table_arg);
  91. void
  92. acpi_db_unload_acpi_table (
  93. char *table_arg,
  94. char *instance_arg);
  95. void
  96. acpi_db_set_method_breakpoint (
  97. char *location,
  98. struct acpi_walk_state *walk_state,
  99. union acpi_parse_object *op);
  100. void
  101. acpi_db_set_method_call_breakpoint (
  102. union acpi_parse_object *op);
  103. void
  104. acpi_db_disassemble_aml (
  105. char *statements,
  106. union acpi_parse_object *op);
  107. void
  108. acpi_db_dump_namespace (
  109. char *start_arg,
  110. char *depth_arg);
  111. void
  112. acpi_db_dump_namespace_by_owner (
  113. char *owner_arg,
  114. char *depth_arg);
  115. void
  116. acpi_db_send_notify (
  117. char *name,
  118. u32 value);
  119. void
  120. acpi_db_set_method_data (
  121. char *type_arg,
  122. char *index_arg,
  123. char *value_arg);
  124. acpi_status
  125. acpi_db_display_objects (
  126. char *obj_type_arg,
  127. char *display_count_arg);
  128. acpi_status
  129. acpi_db_find_name_in_namespace (
  130. char *name_arg);
  131. void
  132. acpi_db_set_scope (
  133. char *name);
  134. acpi_status
  135. acpi_db_sleep (
  136. char *object_arg);
  137. void
  138. acpi_db_find_references (
  139. char *object_arg);
  140. void
  141. acpi_db_display_locks (void);
  142. void
  143. acpi_db_display_resources (
  144. char *object_arg);
  145. void
  146. acpi_db_display_gpes (void);
  147. void
  148. acpi_db_check_integrity (
  149. void);
  150. acpi_status
  151. acpi_db_integrity_walk (
  152. acpi_handle obj_handle,
  153. u32 nesting_level,
  154. void *context,
  155. void **return_value);
  156. acpi_status
  157. acpi_db_walk_and_match_name (
  158. acpi_handle obj_handle,
  159. u32 nesting_level,
  160. void *context,
  161. void **return_value);
  162. acpi_status
  163. acpi_db_walk_for_references (
  164. acpi_handle obj_handle,
  165. u32 nesting_level,
  166. void *context,
  167. void **return_value);
  168. acpi_status
  169. acpi_db_walk_for_specific_objects (
  170. acpi_handle obj_handle,
  171. u32 nesting_level,
  172. void *context,
  173. void **return_value);
  174. void
  175. acpi_db_generate_gpe (
  176. char *gpe_arg,
  177. char *block_arg);
  178. /*
  179. * dbdisply - debug display commands
  180. */
  181. void
  182. acpi_db_display_method_info (
  183. union acpi_parse_object *op);
  184. void
  185. acpi_db_decode_and_display_object (
  186. char *target,
  187. char *output_type);
  188. void
  189. acpi_db_display_result_object (
  190. union acpi_operand_object *obj_desc,
  191. struct acpi_walk_state *walk_state);
  192. acpi_status
  193. acpi_db_display_all_methods (
  194. char *display_count_arg);
  195. void
  196. acpi_db_display_arguments (
  197. void);
  198. void
  199. acpi_db_display_locals (
  200. void);
  201. void
  202. acpi_db_display_results (
  203. void);
  204. void
  205. acpi_db_display_calling_tree (
  206. void);
  207. void
  208. acpi_db_display_object_type (
  209. char *object_arg);
  210. void
  211. acpi_db_display_argument_object (
  212. union acpi_operand_object *obj_desc,
  213. struct acpi_walk_state *walk_state);
  214. void
  215. acpi_db_dump_parser_descriptor (
  216. union acpi_parse_object *op);
  217. void *
  218. acpi_db_get_pointer (
  219. void *target);
  220. /*
  221. * dbexec - debugger control method execution
  222. */
  223. void
  224. acpi_db_execute (
  225. char *name,
  226. char **args,
  227. u32 flags);
  228. void
  229. acpi_db_create_execution_threads (
  230. char *num_threads_arg,
  231. char *num_loops_arg,
  232. char *method_name_arg);
  233. acpi_status
  234. acpi_db_execute_method (
  235. struct acpi_db_method_info *info,
  236. struct acpi_buffer *return_obj);
  237. void
  238. acpi_db_execute_setup (
  239. struct acpi_db_method_info *info);
  240. u32
  241. acpi_db_get_outstanding_allocations (
  242. void);
  243. void ACPI_SYSTEM_XFACE
  244. acpi_db_method_thread (
  245. void *context);
  246. acpi_status
  247. acpi_db_execution_walk (
  248. acpi_handle obj_handle,
  249. u32 nesting_level,
  250. void *context,
  251. void **return_value);
  252. /*
  253. * dbfileio - Debugger file I/O commands
  254. */
  255. acpi_object_type
  256. acpi_db_match_argument (
  257. char *user_argument,
  258. struct argument_info *arguments);
  259. acpi_status
  260. ae_local_load_table (
  261. struct acpi_table_header *table_ptr);
  262. void
  263. acpi_db_close_debug_file (
  264. void);
  265. void
  266. acpi_db_open_debug_file (
  267. char *name);
  268. acpi_status
  269. acpi_db_load_acpi_table (
  270. char *filename);
  271. acpi_status
  272. acpi_db_get_table_from_file (
  273. char *filename,
  274. struct acpi_table_header **table);
  275. acpi_status
  276. acpi_db_read_table_from_file (
  277. char *filename,
  278. struct acpi_table_header **table);
  279. /*
  280. * dbhistry - debugger HISTORY command
  281. */
  282. void
  283. acpi_db_add_to_history (
  284. char *command_line);
  285. void
  286. acpi_db_display_history (void);
  287. char *
  288. acpi_db_get_from_history (
  289. char *command_num_arg);
  290. /*
  291. * dbinput - user front-end to the AML debugger
  292. */
  293. acpi_status
  294. acpi_db_command_dispatch (
  295. char *input_buffer,
  296. struct acpi_walk_state *walk_state,
  297. union acpi_parse_object *op);
  298. void ACPI_SYSTEM_XFACE
  299. acpi_db_execute_thread (
  300. void *context);
  301. void
  302. acpi_db_display_help (
  303. char *help_type);
  304. char *
  305. acpi_db_get_next_token (
  306. char *string,
  307. char **next);
  308. u32
  309. acpi_db_get_line (
  310. char *input_buffer);
  311. u32
  312. acpi_db_match_command (
  313. char *user_command);
  314. void
  315. acpi_db_single_thread (
  316. void);
  317. /*
  318. * dbstats - Generation and display of ACPI table statistics
  319. */
  320. void
  321. acpi_db_generate_statistics (
  322. union acpi_parse_object *root,
  323. u8 is_method);
  324. acpi_status
  325. acpi_db_display_statistics (
  326. char *type_arg);
  327. acpi_status
  328. acpi_db_classify_one_object (
  329. acpi_handle obj_handle,
  330. u32 nesting_level,
  331. void *context,
  332. void **return_value);
  333. void
  334. acpi_db_count_namespace_objects (
  335. void);
  336. void
  337. acpi_db_enumerate_object (
  338. union acpi_operand_object *obj_desc);
  339. /*
  340. * dbutils - AML debugger utilities
  341. */
  342. void
  343. acpi_db_set_output_destination (
  344. u32 where);
  345. void
  346. acpi_db_dump_buffer (
  347. u32 address);
  348. void
  349. acpi_db_dump_object (
  350. union acpi_object *obj_desc,
  351. u32 level);
  352. void
  353. acpi_db_prep_namestring (
  354. char *name);
  355. acpi_status
  356. acpi_db_second_pass_parse (
  357. union acpi_parse_object *root);
  358. struct acpi_namespace_node *
  359. acpi_db_local_ns_lookup (
  360. char *name);
  361. #endif /* __ACDEBUG_H__ */