1 /******************************************************************************
3 * Name: acstruct.h - Internal structs
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #ifndef __ACSTRUCT_H__
27 #define __ACSTRUCT_H__
30 /*****************************************************************************
32 * Tree walking typedefs and structs
34 ****************************************************************************/
38 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through
39 * the tree (for whatever reason), and for control method execution.
42 #define NEXT_OP_DOWNWARD 1
43 #define NEXT_OP_UPWARD 2
45 #define WALK_NON_METHOD 0
47 #define WALK_METHOD_RESTART 2
49 typedef struct acpi_walk_state
51 u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\
52 acpi_owner_id owner_id; /* Owner of objects created during the walk */
53 u8 last_predicate; /* Result of last predicate */
54 u8 current_result; /* */
55 u8 next_op_info; /* Info about Next_op */
56 u8 num_operands; /* Stack pointer for Operands[] array */
59 u16 current_sync_level; /* Mutex Sync (nested acquire) level */
60 u16 opcode; /* Current AML opcode */
61 u32 arg_count; /* push for fixed or var args */
64 u32 method_breakpoint; /* For single stepping */
70 struct acpi_node arguments[MTH_NUM_ARGS]; /* Control method arguments */
71 union acpi_operand_obj **caller_return_desc;
72 acpi_generic_state *control_state; /* List of control states (nested IFs) */
73 struct acpi_node local_variables[MTH_NUM_LOCALS]; /* Control method locals */
74 struct acpi_node *method_call_node; /* Called method Node*/
75 acpi_parse_object *method_call_op; /* Method_call Op if running a method */
76 union acpi_operand_obj *method_desc; /* Method descriptor if running a method */
77 struct acpi_node *method_node; /* Method Node if running a method */
78 acpi_parse_object *op; /* Current parser op */
79 union acpi_operand_obj *operands[OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
80 const acpi_opcode_info *op_info; /* Info on current opcode */
81 acpi_parse_object *origin; /* Start of walk [Obsolete] */
82 union acpi_operand_obj **params;
83 acpi_parse_state parser_state; /* Current state of parser */
84 union acpi_operand_obj *result_obj;
85 acpi_generic_state *results; /* Stack of accumulated results */
86 union acpi_operand_obj *return_desc; /* Return object, if any */
87 acpi_generic_state *scope_info; /* Stack of nested scopes */
89 /* TBD: Obsolete with removal of WALK procedure ? */
90 acpi_parse_object *prev_op; /* Last op that was processed */
91 acpi_parse_object *next_op; /* next op to be processed */
94 acpi_parse_downwards descending_callback;
95 acpi_parse_upwards ascending_callback;
96 struct acpi_walk_list *walk_list;
97 struct acpi_walk_state *next; /* Next Walk_state in list */
104 * Walk list - head of a tree of walk states. Multiple walk states are created when there
105 * are nested control methods executing.
107 typedef struct acpi_walk_list
110 acpi_walk_state *walk_state;
111 ACPI_OBJECT_MUTEX acquired_mutex_list; /* List of all currently acquired mutexes */
116 /* Info used by Acpi_ps_init_objects */
118 typedef struct acpi_init_walk_info
126 acpi_table_desc *table_desc;
128 } acpi_init_walk_info;
131 /* Info used by TBD */
133 typedef struct acpi_device_walk_info
138 acpi_table_desc *table_desc;
140 } acpi_device_walk_info;
143 /* TBD: [Restructure] Merge with struct above */
145 typedef struct acpi_walk_info
155 #define ACPI_DISPLAY_SUMMARY 0
156 #define ACPI_DISPLAY_OBJECTS 1
158 typedef struct acpi_get_devices_info
160 acpi_walk_callback user_function;
164 } acpi_get_devices_info;
167 typedef union acpi_aml_operands
169 acpi_operand_object *operands[7];
173 ACPI_OBJECT_INTEGER *type;
174 ACPI_OBJECT_INTEGER *code;
175 ACPI_OBJECT_INTEGER *argument;
181 acpi_operand_object *source;
182 ACPI_OBJECT_INTEGER *index;
183 acpi_operand_object *target;
189 acpi_operand_object *source;
190 ACPI_OBJECT_INTEGER *index;
191 ACPI_OBJECT_INTEGER *length;
192 acpi_operand_object *target;