acdebug.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. /*
  61. * dbxface - external debugger interfaces
  62. */
  63. acpi_status
  64. acpi_db_initialize (
  65. void);
  66. void
  67. acpi_db_terminate (
  68. void);
  69. acpi_status
  70. acpi_db_single_step (
  71. struct acpi_walk_state *walk_state,
  72. union acpi_parse_object *op,
  73. u32 op_type);
  74. /*
  75. * dbcmds - debug commands and output routines
  76. */
  77. acpi_status
  78. acpi_db_disassemble_method (
  79. char *name);
  80. void
  81. acpi_db_display_table_info (
  82. char *table_arg);
  83. void
  84. acpi_db_unload_acpi_table (
  85. char *table_arg,
  86. char *instance_arg);
  87. void
  88. acpi_db_set_method_breakpoint (
  89. char *location,
  90. struct acpi_walk_state *walk_state,
  91. union acpi_parse_object *op);
  92. void
  93. acpi_db_set_method_call_breakpoint (
  94. union acpi_parse_object *op);
  95. void
  96. acpi_db_disassemble_aml (
  97. char *statements,
  98. union acpi_parse_object *op);
  99. void
  100. acpi_db_dump_namespace (
  101. char *start_arg,
  102. char *depth_arg);
  103. void
  104. acpi_db_dump_namespace_by_owner (
  105. char *owner_arg,
  106. char *depth_arg);
  107. void
  108. acpi_db_send_notify (
  109. char *name,
  110. u32 value);
  111. void
  112. acpi_db_set_method_data (
  113. char *type_arg,
  114. char *index_arg,
  115. char *value_arg);
  116. acpi_status
  117. acpi_db_display_objects (
  118. char *obj_type_arg,
  119. char *display_count_arg);
  120. acpi_status
  121. acpi_db_find_name_in_namespace (
  122. char *name_arg);
  123. void
  124. acpi_db_set_scope (
  125. char *name);
  126. acpi_status
  127. acpi_db_sleep (
  128. char *object_arg);
  129. void
  130. acpi_db_find_references (
  131. char *object_arg);
  132. void
  133. acpi_db_display_locks (
  134. void);
  135. void
  136. acpi_db_display_resources (
  137. char *object_arg);
  138. void
  139. acpi_db_display_gpes (
  140. void);
  141. void
  142. acpi_db_check_integrity (
  143. void);
  144. void
  145. acpi_db_generate_gpe (
  146. char *gpe_arg,
  147. char *block_arg);
  148. /*
  149. * dbdisply - debug display commands
  150. */
  151. void
  152. acpi_db_display_method_info (
  153. union acpi_parse_object *op);
  154. void
  155. acpi_db_decode_and_display_object (
  156. char *target,
  157. char *output_type);
  158. void
  159. acpi_db_display_result_object (
  160. union acpi_operand_object *obj_desc,
  161. struct acpi_walk_state *walk_state);
  162. acpi_status
  163. acpi_db_display_all_methods (
  164. char *display_count_arg);
  165. void
  166. acpi_db_display_arguments (
  167. void);
  168. void
  169. acpi_db_display_locals (
  170. void);
  171. void
  172. acpi_db_display_results (
  173. void);
  174. void
  175. acpi_db_display_calling_tree (
  176. void);
  177. void
  178. acpi_db_display_object_type (
  179. char *object_arg);
  180. void
  181. acpi_db_display_argument_object (
  182. union acpi_operand_object *obj_desc,
  183. struct acpi_walk_state *walk_state);
  184. /*
  185. * dbexec - debugger control method execution
  186. */
  187. void
  188. acpi_db_execute (
  189. char *name,
  190. char **args,
  191. u32 flags);
  192. void
  193. acpi_db_create_execution_threads (
  194. char *num_threads_arg,
  195. char *num_loops_arg,
  196. char *method_name_arg);
  197. /*
  198. * dbfileio - Debugger file I/O commands
  199. */
  200. acpi_object_type
  201. acpi_db_match_argument (
  202. char *user_argument,
  203. struct argument_info *arguments);
  204. void
  205. acpi_db_close_debug_file (
  206. void);
  207. void
  208. acpi_db_open_debug_file (
  209. char *name);
  210. acpi_status
  211. acpi_db_load_acpi_table (
  212. char *filename);
  213. acpi_status
  214. acpi_db_get_table_from_file (
  215. char *filename,
  216. struct acpi_table_header **table);
  217. acpi_status
  218. acpi_db_read_table_from_file (
  219. char *filename,
  220. struct acpi_table_header **table);
  221. /*
  222. * dbhistry - debugger HISTORY command
  223. */
  224. void
  225. acpi_db_add_to_history (
  226. char *command_line);
  227. void
  228. acpi_db_display_history (
  229. void);
  230. char *
  231. acpi_db_get_from_history (
  232. char *command_num_arg);
  233. /*
  234. * dbinput - user front-end to the AML debugger
  235. */
  236. acpi_status
  237. acpi_db_command_dispatch (
  238. char *input_buffer,
  239. struct acpi_walk_state *walk_state,
  240. union acpi_parse_object *op);
  241. void ACPI_SYSTEM_XFACE
  242. acpi_db_execute_thread (
  243. void *context);
  244. /*
  245. * dbstats - Generation and display of ACPI table statistics
  246. */
  247. void
  248. acpi_db_generate_statistics (
  249. union acpi_parse_object *root,
  250. u8 is_method);
  251. acpi_status
  252. acpi_db_display_statistics (
  253. char *type_arg);
  254. /*
  255. * dbutils - AML debugger utilities
  256. */
  257. void
  258. acpi_db_set_output_destination (
  259. u32 where);
  260. void
  261. acpi_db_dump_object (
  262. union acpi_object *obj_desc,
  263. u32 level);
  264. void
  265. acpi_db_prep_namestring (
  266. char *name);
  267. struct acpi_namespace_node *
  268. acpi_db_local_ns_lookup (
  269. char *name);
  270. #endif /* __ACDEBUG_H__ */