aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acstruct.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/acstruct.h')
-rw-r--r--include/acpi/acstruct.h216
1 files changed, 99 insertions, 117 deletions
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 27b22bb3d229..99d235339801 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -44,14 +44,12 @@
44#ifndef __ACSTRUCT_H__ 44#ifndef __ACSTRUCT_H__
45#define __ACSTRUCT_H__ 45#define __ACSTRUCT_H__
46 46
47
48/***************************************************************************** 47/*****************************************************************************
49 * 48 *
50 * Tree walking typedefs and structs 49 * Tree walking typedefs and structs
51 * 50 *
52 ****************************************************************************/ 51 ****************************************************************************/
53 52
54
55/* 53/*
56 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 54 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through
57 * the tree (for whatever reason), and for control method execution. 55 * the tree (for whatever reason), and for control method execution.
@@ -65,97 +63,90 @@
65#define ACPI_WALK_CONST_REQUIRED 3 63#define ACPI_WALK_CONST_REQUIRED 3
66#define ACPI_WALK_CONST_OPTIONAL 4 64#define ACPI_WALK_CONST_OPTIONAL 4
67 65
68struct acpi_walk_state 66struct acpi_walk_state {
69{ 67 u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */
70 u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\ 68 u8 walk_type;
71 u8 walk_type; 69 acpi_owner_id owner_id; /* Owner of objects created during the walk */
72 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 70 u8 last_predicate; /* Result of last predicate */
73 u8 last_predicate; /* Result of last predicate */ 71 u8 current_result; /* */
74 u8 current_result; /* */ 72 u8 next_op_info; /* Info about next_op */
75 u8 next_op_info; /* Info about next_op */ 73 u8 num_operands; /* Stack pointer for Operands[] array */
76 u8 num_operands; /* Stack pointer for Operands[] array */ 74 u8 return_used;
77 u8 return_used; 75 u16 opcode; /* Current AML opcode */
78 u16 opcode; /* Current AML opcode */ 76 u8 scope_depth;
79 u8 scope_depth; 77 u8 pass_number; /* Parse pass during table load */
80 u8 pass_number; /* Parse pass during table load */ 78 u32 arg_count; /* push for fixed or var args */
81 u32 arg_count; /* push for fixed or var args */ 79 u32 aml_offset;
82 u32 aml_offset; 80 u32 arg_types;
83 u32 arg_types; 81 u32 method_breakpoint; /* For single stepping */
84 u32 method_breakpoint; /* For single stepping */ 82 u32 user_breakpoint; /* User AML breakpoint */
85 u32 user_breakpoint; /* User AML breakpoint */ 83 u32 parse_flags;
86 u32 parse_flags; 84 u32 prev_arg_types;
87 u32 prev_arg_types; 85
88 86 u8 *aml_last_while;
89 u8 *aml_last_while; 87 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
90 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ 88 union acpi_operand_object **caller_return_desc;
91 union acpi_operand_object **caller_return_desc; 89 union acpi_generic_state *control_state; /* List of control states (nested IFs) */
92 union acpi_generic_state *control_state; /* List of control states (nested IFs) */ 90 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
93 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ 91 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
94 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ 92 union acpi_operand_object *implicit_return_obj;
95 union acpi_operand_object *implicit_return_obj; 93 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
96 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ 94 struct acpi_namespace_node *method_call_node; /* Called method Node */
97 struct acpi_namespace_node *method_call_node; /* Called method Node*/ 95 union acpi_parse_object *method_call_op; /* method_call Op if running a method */
98 union acpi_parse_object *method_call_op; /* method_call Op if running a method */ 96 union acpi_operand_object *method_desc; /* Method descriptor if running a method */
99 union acpi_operand_object *method_desc; /* Method descriptor if running a method */ 97 struct acpi_namespace_node *method_node; /* Method node if running a method. */
100 struct acpi_namespace_node *method_node; /* Method node if running a method. */ 98 union acpi_parse_object *op; /* Current parser op */
101 union acpi_parse_object *op; /* Current parser op */ 99 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
102 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ 100 const struct acpi_opcode_info *op_info; /* Info on current opcode */
103 const struct acpi_opcode_info *op_info; /* Info on current opcode */ 101 union acpi_parse_object *origin; /* Start of walk [Obsolete] */
104 union acpi_parse_object *origin; /* Start of walk [Obsolete] */ 102 union acpi_operand_object **params;
105 union acpi_operand_object **params; 103 struct acpi_parse_state parser_state; /* Current state of parser */
106 struct acpi_parse_state parser_state; /* Current state of parser */ 104 union acpi_operand_object *result_obj;
107 union acpi_operand_object *result_obj; 105 union acpi_generic_state *results; /* Stack of accumulated results */
108 union acpi_generic_state *results; /* Stack of accumulated results */ 106 union acpi_operand_object *return_desc; /* Return object, if any */
109 union acpi_operand_object *return_desc; /* Return object, if any */ 107 union acpi_generic_state *scope_info; /* Stack of nested scopes */
110 union acpi_generic_state *scope_info; /* Stack of nested scopes */ 108
111 109 union acpi_parse_object *prev_op; /* Last op that was processed */
112 union acpi_parse_object *prev_op; /* Last op that was processed */ 110 union acpi_parse_object *next_op; /* next op to be processed */
113 union acpi_parse_object *next_op; /* next op to be processed */ 111 acpi_parse_downwards descending_callback;
114 acpi_parse_downwards descending_callback; 112 acpi_parse_upwards ascending_callback;
115 acpi_parse_upwards ascending_callback; 113 struct acpi_thread_state *thread;
116 struct acpi_thread_state *thread; 114 struct acpi_walk_state *next; /* Next walk_state in list */
117 struct acpi_walk_state *next; /* Next walk_state in list */
118}; 115};
119 116
120
121/* Info used by acpi_ps_init_objects */ 117/* Info used by acpi_ps_init_objects */
122 118
123struct acpi_init_walk_info 119struct acpi_init_walk_info {
124{ 120 u16 method_count;
125 u16 method_count; 121 u16 device_count;
126 u16 device_count; 122 u16 op_region_count;
127 u16 op_region_count; 123 u16 field_count;
128 u16 field_count; 124 u16 buffer_count;
129 u16 buffer_count; 125 u16 package_count;
130 u16 package_count; 126 u16 op_region_init;
131 u16 op_region_init; 127 u16 field_init;
132 u16 field_init; 128 u16 buffer_init;
133 u16 buffer_init; 129 u16 package_init;
134 u16 package_init; 130 u16 object_count;
135 u16 object_count; 131 struct acpi_table_desc *table_desc;
136 struct acpi_table_desc *table_desc;
137}; 132};
138 133
139
140/* Info used by acpi_ns_initialize_devices */ 134/* Info used by acpi_ns_initialize_devices */
141 135
142struct acpi_device_walk_info 136struct acpi_device_walk_info {
143{ 137 u16 device_count;
144 u16 device_count; 138 u16 num_STA;
145 u16 num_STA; 139 u16 num_INI;
146 u16 num_INI; 140 struct acpi_table_desc *table_desc;
147 struct acpi_table_desc *table_desc;
148}; 141};
149 142
150
151/* TBD: [Restructure] Merge with struct above */ 143/* TBD: [Restructure] Merge with struct above */
152 144
153struct acpi_walk_info 145struct acpi_walk_info {
154{ 146 u32 debug_level;
155 u32 debug_level; 147 u32 count;
156 u32 count; 148 acpi_owner_id owner_id;
157 acpi_owner_id owner_id; 149 u8 display_type;
158 u8 display_type;
159}; 150};
160 151
161/* Display Types */ 152/* Display Types */
@@ -166,56 +157,48 @@ struct acpi_walk_info
166 157
167#define ACPI_DISPLAY_SHORT (u8) 2 158#define ACPI_DISPLAY_SHORT (u8) 2
168 159
169struct acpi_get_devices_info 160struct acpi_get_devices_info {
170{ 161 acpi_walk_callback user_function;
171 acpi_walk_callback user_function; 162 void *context;
172 void *context; 163 char *hid;
173 char *hid;
174}; 164};
175 165
166union acpi_aml_operands {
167 union acpi_operand_object *operands[7];
176 168
177union acpi_aml_operands 169 struct {
178{ 170 struct acpi_object_integer *type;
179 union acpi_operand_object *operands[7]; 171 struct acpi_object_integer *code;
180 172 struct acpi_object_integer *argument;
181 struct
182 {
183 struct acpi_object_integer *type;
184 struct acpi_object_integer *code;
185 struct acpi_object_integer *argument;
186 173
187 } fatal; 174 } fatal;
188 175
189 struct 176 struct {
190 { 177 union acpi_operand_object *source;
191 union acpi_operand_object *source; 178 struct acpi_object_integer *index;
192 struct acpi_object_integer *index; 179 union acpi_operand_object *target;
193 union acpi_operand_object *target;
194 180
195 } index; 181 } index;
196 182
197 struct 183 struct {
198 { 184 union acpi_operand_object *source;
199 union acpi_operand_object *source; 185 struct acpi_object_integer *index;
200 struct acpi_object_integer *index; 186 struct acpi_object_integer *length;
201 struct acpi_object_integer *length; 187 union acpi_operand_object *target;
202 union acpi_operand_object *target;
203 188
204 } mid; 189 } mid;
205}; 190};
206 191
207
208/* Internal method parameter list */ 192/* Internal method parameter list */
209 193
210struct acpi_parameter_info 194struct acpi_parameter_info {
211{ 195 struct acpi_namespace_node *node;
212 struct acpi_namespace_node *node; 196 union acpi_operand_object *obj_desc;
213 union acpi_operand_object *obj_desc; 197 union acpi_operand_object **parameters;
214 union acpi_operand_object **parameters; 198 union acpi_operand_object *return_object;
215 union acpi_operand_object *return_object; 199 u8 pass_number;
216 u8 pass_number; 200 u8 parameter_type;
217 u8 parameter_type; 201 u8 return_object_type;
218 u8 return_object_type;
219}; 202};
220 203
221/* Types for parameter_type above */ 204/* Types for parameter_type above */
@@ -223,5 +206,4 @@ struct acpi_parameter_info
223#define ACPI_PARAM_ARGS 0 206#define ACPI_PARAM_ARGS 0
224#define ACPI_PARAM_GPE 1 207#define ACPI_PARAM_GPE 1
225 208
226
227#endif 209#endif