ACPI: ACPICA 20060331
[deliverable/linux.git] / include / acpi / acdisasm.h
CommitLineData
1da177e4
LT
1/******************************************************************************
2 *
3 * Name: acdisasm.h - AML disassembler
4 *
5 *****************************************************************************/
6
7/*
4a90c7e8 8 * Copyright (C) 2000 - 2006, R. Byron Moore
1da177e4
LT
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 __ACDISASM_H__
45#define __ACDISASM_H__
46
47#include "amlresrc.h"
48
1da177e4
LT
49#define BLOCK_NONE 0
50#define BLOCK_PAREN 1
51#define BLOCK_BRACE 2
52#define BLOCK_COMMA_LIST 4
8313524a 53#define ACPI_DEFAULT_RESNAME *(u32 *) "__RD"
1da177e4 54
4be44fcd
LB
55struct acpi_external_list {
56 char *path;
57 struct acpi_external_list *next;
1da177e4
LT
58};
59
4be44fcd 60extern struct acpi_external_list *acpi_gbl_external_list;
defba1d8 61
793c2388
BM
62typedef const struct acpi_dmtable_info {
63 u8 opcode;
64 u8 offset;
65 char *name;
defba1d8 66
793c2388
BM
67} acpi_dmtable_info;
68
69/*
70 * Values for Opcode above.
71 * Note: 0-7 must not change, used as a flag shift value
72 */
73#define ACPI_DMT_FLAG0 0
74#define ACPI_DMT_FLAG1 1
75#define ACPI_DMT_FLAG2 2
76#define ACPI_DMT_FLAG3 3
77#define ACPI_DMT_FLAG4 4
78#define ACPI_DMT_FLAG5 5
79#define ACPI_DMT_FLAG6 6
80#define ACPI_DMT_FLAG7 7
81#define ACPI_DMT_FLAGS0 8
82#define ACPI_DMT_FLAGS2 9
83#define ACPI_DMT_UINT8 10
84#define ACPI_DMT_UINT16 11
85#define ACPI_DMT_UINT24 12
86#define ACPI_DMT_UINT32 13
87#define ACPI_DMT_UINT56 14
88#define ACPI_DMT_UINT64 15
89#define ACPI_DMT_STRING 16
90#define ACPI_DMT_NAME4 17
91#define ACPI_DMT_NAME6 18
92#define ACPI_DMT_NAME8 19
93#define ACPI_DMT_CHKSUM 20
94#define ACPI_DMT_SPACEID 21
95#define ACPI_DMT_GAS 22
96#define ACPI_DMT_MADT 23
97#define ACPI_DMT_SRAT 24
98#define ACPI_DMT_EXIT 25
99
100typedef
101void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
102
103struct acpi_dmtable_data {
104 char *signature;
105 struct acpi_dmtable_info *table_info;
106 ACPI_TABLE_HANDLER table_handler;
107};
4be44fcd
LB
108
109struct acpi_op_walk_info {
110 u32 level;
111 u32 bit_offset;
52fc0b02 112 u32 flags;
4be44fcd 113 struct acpi_walk_state *walk_state;
1da177e4
LT
114};
115
116typedef
4be44fcd
LB
117acpi_status(*asl_walk_callback) (union acpi_parse_object * op,
118 u32 level, void *context);
1da177e4 119
8313524a
BM
120struct acpi_resource_tag {
121 u32 bit_index;
122 char *tag;
123};
124
793c2388
BM
125/* Strings used for decoding flags to ASL keywords */
126
127extern const char *acpi_gbl_word_decode[4];
128extern const char *acpi_gbl_irq_decode[2];
129extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
130extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
131extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
132extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS];
133
134extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
135extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
136extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
137extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
138extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
139extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
140extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
141extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
142extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
143extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
144extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
145extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
146extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
147extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];
148extern struct acpi_dmtable_info acpi_dm_table_info_gas[];
149extern struct acpi_dmtable_info acpi_dm_table_info_header[];
150extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
151extern struct acpi_dmtable_info acpi_dm_table_info_madt[];
152extern struct acpi_dmtable_info acpi_dm_table_info_madt0[];
153extern struct acpi_dmtable_info acpi_dm_table_info_madt1[];
154extern struct acpi_dmtable_info acpi_dm_table_info_madt2[];
155extern struct acpi_dmtable_info acpi_dm_table_info_madt3[];
156extern struct acpi_dmtable_info acpi_dm_table_info_madt4[];
157extern struct acpi_dmtable_info acpi_dm_table_info_madt5[];
158extern struct acpi_dmtable_info acpi_dm_table_info_madt6[];
159extern struct acpi_dmtable_info acpi_dm_table_info_madt7[];
160extern struct acpi_dmtable_info acpi_dm_table_info_madt8[];
161extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[];
162extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[];
163extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
164extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[];
165extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[];
166extern struct acpi_dmtable_info acpi_dm_table_info_sbst[];
167extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
168extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
169extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
170extern struct acpi_dmtable_info acpi_dm_table_info_srat[];
171extern struct acpi_dmtable_info acpi_dm_table_info_srat0[];
172extern struct acpi_dmtable_info acpi_dm_table_info_srat1[];
173extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[];
174extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
175
176/*
177 * dmtable
178 */
179void acpi_dm_dump_data_table(struct acpi_table_header *table);
180
181void
182acpi_dm_dump_table(u32 table_length,
183 u32 table_offset,
184 void *table,
185 u32 sub_table_length, struct acpi_dmtable_info *info);
186
187void acpi_dm_line_header(u32 offset, u32 byte_length, char *name);
188
189void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value);
190
191/*
192 * dmtbdump
193 */
194void acpi_dm_dump_asf(struct acpi_table_header *table);
195
196void acpi_dm_dump_cpep(struct acpi_table_header *table);
197
198void acpi_dm_dump_fadt(struct acpi_table_header *table);
199
200void acpi_dm_dump_srat(struct acpi_table_header *table);
201
202void acpi_dm_dump_mcfg(struct acpi_table_header *table);
203
204void acpi_dm_dump_madt(struct acpi_table_header *table);
205
206u32 acpi_dm_dump_rsdp(struct acpi_table_header *table);
207
208void acpi_dm_dump_rsdt(struct acpi_table_header *table);
209
210void acpi_dm_dump_slit(struct acpi_table_header *table);
211
212void acpi_dm_dump_xsdt(struct acpi_table_header *table);
213
1da177e4
LT
214/*
215 * dmwalk
216 */
1da177e4 217void
4be44fcd
LB
218acpi_dm_disassemble(struct acpi_walk_state *walk_state,
219 union acpi_parse_object *origin, u32 num_opcodes);
1da177e4 220
8313524a
BM
221void
222acpi_dm_walk_parse_tree(union acpi_parse_object *op,
223 asl_walk_callback descending_callback,
224 asl_walk_callback ascending_callback, void *context);
225
44f6c012
RM
226/*
227 * dmopcode
228 */
1da177e4 229void
4be44fcd
LB
230acpi_dm_disassemble_one_op(struct acpi_walk_state *walk_state,
231 struct acpi_op_walk_info *info,
232 union acpi_parse_object *op);
1da177e4 233
4be44fcd 234void acpi_dm_decode_internal_object(union acpi_operand_object *obj_desc);
1da177e4 235
4be44fcd 236u32 acpi_dm_list_type(union acpi_parse_object *op);
1da177e4 237
4be44fcd 238void acpi_dm_method_flags(union acpi_parse_object *op);
1da177e4 239
4be44fcd 240void acpi_dm_field_flags(union acpi_parse_object *op);
1da177e4 241
4be44fcd 242void acpi_dm_address_space(u8 space_id);
1da177e4 243
4be44fcd 244void acpi_dm_region_flags(union acpi_parse_object *op);
1da177e4 245
4be44fcd 246void acpi_dm_match_op(union acpi_parse_object *op);
1da177e4 247
4be44fcd 248u8 acpi_dm_comma_if_list_member(union acpi_parse_object *op);
1da177e4 249
4be44fcd 250void acpi_dm_comma_if_field_member(union acpi_parse_object *op);
1da177e4
LT
251
252/*
44f6c012 253 * dmnames
1da177e4 254 */
4be44fcd 255u32 acpi_dm_dump_name(char *name);
44f6c012
RM
256
257acpi_status
4be44fcd
LB
258acpi_ps_display_object_pathname(struct acpi_walk_state *walk_state,
259 union acpi_parse_object *op);
44f6c012 260
4be44fcd 261void acpi_dm_namestring(char *name);
1da177e4 262
44f6c012
RM
263/*
264 * dmobject
265 */
1da177e4 266void
4be44fcd
LB
267acpi_dm_display_internal_object(union acpi_operand_object *obj_desc,
268 struct acpi_walk_state *walk_state);
1da177e4 269
4be44fcd 270void acpi_dm_display_arguments(struct acpi_walk_state *walk_state);
1da177e4 271
4be44fcd 272void acpi_dm_display_locals(struct acpi_walk_state *walk_state);
1da177e4
LT
273
274void
4be44fcd
LB
275acpi_dm_dump_method_info(acpi_status status,
276 struct acpi_walk_state *walk_state,
277 union acpi_parse_object *op);
1da177e4
LT
278
279/*
280 * dmbuffer
281 */
4be44fcd 282void acpi_dm_disasm_byte_list(u32 level, u8 * byte_data, u32 byte_count);
44f6c012
RM
283
284void
4be44fcd 285acpi_dm_byte_list(struct acpi_op_walk_info *info, union acpi_parse_object *op);
1da177e4 286
4be44fcd 287void acpi_dm_is_eisa_id(union acpi_parse_object *op);
1da177e4 288
4be44fcd 289void acpi_dm_eisa_id(u32 encoded_id);
1da177e4 290
4be44fcd 291u8 acpi_dm_is_unicode_buffer(union acpi_parse_object *op);
1da177e4 292
4be44fcd 293u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
1da177e4
LT
294
295/*
296 * dmresrc
297 */
0897831b
BM
298void acpi_dm_dump_integer8(u8 value, char *name);
299
300void acpi_dm_dump_integer16(u16 value, char *name);
301
302void acpi_dm_dump_integer32(u32 value, char *name);
303
304void acpi_dm_dump_integer64(u64 value, char *name);
305
1da177e4 306void
0897831b 307acpi_dm_resource_template(struct acpi_op_walk_info *info,
8313524a 308 union acpi_parse_object *op,
0897831b 309 u8 * byte_data, u32 byte_count);
1da177e4 310
0897831b 311u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
1da177e4 312
4be44fcd 313void acpi_dm_indent(u32 level);
1da177e4 314
4be44fcd 315void acpi_dm_bit_list(u16 mask);
1da177e4 316
4be44fcd 317void acpi_dm_decode_attribute(u8 attribute);
44f6c012 318
8313524a
BM
319void acpi_dm_descriptor_name(void);
320
1da177e4
LT
321/*
322 * dmresrcl
323 */
1da177e4 324void
50eca3eb 325acpi_dm_word_descriptor(union aml_resource *resource, u32 length, u32 level);
1da177e4
LT
326
327void
50eca3eb 328acpi_dm_dword_descriptor(union aml_resource *resource, u32 length, u32 level);
1da177e4
LT
329
330void
50eca3eb 331acpi_dm_extended_descriptor(union aml_resource *resource,
4be44fcd 332 u32 length, u32 level);
1da177e4
LT
333
334void
50eca3eb 335acpi_dm_qword_descriptor(union aml_resource *resource, u32 length, u32 level);
1da177e4
LT
336
337void
50eca3eb 338acpi_dm_memory24_descriptor(union aml_resource *resource,
4be44fcd 339 u32 length, u32 level);
1da177e4
LT
340
341void
50eca3eb 342acpi_dm_memory32_descriptor(union aml_resource *resource,
4be44fcd 343 u32 length, u32 level);
1da177e4
LT
344
345void
50eca3eb 346acpi_dm_fixed_memory32_descriptor(union aml_resource *resource,
bda663d3 347 u32 length, u32 level);
1da177e4
LT
348
349void
50eca3eb 350acpi_dm_generic_register_descriptor(union aml_resource *resource,
4be44fcd 351 u32 length, u32 level);
1da177e4
LT
352
353void
50eca3eb 354acpi_dm_interrupt_descriptor(union aml_resource *resource,
4be44fcd 355 u32 length, u32 level);
1da177e4
LT
356
357void
50eca3eb 358acpi_dm_vendor_large_descriptor(union aml_resource *resource,
4be44fcd 359 u32 length, u32 level);
1da177e4 360
0897831b
BM
361void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level);
362
1da177e4
LT
363/*
364 * dmresrcs
365 */
1da177e4 366void
50eca3eb 367acpi_dm_irq_descriptor(union aml_resource *resource, u32 length, u32 level);
1da177e4
LT
368
369void
50eca3eb 370acpi_dm_dma_descriptor(union aml_resource *resource, u32 length, u32 level);
1da177e4 371
50eca3eb 372void acpi_dm_io_descriptor(union aml_resource *resource, u32 length, u32 level);
1da177e4
LT
373
374void
50eca3eb 375acpi_dm_fixed_io_descriptor(union aml_resource *resource,
4be44fcd 376 u32 length, u32 level);
1da177e4
LT
377
378void
50eca3eb 379acpi_dm_start_dependent_descriptor(union aml_resource *resource,
4be44fcd 380 u32 length, u32 level);
1da177e4
LT
381
382void
50eca3eb 383acpi_dm_end_dependent_descriptor(union aml_resource *resource,
4be44fcd 384 u32 length, u32 level);
1da177e4
LT
385
386void
50eca3eb 387acpi_dm_vendor_small_descriptor(union aml_resource *resource,
4be44fcd 388 u32 length, u32 level);
1da177e4
LT
389
390/*
391 * dmutils
392 */
4be44fcd 393void acpi_dm_add_to_external_list(char *path);
1da177e4 394
8313524a
BM
395/*
396 * dmrestag
397 */
398void acpi_dm_find_resources(union acpi_parse_object *root);
399
400void
401acpi_dm_check_resource_reference(union acpi_parse_object *op,
402 struct acpi_walk_state *walk_state);
403
4be44fcd 404#endif /* __ACDISASM_H__ */
This page took 0.087438 seconds and 5 git commands to generate.