]> err.no Git - linux-2.6/blob - include/acpi/acdisasm.h
When a merge does not work automatically, git prevents
[linux-2.6] / include / acpi / acdisasm.h
1 /******************************************************************************
2  *
3  * Name: acdisasm.h - AML disassembler
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 __ACDISASM_H__
45 #define __ACDISASM_H__
46
47 #include "amlresrc.h"
48
49
50 #define BLOCK_NONE              0
51 #define BLOCK_PAREN             1
52 #define BLOCK_BRACE             2
53 #define BLOCK_COMMA_LIST        4
54
55 struct acpi_external_list
56 {
57         char                                *path;
58         struct acpi_external_list           *next;
59 };
60
61 extern struct acpi_external_list        *acpi_gbl_external_list;
62 extern const char                       *acpi_gbl_io_decode[2];
63 extern const char                       *acpi_gbl_word_decode[4];
64 extern const char                       *acpi_gbl_consume_decode[2];
65 extern const char                       *acpi_gbl_min_decode[2];
66 extern const char                       *acpi_gbl_max_decode[2];
67 extern const char                       *acpi_gbl_DECdecode[2];
68 extern const char                       *acpi_gbl_RNGdecode[4];
69 extern const char                       *acpi_gbl_MEMdecode[4];
70 extern const char                       *acpi_gbl_RWdecode[2];
71 extern const char                       *acpi_gbl_irq_decode[2];
72 extern const char                       *acpi_gbl_HEdecode[2];
73 extern const char                       *acpi_gbl_LLdecode[2];
74 extern const char                       *acpi_gbl_SHRdecode[2];
75 extern const char                       *acpi_gbl_TYPdecode[4];
76 extern const char                       *acpi_gbl_BMdecode[2];
77 extern const char                       *acpi_gbl_SIZdecode[4];
78 extern const char                       *acpi_gbl_TTPdecode[2];
79 extern const char                       *acpi_gbl_MTPdecode[4];
80 extern const char                       *acpi_gbl_TRSdecode[2];
81
82
83 extern const char                       *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
84 extern const char                       *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
85 extern const char                       *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
86 extern const char                       *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS];
87
88
89 struct acpi_op_walk_info
90 {
91         u32                             level;
92         u32                             bit_offset;
93         struct acpi_walk_state          *walk_state;
94 };
95
96 typedef
97 acpi_status (*asl_walk_callback) (
98         union acpi_parse_object             *op,
99         u32                                 level,
100         void                                *context);
101
102
103 /*
104  * dmwalk
105  */
106 void
107 acpi_dm_disassemble (
108         struct acpi_walk_state          *walk_state,
109         union acpi_parse_object         *origin,
110         u32                             num_opcodes);
111
112
113 /*
114  * dmopcode
115  */
116 void
117 acpi_dm_disassemble_one_op (
118         struct acpi_walk_state          *walk_state,
119         struct acpi_op_walk_info        *info,
120         union acpi_parse_object         *op);
121
122 void
123 acpi_dm_decode_internal_object (
124         union acpi_operand_object       *obj_desc);
125
126 u32
127 acpi_dm_list_type (
128         union acpi_parse_object         *op);
129
130 void
131 acpi_dm_method_flags (
132         union acpi_parse_object         *op);
133
134 void
135 acpi_dm_field_flags (
136         union acpi_parse_object         *op);
137
138 void
139 acpi_dm_address_space (
140         u8                              space_id);
141
142 void
143 acpi_dm_region_flags (
144         union acpi_parse_object         *op);
145
146 void
147 acpi_dm_match_op (
148         union acpi_parse_object         *op);
149
150 u8
151 acpi_dm_comma_if_list_member (
152         union acpi_parse_object         *op);
153
154 void
155 acpi_dm_comma_if_field_member (
156         union acpi_parse_object         *op);
157
158
159 /*
160  * dmnames
161  */
162 u32
163 acpi_dm_dump_name (
164         char                            *name);
165
166 acpi_status
167 acpi_ps_display_object_pathname (
168         struct acpi_walk_state          *walk_state,
169         union acpi_parse_object         *op);
170
171 void
172 acpi_dm_namestring (
173         char                            *name);
174
175
176 /*
177  * dmobject
178  */
179 void
180 acpi_dm_display_internal_object (
181         union acpi_operand_object       *obj_desc,
182         struct acpi_walk_state          *walk_state);
183
184 void
185 acpi_dm_display_arguments (
186         struct acpi_walk_state          *walk_state);
187
188 void
189 acpi_dm_display_locals (
190         struct acpi_walk_state          *walk_state);
191
192 void
193 acpi_dm_dump_method_info (
194         acpi_status                     status,
195         struct acpi_walk_state          *walk_state,
196         union acpi_parse_object         *op);
197
198
199 /*
200  * dmbuffer
201  */
202 void
203 acpi_dm_disasm_byte_list (
204         u32                             level,
205         u8                              *byte_data,
206         u32                             byte_count);
207
208 void
209 acpi_dm_byte_list (
210         struct acpi_op_walk_info        *info,
211         union acpi_parse_object         *op);
212
213 void
214 acpi_dm_is_eisa_id (
215         union acpi_parse_object         *op);
216
217 void
218 acpi_dm_eisa_id (
219         u32                             encoded_id);
220
221 u8
222 acpi_dm_is_unicode_buffer (
223         union acpi_parse_object         *op);
224
225 u8
226 acpi_dm_is_string_buffer (
227         union acpi_parse_object         *op);
228
229
230 /*
231  * dmresrc
232  */
233 void
234 acpi_dm_resource_descriptor (
235         struct acpi_op_walk_info        *info,
236         u8                              *byte_data,
237         u32                             byte_count);
238
239 u8
240 acpi_dm_is_resource_descriptor (
241         union acpi_parse_object         *op);
242
243 void
244 acpi_dm_indent (
245         u32                             level);
246
247 void
248 acpi_dm_bit_list (
249         u16                             mask);
250
251 void
252 acpi_dm_decode_attribute (
253         u8                              attribute);
254
255
256 /*
257  * dmresrcl
258  */
259 void
260 acpi_dm_word_descriptor (
261         struct asl_word_address_desc    *resource,
262         u32                             length,
263         u32                             level);
264
265 void
266 acpi_dm_dword_descriptor (
267         struct asl_dword_address_desc   *resource,
268         u32                             length,
269         u32                             level);
270
271 void
272 acpi_dm_extended_descriptor (
273         struct asl_extended_address_desc   *resource,
274         u32                             length,
275         u32                             level);
276
277 void
278 acpi_dm_qword_descriptor (
279         struct asl_qword_address_desc   *resource,
280         u32                             length,
281         u32                             level);
282
283 void
284 acpi_dm_memory24_descriptor (
285         struct asl_memory_24_desc       *resource,
286         u32                             length,
287         u32                             level);
288
289 void
290 acpi_dm_memory32_descriptor (
291         struct asl_memory_32_desc       *resource,
292         u32                             length,
293         u32                             level);
294
295 void
296 acpi_dm_fixed_mem32_descriptor (
297         struct asl_fixed_memory_32_desc *resource,
298         u32                             length,
299         u32                             level);
300
301 void
302 acpi_dm_generic_register_descriptor (
303         struct asl_general_register_desc *resource,
304         u32                             length,
305         u32                             level);
306
307 void
308 acpi_dm_interrupt_descriptor (
309         struct asl_extended_xrupt_desc *resource,
310         u32                             length,
311         u32                             level);
312
313 void
314 acpi_dm_vendor_large_descriptor (
315         struct asl_large_vendor_desc    *resource,
316         u32                             length,
317         u32                             level);
318
319
320 /*
321  * dmresrcs
322  */
323 void
324 acpi_dm_irq_descriptor (
325         struct asl_irq_format_desc      *resource,
326         u32                             length,
327         u32                             level);
328
329 void
330 acpi_dm_dma_descriptor (
331         struct asl_dma_format_desc      *resource,
332         u32                             length,
333         u32                             level);
334
335 void
336 acpi_dm_io_descriptor (
337         struct asl_io_port_desc         *resource,
338         u32                             length,
339         u32                             level);
340
341 void
342 acpi_dm_fixed_io_descriptor (
343         struct asl_fixed_io_port_desc   *resource,
344         u32                             length,
345         u32                             level);
346
347 void
348 acpi_dm_start_dependent_descriptor (
349         struct asl_start_dependent_desc *resource,
350         u32                             length,
351         u32                             level);
352
353 void
354 acpi_dm_end_dependent_descriptor (
355         struct asl_start_dependent_desc *resource,
356         u32                             length,
357         u32                             level);
358
359 void
360 acpi_dm_vendor_small_descriptor (
361         struct asl_small_vendor_desc    *resource,
362         u32                             length,
363         u32                             level);
364
365
366 /*
367  * dmutils
368  */
369 void
370 acpi_dm_add_to_external_list (
371         char                            *path);
372
373 #endif  /* __ACDISASM_H__ */