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.h121
1 files changed, 71 insertions, 50 deletions
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index d8c1c2cdac0c..5e8095f0f78f 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -44,6 +44,8 @@
44#ifndef __ACSTRUCT_H__ 44#ifndef __ACSTRUCT_H__
45#define __ACSTRUCT_H__ 45#define __ACSTRUCT_H__
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */
48
47/***************************************************************************** 49/*****************************************************************************
48 * 50 *
49 * Tree walking typedefs and structs 51 * Tree walking typedefs and structs
@@ -51,67 +53,76 @@
51 ****************************************************************************/ 53 ****************************************************************************/
52 54
53/* 55/*
54 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 56 * Walk state - current state of a parse tree walk. Used for both a leisurely
55 * the tree (for whatever reason), and for control method execution. 57 * stroll through the tree (for whatever reason), and for control method
58 * execution.
56 */ 59 */
57#define ACPI_NEXT_OP_DOWNWARD 1 60#define ACPI_NEXT_OP_DOWNWARD 1
58#define ACPI_NEXT_OP_UPWARD 2 61#define ACPI_NEXT_OP_UPWARD 2
59 62
63/*
64 * Groups of definitions for walk_type used for different implementations of
65 * walkers (never simultaneously) - flags for interpreter:
66 */
60#define ACPI_WALK_NON_METHOD 0 67#define ACPI_WALK_NON_METHOD 0
61#define ACPI_WALK_METHOD 1 68#define ACPI_WALK_METHOD 0x01
62#define ACPI_WALK_METHOD_RESTART 2 69#define ACPI_WALK_METHOD_RESTART 0x02
63#define ACPI_WALK_CONST_REQUIRED 3 70
64#define ACPI_WALK_CONST_OPTIONAL 4 71/* Flags for i_aSL compiler only */
72
73#define ACPI_WALK_CONST_REQUIRED 0x10
74#define ACPI_WALK_CONST_OPTIONAL 0x20
65 75
66struct acpi_walk_state { 76struct acpi_walk_state {
67 u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ 77 struct acpi_walk_state *next; /* Next walk_state in list */
78 u8 descriptor_type; /* To differentiate various internal objs */
68 u8 walk_type; 79 u8 walk_type;
69 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 80 u16 opcode; /* Current AML opcode */
70 u8 last_predicate; /* Result of last predicate */
71 u8 current_result; /* */
72 u8 next_op_info; /* Info about next_op */ 81 u8 next_op_info; /* Info about next_op */
73 u8 num_operands; /* Stack pointer for Operands[] array */ 82 u8 num_operands; /* Stack pointer for Operands[] array */
83 acpi_owner_id owner_id; /* Owner of objects created during the walk */
84 u8 last_predicate; /* Result of last predicate */
85 u8 current_result;
74 u8 return_used; 86 u8 return_used;
75 u16 opcode; /* Current AML opcode */
76 u8 scope_depth; 87 u8 scope_depth;
77 u8 pass_number; /* Parse pass during table load */ 88 u8 pass_number; /* Parse pass during table load */
78 u32 arg_count; /* push for fixed or var args */
79 u32 aml_offset; 89 u32 aml_offset;
80 u32 arg_types; 90 u32 arg_types;
81 u32 method_breakpoint; /* For single stepping */ 91 u32 method_breakpoint; /* For single stepping */
82 u32 user_breakpoint; /* User AML breakpoint */ 92 u32 user_breakpoint; /* User AML breakpoint */
83 u32 parse_flags; 93 u32 parse_flags;
94
95 struct acpi_parse_state parser_state; /* Current state of parser */
84 u32 prev_arg_types; 96 u32 prev_arg_types;
97 u32 arg_count; /* push for fixed or var args */
85 98
86 u8 *aml_last_while;
87 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ 99 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
100 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
101 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
102 union acpi_operand_object **params;
103
104 u8 *aml_last_while;
88 union acpi_operand_object **caller_return_desc; 105 union acpi_operand_object **caller_return_desc;
89 union acpi_generic_state *control_state; /* List of control states (nested IFs) */ 106 union acpi_generic_state *control_state; /* List of control states (nested IFs) */
90 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ 107 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 */ 108 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
92 union acpi_operand_object *implicit_return_obj; 109 union acpi_operand_object *implicit_return_obj;
93 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
94 struct acpi_namespace_node *method_call_node; /* Called method Node */ 110 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 */ 111 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 */ 112 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. */ 113 struct acpi_namespace_node *method_node; /* Method node if running a method. */
98 union acpi_parse_object *op; /* Current parser op */ 114 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) */
100 const struct acpi_opcode_info *op_info; /* Info on current opcode */ 115 const struct acpi_opcode_info *op_info; /* Info on current opcode */
101 union acpi_parse_object *origin; /* Start of walk [Obsolete] */ 116 union acpi_parse_object *origin; /* Start of walk [Obsolete] */
102 union acpi_operand_object **params;
103 struct acpi_parse_state parser_state; /* Current state of parser */
104 union acpi_operand_object *result_obj; 117 union acpi_operand_object *result_obj;
105 union acpi_generic_state *results; /* Stack of accumulated results */ 118 union acpi_generic_state *results; /* Stack of accumulated results */
106 union acpi_operand_object *return_desc; /* Return object, if any */ 119 union acpi_operand_object *return_desc; /* Return object, if any */
107 union acpi_generic_state *scope_info; /* Stack of nested scopes */ 120 union acpi_generic_state *scope_info; /* Stack of nested scopes */
108
109 union acpi_parse_object *prev_op; /* Last op that was processed */ 121 union acpi_parse_object *prev_op; /* Last op that was processed */
110 union acpi_parse_object *next_op; /* next op to be processed */ 122 union acpi_parse_object *next_op; /* next op to be processed */
123 struct acpi_thread_state *thread;
111 acpi_parse_downwards descending_callback; 124 acpi_parse_downwards descending_callback;
112 acpi_parse_upwards ascending_callback; 125 acpi_parse_upwards ascending_callback;
113 struct acpi_thread_state *thread;
114 struct acpi_walk_state *next; /* Next walk_state in list */
115}; 126};
116 127
117/* Info used by acpi_ps_init_objects */ 128/* Info used by acpi_ps_init_objects */
@@ -131,32 +142,6 @@ struct acpi_init_walk_info {
131 struct acpi_table_desc *table_desc; 142 struct acpi_table_desc *table_desc;
132}; 143};
133 144
134/* Info used by acpi_ns_initialize_devices */
135
136struct acpi_device_walk_info {
137 u16 device_count;
138 u16 num_STA;
139 u16 num_INI;
140 struct acpi_table_desc *table_desc;
141};
142
143/* TBD: [Restructure] Merge with struct above */
144
145struct acpi_walk_info {
146 u32 debug_level;
147 u32 count;
148 acpi_owner_id owner_id;
149 u8 display_type;
150};
151
152/* Display Types */
153
154#define ACPI_DISPLAY_SUMMARY (u8) 0
155#define ACPI_DISPLAY_OBJECTS (u8) 1
156#define ACPI_DISPLAY_MASK (u8) 1
157
158#define ACPI_DISPLAY_SHORT (u8) 2
159
160struct acpi_get_devices_info { 145struct acpi_get_devices_info {
161 acpi_walk_callback user_function; 146 acpi_walk_callback user_function;
162 void *context; 147 void *context;
@@ -189,16 +174,21 @@ union acpi_aml_operands {
189 } mid; 174 } mid;
190}; 175};
191 176
192/* Internal method parameter list */ 177/*
193 178 * Structure used to pass object evaluation parameters.
194struct acpi_parameter_info { 179 * Purpose is to reduce CPU stack use.
195 struct acpi_namespace_node *node; 180 */
181struct acpi_evaluate_info {
182 struct acpi_namespace_node *prefix_node;
183 char *pathname;
196 union acpi_operand_object *obj_desc; 184 union acpi_operand_object *obj_desc;
197 union acpi_operand_object **parameters; 185 union acpi_operand_object **parameters;
186 struct acpi_namespace_node *resolved_node;
198 union acpi_operand_object *return_object; 187 union acpi_operand_object *return_object;
199 u8 pass_number; 188 u8 pass_number;
200 u8 parameter_type; 189 u8 parameter_type;
201 u8 return_object_type; 190 u8 return_object_type;
191 u8 flags;
202}; 192};
203 193
204/* Types for parameter_type above */ 194/* Types for parameter_type above */
@@ -206,4 +196,35 @@ struct acpi_parameter_info {
206#define ACPI_PARAM_ARGS 0 196#define ACPI_PARAM_ARGS 0
207#define ACPI_PARAM_GPE 1 197#define ACPI_PARAM_GPE 1
208 198
199/* Values for Flags above */
200
201#define ACPI_IGNORE_RETURN_VALUE 1
202
203/* Info used by acpi_ns_initialize_devices */
204
205struct acpi_device_walk_info {
206 u16 device_count;
207 u16 num_STA;
208 u16 num_INI;
209 struct acpi_table_desc *table_desc;
210 struct acpi_evaluate_info *evaluate_info;
211};
212
213/* TBD: [Restructure] Merge with struct above */
214
215struct acpi_walk_info {
216 u32 debug_level;
217 u32 count;
218 acpi_owner_id owner_id;
219 u8 display_type;
220};
221
222/* Display Types */
223
224#define ACPI_DISPLAY_SUMMARY (u8) 0
225#define ACPI_DISPLAY_OBJECTS (u8) 1
226#define ACPI_DISPLAY_MASK (u8) 1
227
228#define ACPI_DISPLAY_SHORT (u8) 2
229
209#endif 230#endif