1 /******************************************************************************
3 * Name: acdebug.h - ACPI/AML debugger
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2005, R. Byron Moore
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
48 #define ACPI_DEBUG_BUFFER_SIZE 4196
52 char *name; /* Command Name */
53 u8 min_args; /* Minimum arguments required */
59 char *name; /* Argument Name */
63 #define PARAM_LIST(pl) pl
65 #define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
67 #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
68 acpi_os_printf PARAM_LIST(fp);}
70 #define EX_NO_SINGLE_STEP 1
71 #define EX_SINGLE_STEP 2
78 * dbxface - external debugger interfaces
91 struct acpi_walk_state *walk_state,
92 union acpi_parse_object *op,
96 acpi_db_start_command (
97 struct acpi_walk_state *walk_state,
98 union acpi_parse_object *op);
102 struct acpi_walk_state *walk_state);
106 * dbcmds - debug commands and output routines
110 acpi_db_disassemble_method (
114 acpi_db_display_table_info (
118 acpi_db_unload_acpi_table (
123 acpi_db_set_method_breakpoint (
125 struct acpi_walk_state *walk_state,
126 union acpi_parse_object *op);
129 acpi_db_set_method_call_breakpoint (
130 union acpi_parse_object *op);
133 acpi_db_disassemble_aml (
135 union acpi_parse_object *op);
138 acpi_db_dump_namespace (
143 acpi_db_dump_namespace_by_owner (
148 acpi_db_send_notify (
153 acpi_db_set_method_data (
159 acpi_db_display_objects (
161 char *display_count_arg);
164 acpi_db_find_name_in_namespace (
176 acpi_db_find_references (
180 acpi_db_display_locks (void);
184 acpi_db_display_resources (
188 acpi_db_display_gpes (void);
191 acpi_db_check_integrity (
195 acpi_db_integrity_walk (
196 acpi_handle obj_handle,
199 void **return_value);
202 acpi_db_walk_and_match_name (
203 acpi_handle obj_handle,
206 void **return_value);
209 acpi_db_walk_for_references (
210 acpi_handle obj_handle,
213 void **return_value);
216 acpi_db_walk_for_specific_objects (
217 acpi_handle obj_handle,
220 void **return_value);
223 acpi_db_generate_gpe (
228 * dbdisply - debug display commands
232 acpi_db_display_method_info (
233 union acpi_parse_object *op);
236 acpi_db_decode_and_display_object (
241 acpi_db_display_result_object (
242 union acpi_operand_object *obj_desc,
243 struct acpi_walk_state *walk_state);
246 acpi_db_display_all_methods (
247 char *display_count_arg);
250 acpi_db_display_arguments (
254 acpi_db_display_locals (
258 acpi_db_display_results (
262 acpi_db_display_calling_tree (
266 acpi_db_display_object_type (
270 acpi_db_display_argument_object (
271 union acpi_operand_object *obj_desc,
272 struct acpi_walk_state *walk_state);
275 acpi_db_dump_parser_descriptor (
276 union acpi_parse_object *op);
279 acpi_db_get_pointer (
284 * dbexec - debugger control method execution
294 acpi_db_create_execution_threads (
295 char *num_threads_arg,
297 char *method_name_arg);
300 acpi_db_execute_method (
301 struct acpi_db_method_info *info,
302 struct acpi_buffer *return_obj);
305 acpi_db_execute_setup (
306 struct acpi_db_method_info *info);
309 acpi_db_get_outstanding_allocations (
312 void ACPI_SYSTEM_XFACE
313 acpi_db_method_thread (
317 acpi_db_execution_walk (
318 acpi_handle obj_handle,
321 void **return_value);
325 * dbfileio - Debugger file I/O commands
329 acpi_db_match_argument (
331 struct argument_info *arguments);
334 ae_local_load_table (
335 struct acpi_table_header *table_ptr);
338 acpi_db_close_debug_file (
342 acpi_db_open_debug_file (
346 acpi_db_load_acpi_table (
350 acpi_db_get_table_from_file (
352 struct acpi_table_header **table);
355 acpi_db_read_table_from_file (
357 struct acpi_table_header **table);
360 * dbhistry - debugger HISTORY command
364 acpi_db_add_to_history (
368 acpi_db_display_history (void);
371 acpi_db_get_from_history (
372 char *command_num_arg);
376 * dbinput - user front-end to the AML debugger
380 acpi_db_command_dispatch (
382 struct acpi_walk_state *walk_state,
383 union acpi_parse_object *op);
385 void ACPI_SYSTEM_XFACE
386 acpi_db_execute_thread (
390 acpi_db_display_help (
394 acpi_db_get_next_token (
403 acpi_db_match_command (
407 acpi_db_single_thread (
412 * dbstats - Generation and display of ACPI table statistics
416 acpi_db_generate_statistics (
417 union acpi_parse_object *root,
422 acpi_db_display_statistics (
426 acpi_db_classify_one_object (
427 acpi_handle obj_handle,
430 void **return_value);
433 acpi_db_count_namespace_objects (
437 acpi_db_enumerate_object (
438 union acpi_operand_object *obj_desc);
442 * dbutils - AML debugger utilities
446 acpi_db_set_output_destination (
450 acpi_db_dump_buffer (
454 acpi_db_dump_object (
455 union acpi_object *obj_desc,
459 acpi_db_prep_namestring (
464 acpi_db_second_pass_parse (
465 union acpi_parse_object *root);
467 struct acpi_namespace_node *
468 acpi_db_local_ns_lookup (
472 #endif /* __ACDEBUG_H__ */