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