Merge trunk HEAD (46152)
[reactos.git] / drivers / bus / acpi / include / acstruct.h
1 /******************************************************************************
2 *
3 * Name: acstruct.h - Internal structs
4 * $Revision: 1.1 $
5 *
6 *****************************************************************************/
7
8 /*
9 * Copyright (C) 2000, 2001 R. Byron Moore
10 *
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.
15 *
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.
20 *
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
24 */
25
26 #ifndef __ACSTRUCT_H__
27 #define __ACSTRUCT_H__
28
29
30 /*****************************************************************************
31 *
32 * Tree walking typedefs and structs
33 *
34 ****************************************************************************/
35
36
37 /*
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.
40 */
41
42 #define NEXT_OP_DOWNWARD 1
43 #define NEXT_OP_UPWARD 2
44
45 #define WALK_NON_METHOD 0
46 #define WALK_METHOD 1
47 #define WALK_METHOD_RESTART 2
48
49 typedef struct acpi_walk_state
50 {
51 u8 data_type; /* To differentiate various internal objs */\
52 ACPI_OWNER_ID owner_id; /* Owner of objects created during the walk */
53 u8 last_predicate; /* Result of last predicate */
54 u8 next_op_info; /* Info about Next_op */
55 u8 num_operands; /* Stack pointer for Operands[] array */
56 u8 current_result; /* */
57
58 struct acpi_walk_state *next; /* Next Walk_state in list */
59 ACPI_PARSE_OBJECT *origin; /* Start of walk [Obsolete] */
60
61 /* TBD: Obsolete with removal of WALK procedure ? */
62 ACPI_PARSE_OBJECT *prev_op; /* Last op that was processed */
63 ACPI_PARSE_OBJECT *next_op; /* next op to be processed */
64
65
66 ACPI_GENERIC_STATE *results; /* Stack of accumulated results */
67 ACPI_GENERIC_STATE *control_state; /* List of control states (nested IFs) */
68 ACPI_GENERIC_STATE *scope_info; /* Stack of nested scopes */
69 ACPI_PARSE_STATE *parser_state; /* Current state of parser */
70 u8 *aml_last_while;
71 ACPI_OPCODE_INFO *op_info; /* Info on current opcode */
72 ACPI_PARSE_DOWNWARDS descending_callback;
73 ACPI_PARSE_UPWARDS ascending_callback;
74
75 union acpi_operand_obj *return_desc; /* Return object, if any */
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 *method_call_op; /* Method_call Op if running a method */
79 struct acpi_node *method_call_node; /* Called method Node*/
80 union acpi_operand_obj *operands[OBJ_NUM_OPERANDS]; /* Operands passed to the interpreter */
81 struct acpi_node arguments[MTH_NUM_ARGS]; /* Control method arguments */
82 struct acpi_node local_variables[MTH_NUM_LOCALS]; /* Control method locals */
83 struct acpi_walk_list *walk_list;
84 u32 parse_flags;
85 u8 walk_type;
86 u8 return_used;
87 u16 opcode; /* Current AML opcode */
88 u32 prev_arg_types;
89 u16 current_sync_level; /* Mutex Sync (nested acquire) level */
90
91 /* Debug support */
92
93 u32 method_breakpoint;
94
95
96 } ACPI_WALK_STATE;
97
98
99 /*
100 * Walk list - head of a tree of walk states. Multiple walk states are created when there
101 * are nested control methods executing.
102 */
103 typedef struct acpi_walk_list
104 {
105
106 ACPI_WALK_STATE *walk_state;
107 ACPI_OBJECT_MUTEX acquired_mutex_list; /* List of all currently acquired mutexes */
108
109 } ACPI_WALK_LIST;
110
111
112 /* Info used by Acpi_ps_init_objects */
113
114 typedef struct acpi_init_walk_info
115 {
116 u16 method_count;
117 u16 op_region_count;
118 u16 field_count;
119 u16 op_region_init;
120 u16 field_init;
121 u16 object_count;
122 ACPI_TABLE_DESC *table_desc;
123
124 } ACPI_INIT_WALK_INFO;
125
126
127 /* Info used by TBD */
128
129 typedef struct acpi_device_walk_info
130 {
131 u16 device_count;
132 u16 num_STA;
133 u16 num_INI;
134 ACPI_TABLE_DESC *table_desc;
135
136 } ACPI_DEVICE_WALK_INFO;
137
138
139 /* TBD: [Restructure] Merge with struct above */
140
141 typedef struct acpi_walk_info
142 {
143 u32 debug_level;
144 u32 owner_id;
145
146 } ACPI_WALK_INFO;
147
148 typedef struct acpi_get_devices_info
149 {
150 WALK_CALLBACK user_function;
151 void *context;
152 NATIVE_CHAR *hid;
153
154 } ACPI_GET_DEVICES_INFO;
155
156
157 #endif