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