[PATCH] x86_64: Remove unnecessary include in fault.c
[linux-2.6/zen-sources.git] / include / acpi / acparser.h
blob69827657181864dec118477184d5658c2b8e8348
1 /******************************************************************************
3 * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
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.
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.
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.
45 #ifndef __ACPARSER_H__
46 #define __ACPARSER_H__
49 #define OP_HAS_RETURN_VALUE 1
51 /* variable # arguments */
53 #define ACPI_VAR_ARGS ACPI_UINT32_MAX
56 #define ACPI_PARSE_DELETE_TREE 0x0001
57 #define ACPI_PARSE_NO_TREE_DELETE 0x0000
58 #define ACPI_PARSE_TREE_MASK 0x0001
60 #define ACPI_PARSE_LOAD_PASS1 0x0010
61 #define ACPI_PARSE_LOAD_PASS2 0x0020
62 #define ACPI_PARSE_EXECUTE 0x0030
63 #define ACPI_PARSE_MODE_MASK 0x0030
65 #define ACPI_PARSE_DEFERRED_OP 0x0100
68 /******************************************************************************
70 * Parser interfaces
72 *****************************************************************************/
76 * psxface - Parser external interfaces
78 acpi_status
79 acpi_psx_load_table (
80 u8 *pcode_addr,
81 u32 pcode_length);
83 acpi_status
84 acpi_psx_execute (
85 struct acpi_parameter_info *info);
89 * psargs - Parse AML opcode arguments
91 u8 *
92 acpi_ps_get_next_package_end (
93 struct acpi_parse_state *parser_state);
95 char *
96 acpi_ps_get_next_namestring (
97 struct acpi_parse_state *parser_state);
99 void
100 acpi_ps_get_next_simple_arg (
101 struct acpi_parse_state *parser_state,
102 u32 arg_type,
103 union acpi_parse_object *arg);
105 acpi_status
106 acpi_ps_get_next_namepath (
107 struct acpi_walk_state *walk_state,
108 struct acpi_parse_state *parser_state,
109 union acpi_parse_object *arg,
110 u8 method_call);
112 acpi_status
113 acpi_ps_get_next_arg (
114 struct acpi_walk_state *walk_state,
115 struct acpi_parse_state *parser_state,
116 u32 arg_type,
117 union acpi_parse_object **return_arg);
121 * psfind
123 union acpi_parse_object *
124 acpi_ps_find_name (
125 union acpi_parse_object *scope,
126 u32 name,
127 u32 opcode);
129 union acpi_parse_object*
130 acpi_ps_get_parent (
131 union acpi_parse_object *op);
135 * psopcode - AML Opcode information
137 const struct acpi_opcode_info *
138 acpi_ps_get_opcode_info (
139 u16 opcode);
141 char *
142 acpi_ps_get_opcode_name (
143 u16 opcode);
147 * psparse - top level parsing routines
149 acpi_status
150 acpi_ps_parse_aml (
151 struct acpi_walk_state *walk_state);
154 acpi_ps_get_opcode_size (
155 u32 opcode);
158 acpi_ps_peek_opcode (
159 struct acpi_parse_state *state);
163 * psscope - Scope stack management routines
165 acpi_status
166 acpi_ps_init_scope (
167 struct acpi_parse_state *parser_state,
168 union acpi_parse_object *root);
170 union acpi_parse_object *
171 acpi_ps_get_parent_scope (
172 struct acpi_parse_state *state);
175 acpi_ps_has_completed_scope (
176 struct acpi_parse_state *parser_state);
178 void
179 acpi_ps_pop_scope (
180 struct acpi_parse_state *parser_state,
181 union acpi_parse_object **op,
182 u32 *arg_list,
183 u32 *arg_count);
185 acpi_status
186 acpi_ps_push_scope (
187 struct acpi_parse_state *parser_state,
188 union acpi_parse_object *op,
189 u32 remaining_args,
190 u32 arg_count);
192 void
193 acpi_ps_cleanup_scope (
194 struct acpi_parse_state *state);
198 * pstree - parse tree manipulation routines
200 void
201 acpi_ps_append_arg(
202 union acpi_parse_object *op,
203 union acpi_parse_object *arg);
205 union acpi_parse_object*
206 acpi_ps_find (
207 union acpi_parse_object *scope,
208 char *path,
209 u16 opcode,
210 u32 create);
212 union acpi_parse_object *
213 acpi_ps_get_arg(
214 union acpi_parse_object *op,
215 u32 argn);
217 #ifdef ACPI_FUTURE_USAGE
218 union acpi_parse_object *
219 acpi_ps_get_depth_next (
220 union acpi_parse_object *origin,
221 union acpi_parse_object *op);
222 #endif /* ACPI_FUTURE_USAGE */
226 * pswalk - parse tree walk routines
228 acpi_status
229 acpi_ps_walk_parsed_aml (
230 union acpi_parse_object *start_op,
231 union acpi_parse_object *end_op,
232 union acpi_operand_object *mth_desc,
233 struct acpi_namespace_node *start_node,
234 union acpi_operand_object **params,
235 union acpi_operand_object **caller_return_desc,
236 acpi_owner_id owner_id,
237 acpi_parse_downwards descending_callback,
238 acpi_parse_upwards ascending_callback);
240 acpi_status
241 acpi_ps_get_next_walk_op (
242 struct acpi_walk_state *walk_state,
243 union acpi_parse_object *op,
244 acpi_parse_upwards ascending_callback);
246 acpi_status
247 acpi_ps_delete_completed_op (
248 struct acpi_walk_state *walk_state);
250 void
251 acpi_ps_delete_parse_tree (
252 union acpi_parse_object *root);
256 * psutils - parser utilities
258 union acpi_parse_object *
259 acpi_ps_create_scope_op (
260 void);
262 void
263 acpi_ps_init_op (
264 union acpi_parse_object *op,
265 u16 opcode);
267 union acpi_parse_object *
268 acpi_ps_alloc_op (
269 u16 opcode);
271 void
272 acpi_ps_free_op (
273 union acpi_parse_object *op);
276 acpi_ps_is_leading_char (
277 u32 c);
280 acpi_ps_is_prefix_char (
281 u32 c);
283 #ifdef ACPI_FUTURE_USAGE
285 acpi_ps_get_name(
286 union acpi_parse_object *op);
287 #endif /* ACPI_FUTURE_USAGE */
289 void
290 acpi_ps_set_name(
291 union acpi_parse_object *op,
292 u32 name);
294 #ifdef ACPI_ENABLE_OBJECT_CACHE
295 void
296 acpi_ps_delete_parse_cache (
297 void);
298 #endif
302 * psdump - display parser tree
305 acpi_ps_sprint_path (
306 char *buffer_start,
307 u32 buffer_size,
308 union acpi_parse_object *op);
311 acpi_ps_sprint_op (
312 char *buffer_start,
313 u32 buffer_size,
314 union acpi_parse_object *op);
316 void
317 acpi_ps_show (
318 union acpi_parse_object *op);
321 #endif /* __ACPARSER_H__ */