blob: f8fa2227583d32b0c6a0dbb9afb112faf7fa1ef8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
3 * Name: acdebug.h - ACPI/AML debugger
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
25 *
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.
29 *
30 * NO WARRANTY
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.
42 */
43
44#ifndef __ACDEBUG_H__
45#define __ACDEBUG_H__
46
47
48#define ACPI_DEBUG_BUFFER_SIZE 4196
49
50struct command_info
51{
52 char *name; /* Command Name */
53 u8 min_args; /* Minimum arguments required */
54};
55
56
57struct argument_info
58{
59 char *name; /* Argument Name */
60};
61
62
63#define PARAM_LIST(pl) pl
Linus Torvalds1da177e2005-04-16 15:20:36 -070064#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
Linus Torvalds1da177e2005-04-16 15:20:36 -070065#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
66 acpi_os_printf PARAM_LIST(fp);}
67
68#define EX_NO_SINGLE_STEP 1
69#define EX_SINGLE_STEP 2
70
71
Linus Torvalds1da177e2005-04-16 15:20:36 -070072/*
73 * dbxface - external debugger interfaces
74 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070075acpi_status
76acpi_db_initialize (
77 void);
78
79void
80acpi_db_terminate (
81 void);
82
83acpi_status
84acpi_db_single_step (
85 struct acpi_walk_state *walk_state,
86 union acpi_parse_object *op,
87 u32 op_type);
88
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
90/*
91 * dbcmds - debug commands and output routines
92 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070093acpi_status
94acpi_db_disassemble_method (
95 char *name);
96
97void
98acpi_db_display_table_info (
99 char *table_arg);
100
101void
102acpi_db_unload_acpi_table (
103 char *table_arg,
104 char *instance_arg);
105
106void
107acpi_db_set_method_breakpoint (
108 char *location,
109 struct acpi_walk_state *walk_state,
110 union acpi_parse_object *op);
111
112void
113acpi_db_set_method_call_breakpoint (
114 union acpi_parse_object *op);
115
116void
Robert Moore73459f72005-06-24 00:00:00 -0400117acpi_db_get_bus_info (
118 void);
119
120void
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121acpi_db_disassemble_aml (
122 char *statements,
123 union acpi_parse_object *op);
124
125void
126acpi_db_dump_namespace (
127 char *start_arg,
128 char *depth_arg);
129
130void
131acpi_db_dump_namespace_by_owner (
132 char *owner_arg,
133 char *depth_arg);
134
135void
136acpi_db_send_notify (
137 char *name,
138 u32 value);
139
140void
141acpi_db_set_method_data (
142 char *type_arg,
143 char *index_arg,
144 char *value_arg);
145
146acpi_status
147acpi_db_display_objects (
148 char *obj_type_arg,
149 char *display_count_arg);
150
151acpi_status
152acpi_db_find_name_in_namespace (
153 char *name_arg);
154
155void
156acpi_db_set_scope (
157 char *name);
158
159acpi_status
160acpi_db_sleep (
161 char *object_arg);
162
163void
164acpi_db_find_references (
165 char *object_arg);
166
167void
Robert Moore44f6c012005-04-18 22:49:35 -0400168acpi_db_display_locks (
169 void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170
171void
172acpi_db_display_resources (
173 char *object_arg);
174
175void
Robert Moore44f6c012005-04-18 22:49:35 -0400176acpi_db_display_gpes (
177 void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
179void
180acpi_db_check_integrity (
181 void);
182
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183void
184acpi_db_generate_gpe (
185 char *gpe_arg,
186 char *block_arg);
187
Robert Moore44f6c012005-04-18 22:49:35 -0400188
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189/*
190 * dbdisply - debug display commands
191 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192void
193acpi_db_display_method_info (
194 union acpi_parse_object *op);
195
196void
197acpi_db_decode_and_display_object (
198 char *target,
199 char *output_type);
200
201void
202acpi_db_display_result_object (
203 union acpi_operand_object *obj_desc,
204 struct acpi_walk_state *walk_state);
205
206acpi_status
207acpi_db_display_all_methods (
208 char *display_count_arg);
209
210void
211acpi_db_display_arguments (
212 void);
213
214void
215acpi_db_display_locals (
216 void);
217
218void
219acpi_db_display_results (
220 void);
221
222void
223acpi_db_display_calling_tree (
224 void);
225
226void
227acpi_db_display_object_type (
228 char *object_arg);
229
230void
231acpi_db_display_argument_object (
232 union acpi_operand_object *obj_desc,
233 struct acpi_walk_state *walk_state);
234
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235
236/*
237 * dbexec - debugger control method execution
238 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239void
240acpi_db_execute (
241 char *name,
242 char **args,
243 u32 flags);
244
245void
246acpi_db_create_execution_threads (
247 char *num_threads_arg,
248 char *num_loops_arg,
249 char *method_name_arg);
250
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251
252/*
253 * dbfileio - Debugger file I/O commands
254 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255acpi_object_type
256acpi_db_match_argument (
257 char *user_argument,
258 struct argument_info *arguments);
259
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260void
261acpi_db_close_debug_file (
262 void);
263
264void
265acpi_db_open_debug_file (
266 char *name);
267
268acpi_status
269acpi_db_load_acpi_table (
270 char *filename);
271
272acpi_status
273acpi_db_get_table_from_file (
274 char *filename,
275 struct acpi_table_header **table);
276
277acpi_status
278acpi_db_read_table_from_file (
279 char *filename,
280 struct acpi_table_header **table);
281
Robert Moore44f6c012005-04-18 22:49:35 -0400282
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283/*
284 * dbhistry - debugger HISTORY command
285 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286void
287acpi_db_add_to_history (
288 char *command_line);
289
290void
Robert Moore44f6c012005-04-18 22:49:35 -0400291acpi_db_display_history (
292 void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293
294char *
295acpi_db_get_from_history (
296 char *command_num_arg);
297
298
299/*
300 * dbinput - user front-end to the AML debugger
301 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302acpi_status
303acpi_db_command_dispatch (
304 char *input_buffer,
305 struct acpi_walk_state *walk_state,
306 union acpi_parse_object *op);
307
308void ACPI_SYSTEM_XFACE
309acpi_db_execute_thread (
310 void *context);
311
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312
313/*
314 * dbstats - Generation and display of ACPI table statistics
315 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316void
317acpi_db_generate_statistics (
318 union acpi_parse_object *root,
319 u8 is_method);
320
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321acpi_status
322acpi_db_display_statistics (
323 char *type_arg);
324
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325
326/*
327 * dbutils - AML debugger utilities
328 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329void
330acpi_db_set_output_destination (
331 u32 where);
332
333void
Robert Moore73459f72005-06-24 00:00:00 -0400334acpi_db_dump_external_object (
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335 union acpi_object *obj_desc,
336 u32 level);
337
338void
339acpi_db_prep_namestring (
340 char *name);
341
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342struct acpi_namespace_node *
343acpi_db_local_ns_lookup (
344 char *name);
345
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346#endif /* __ACDEBUG_H__ */