acdebug.h 6.4 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/******************************************************************************
 *
 * Name: acdebug.h - ACPI/AML debugger
 *
 *****************************************************************************/

/*
 * Copyright (C) 2000 - 2005, R. Byron Moore
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */

#ifndef __ACDEBUG_H__
#define __ACDEBUG_H__

#define ACPI_DEBUG_BUFFER_SIZE  4196

L
Len Brown 已提交
49 50 51
struct command_info {
	char *name;		/* Command Name */
	u8 min_args;		/* Minimum arguments required */
L
Linus Torvalds 已提交
52 53
};

L
Len Brown 已提交
54 55
struct argument_info {
	char *name;		/* Argument Name */
L
Linus Torvalds 已提交
56 57 58 59 60 61 62 63 64 65 66 67 68
};

#define PARAM_LIST(pl)                  pl
#define DBTEST_OUTPUT_LEVEL(lvl)        if (acpi_gbl_db_opt_verbose)
#define VERBOSE_PRINT(fp)               DBTEST_OUTPUT_LEVEL(lvl) {\
			  acpi_os_printf PARAM_LIST(fp);}

#define EX_NO_SINGLE_STEP               1
#define EX_SINGLE_STEP                  2

/*
 * dbxface - external debugger interfaces
 */
L
Len Brown 已提交
69
acpi_status acpi_db_initialize(void);
L
Linus Torvalds 已提交
70

L
Len Brown 已提交
71
void acpi_db_terminate(void);
L
Linus Torvalds 已提交
72 73

acpi_status
L
Len Brown 已提交
74 75
acpi_db_single_step(struct acpi_walk_state *walk_state,
		    union acpi_parse_object *op, u32 op_type);
L
Linus Torvalds 已提交
76 77 78 79

/*
 * dbcmds - debug commands and output routines
 */
L
Len Brown 已提交
80
acpi_status acpi_db_disassemble_method(char *name);
L
Linus Torvalds 已提交
81

L
Len Brown 已提交
82
void acpi_db_display_table_info(char *table_arg);
L
Linus Torvalds 已提交
83

L
Len Brown 已提交
84
void acpi_db_unload_acpi_table(char *table_arg, char *instance_arg);
L
Linus Torvalds 已提交
85 86

void
L
Len Brown 已提交
87 88 89
acpi_db_set_method_breakpoint(char *location,
			      struct acpi_walk_state *walk_state,
			      union acpi_parse_object *op);
L
Linus Torvalds 已提交
90

L
Len Brown 已提交
91
void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op);
92

L
Len Brown 已提交
93
void acpi_db_get_bus_info(void);
L
Linus Torvalds 已提交
94

L
Len Brown 已提交
95
void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op);
L
Linus Torvalds 已提交
96

L
Len Brown 已提交
97
void acpi_db_dump_namespace(char *start_arg, char *depth_arg);
L
Linus Torvalds 已提交
98

L
Len Brown 已提交
99
void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);
L
Linus Torvalds 已提交
100

L
Len Brown 已提交
101
void acpi_db_send_notify(char *name, u32 value);
L
Linus Torvalds 已提交
102

L
Len Brown 已提交
103
void acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg);
L
Linus Torvalds 已提交
104 105

acpi_status
L
Len Brown 已提交
106
acpi_db_display_objects(char *obj_type_arg, char *display_count_arg);
L
Linus Torvalds 已提交
107

L
Len Brown 已提交
108
acpi_status acpi_db_find_name_in_namespace(char *name_arg);
L
Linus Torvalds 已提交
109

L
Len Brown 已提交
110
void acpi_db_set_scope(char *name);
L
Linus Torvalds 已提交
111

L
Len Brown 已提交
112
acpi_status acpi_db_sleep(char *object_arg);
L
Linus Torvalds 已提交
113

L
Len Brown 已提交
114
void acpi_db_find_references(char *object_arg);
L
Linus Torvalds 已提交
115

L
Len Brown 已提交
116
void acpi_db_display_locks(void);
L
Linus Torvalds 已提交
117

L
Len Brown 已提交
118
void acpi_db_display_resources(char *object_arg);
L
Linus Torvalds 已提交
119

L
Len Brown 已提交
120
void acpi_db_display_gpes(void);
L
Linus Torvalds 已提交
121

L
Len Brown 已提交
122
void acpi_db_check_integrity(void);
L
Linus Torvalds 已提交
123

L
Len Brown 已提交
124
void acpi_db_generate_gpe(char *gpe_arg, char *block_arg);
R
Robert Moore 已提交
125

L
Linus Torvalds 已提交
126 127 128
/*
 * dbdisply - debug display commands
 */
L
Len Brown 已提交
129
void acpi_db_display_method_info(union acpi_parse_object *op);
L
Linus Torvalds 已提交
130

L
Len Brown 已提交
131
void acpi_db_decode_and_display_object(char *target, char *output_type);
L
Linus Torvalds 已提交
132 133

void
L
Len Brown 已提交
134 135
acpi_db_display_result_object(union acpi_operand_object *obj_desc,
			      struct acpi_walk_state *walk_state);
L
Linus Torvalds 已提交
136

L
Len Brown 已提交
137
acpi_status acpi_db_display_all_methods(char *display_count_arg);
L
Linus Torvalds 已提交
138

L
Len Brown 已提交
139
void acpi_db_display_arguments(void);
L
Linus Torvalds 已提交
140

L
Len Brown 已提交
141
void acpi_db_display_locals(void);
L
Linus Torvalds 已提交
142

L
Len Brown 已提交
143
void acpi_db_display_results(void);
L
Linus Torvalds 已提交
144

L
Len Brown 已提交
145
void acpi_db_display_calling_tree(void);
L
Linus Torvalds 已提交
146

L
Len Brown 已提交
147
void acpi_db_display_object_type(char *object_arg);
L
Linus Torvalds 已提交
148 149

void
L
Len Brown 已提交
150 151
acpi_db_display_argument_object(union acpi_operand_object *obj_desc,
				struct acpi_walk_state *walk_state);
L
Linus Torvalds 已提交
152 153 154 155

/*
 * dbexec - debugger control method execution
 */
L
Len Brown 已提交
156
void acpi_db_execute(char *name, char **args, u32 flags);
L
Linus Torvalds 已提交
157 158

void
L
Len Brown 已提交
159 160
acpi_db_create_execution_threads(char *num_threads_arg,
				 char *num_loops_arg, char *method_name_arg);
L
Linus Torvalds 已提交
161 162 163 164 165

/*
 * dbfileio - Debugger file I/O commands
 */
acpi_object_type
L
Len Brown 已提交
166
acpi_db_match_argument(char *user_argument, struct argument_info *arguments);
L
Linus Torvalds 已提交
167

L
Len Brown 已提交
168
void acpi_db_close_debug_file(void);
L
Linus Torvalds 已提交
169

L
Len Brown 已提交
170
void acpi_db_open_debug_file(char *name);
L
Linus Torvalds 已提交
171

L
Len Brown 已提交
172
acpi_status acpi_db_load_acpi_table(char *filename);
L
Linus Torvalds 已提交
173 174

acpi_status
L
Len Brown 已提交
175
acpi_db_get_table_from_file(char *filename, struct acpi_table_header **table);
L
Linus Torvalds 已提交
176 177

acpi_status
L
Len Brown 已提交
178
acpi_db_read_table_from_file(char *filename, struct acpi_table_header **table);
R
Robert Moore 已提交
179

L
Linus Torvalds 已提交
180 181 182
/*
 * dbhistry - debugger HISTORY command
 */
L
Len Brown 已提交
183
void acpi_db_add_to_history(char *command_line);
L
Linus Torvalds 已提交
184

L
Len Brown 已提交
185
void acpi_db_display_history(void);
L
Linus Torvalds 已提交
186

L
Len Brown 已提交
187
char *acpi_db_get_from_history(char *command_num_arg);
L
Linus Torvalds 已提交
188 189 190 191 192

/*
 * dbinput - user front-end to the AML debugger
 */
acpi_status
L
Len Brown 已提交
193 194 195
acpi_db_command_dispatch(char *input_buffer,
			 struct acpi_walk_state *walk_state,
			 union acpi_parse_object *op);
L
Linus Torvalds 已提交
196

L
Len Brown 已提交
197
void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context);
L
Linus Torvalds 已提交
198 199 200 201

/*
 * dbstats - Generation and display of ACPI table statistics
 */
L
Len Brown 已提交
202
void acpi_db_generate_statistics(union acpi_parse_object *root, u8 is_method);
L
Linus Torvalds 已提交
203

L
Len Brown 已提交
204
acpi_status acpi_db_display_statistics(char *type_arg);
L
Linus Torvalds 已提交
205 206 207 208

/*
 * dbutils - AML debugger utilities
 */
L
Len Brown 已提交
209
void acpi_db_set_output_destination(u32 where);
L
Linus Torvalds 已提交
210

L
Len Brown 已提交
211
void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level);
L
Linus Torvalds 已提交
212

L
Len Brown 已提交
213
void acpi_db_prep_namestring(char *name);
L
Linus Torvalds 已提交
214

L
Len Brown 已提交
215
struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
L
Linus Torvalds 已提交
216

L
Len Brown 已提交
217
#endif				/* __ACDEBUG_H__ */