ReactOS  0.4.14-dev-342-gdc047f9
acstruct.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Name: acstruct.h - Internal structs
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2019, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  * notice, this list of conditions, and the following disclaimer,
16  * without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  * substantially similar to the "NO WARRANTY" disclaimer below
19  * ("Disclaimer") and any redistribution must be conditioned upon
20  * including a substantially similar Disclaimer requirement for further
21  * binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  * of any contributors may be used to endorse or promote products derived
24  * from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43 
44 #ifndef __ACSTRUCT_H__
45 #define __ACSTRUCT_H__
46 
47 /* acpisrc:StructDefs -- for acpisrc conversion */
48 
49 /*****************************************************************************
50  *
51  * Tree walking typedefs and structs
52  *
53  ****************************************************************************/
54 
55 
56 /*
57  * Walk state - current state of a parse tree walk. Used for both a leisurely
58  * stroll through the tree (for whatever reason), and for control method
59  * execution.
60  */
61 #define ACPI_NEXT_OP_DOWNWARD 1
62 #define ACPI_NEXT_OP_UPWARD 2
63 
64 /*
65  * Groups of definitions for WalkType used for different implementations of
66  * walkers (never simultaneously) - flags for interpreter:
67  */
68 #define ACPI_WALK_NON_METHOD 0
69 #define ACPI_WALK_METHOD 0x01
70 #define ACPI_WALK_METHOD_RESTART 0x02
71 
72 
73 typedef struct acpi_walk_state
74 {
75  struct acpi_walk_state *Next; /* Next WalkState in list */
76  UINT8 DescriptorType; /* To differentiate various internal objs */
78  UINT16 Opcode; /* Current AML opcode */
79  UINT8 NextOpInfo; /* Info about NextOp */
80  UINT8 NumOperands; /* Stack pointer for Operands[] array */
81  UINT8 OperandIndex; /* Index into operand stack, to be used by AcpiDsObjStackPush */
82  ACPI_OWNER_ID OwnerId; /* Owner of objects created during the walk */
83  BOOLEAN LastPredicate; /* Result of last predicate */
87  UINT8 PassNumber; /* Parse pass during table load */
88  BOOLEAN NamespaceOverride; /* Override existing objects */
89  UINT8 ResultSize; /* Total elements for the result stack */
90  UINT8 ResultCount; /* Current number of occupied elements of result stack */
93  UINT32 MethodBreakpoint; /* For single stepping */
94  UINT32 UserBreakpoint; /* User AML breakpoint */
96 
97  ACPI_PARSE_STATE ParserState; /* Current state of parser */
99  UINT32 ArgCount; /* push for fixed or var args */
102 
103  struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
104  struct acpi_namespace_node LocalVariables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
105  union acpi_operand_object *Operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
107 
110  ACPI_GENERIC_STATE *ControlState; /* List of control states (nested IFs) */
111  struct acpi_namespace_node *DeferredNode; /* Used when executing deferred opcodes */
113  struct acpi_namespace_node *MethodCallNode; /* Called method Node*/
114  ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */
115  union acpi_operand_object *MethodDesc; /* Method descriptor if running a method */
116  struct acpi_namespace_node *MethodNode; /* Method node if running a method */
117  char *MethodPathname; /* Full pathname of running method */
118  ACPI_PARSE_OBJECT *Op; /* Current parser op */
119  const ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */
120  ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */
122  ACPI_GENERIC_STATE *Results; /* Stack of accumulated results */
123  union acpi_operand_object *ReturnDesc; /* Return object, if any */
124  ACPI_GENERIC_STATE *ScopeInfo; /* Stack of nested scopes */
125  ACPI_PARSE_OBJECT *PrevOp; /* Last op that was processed */
126  ACPI_PARSE_OBJECT *NextOp; /* next op to be processed */
130 
132 
133 
134 /* Info used by AcpiNsInitializeObjects and AcpiDsInitializeObjects */
135 
136 typedef struct acpi_init_walk_info
137 {
154 
156 
157 
158 typedef struct acpi_get_devices_info
159 {
161  void *Context;
162  char *Hid;
163 
165 
166 
167 typedef union acpi_aml_operands
168 {
170 
171  struct
172  {
176 
177  } Fatal;
178 
179  struct
180  {
184 
185  } Index;
186 
187  struct
188  {
193 
194  } Mid;
195 
197 
198 
199 /*
200  * Structure used to pass object evaluation information and parameters.
201  * Purpose is to reduce CPU stack use.
202  */
203 typedef struct acpi_evaluate_info
204 {
205  /* The first 3 elements are passed by the caller to AcpiNsEvaluate */
206 
207  ACPI_NAMESPACE_NODE *PrefixNode; /* Input: starting node */
208  const char *RelativePathname; /* Input: path relative to PrefixNode */
209  ACPI_OPERAND_OBJECT **Parameters; /* Input: argument list */
210 
211  ACPI_NAMESPACE_NODE *Node; /* Resolved node (PrefixNode:RelativePathname) */
212  ACPI_OPERAND_OBJECT *ObjDesc; /* Object attached to the resolved node */
213  char *FullPathname; /* Full pathname of the resolved node */
214 
215  const ACPI_PREDEFINED_INFO *Predefined; /* Used if Node is a predefined name */
216  ACPI_OPERAND_OBJECT *ReturnObject; /* Object returned from the evaluation */
217  union acpi_operand_object *ParentPackage; /* Used if return object is a Package */
218 
219  UINT32 ReturnFlags; /* Used for return value analysis */
220  UINT32 ReturnBtype; /* Bitmapped type of the returned object */
221  UINT16 ParamCount; /* Count of the input argument list */
222  UINT16 NodeFlags; /* Same as Node->Flags */
223  UINT8 PassNumber; /* Parser pass number */
224  UINT8 ReturnObjectType; /* Object type of the returned object */
225  UINT8 Flags; /* General flags */
226 
228 
229 /* Values for Flags above */
230 
231 #define ACPI_IGNORE_RETURN_VALUE 1
232 
233 /* Defines for ReturnFlags field above */
234 
235 #define ACPI_OBJECT_REPAIRED 1
236 #define ACPI_OBJECT_WRAPPED 2
237 
238 
239 /* Info used by AcpiNsInitializeDevices */
240 
241 typedef struct acpi_device_walk_info
242 {
248 
250 
251 
252 /* Info used by Acpi AcpiDbDisplayFields */
253 
254 typedef struct acpi_region_walk_info
255 {
261 
263 
264 
265 /* TBD: [Restructure] Merge with struct above */
266 
267 typedef struct acpi_walk_info
268 {
273 
275 
276 /* Display Types */
277 
278 #define ACPI_DISPLAY_SUMMARY (UINT8) 0
279 #define ACPI_DISPLAY_OBJECTS (UINT8) 1
280 #define ACPI_DISPLAY_MASK (UINT8) 1
281 
282 #define ACPI_DISPLAY_SHORT (UINT8) 2
283 
284 
285 #endif
UINT32 MethodBreakpoint
Definition: acstruct.h:93
ACPI_THREAD_STATE * Thread
Definition: acstruct.h:127
struct acpi_walk_info ACPI_WALK_INFO
ACPI_OBJECT_INTEGER * Type
Definition: acstruct.h:173
char * MethodPathname
Definition: acstruct.h:117
ACPI_OPERAND_OBJECT * ObjDesc
Definition: acstruct.h:212
union acpi_operand_object * ImplicitReturnObj
Definition: acstruct.h:112
ACPI_GENERIC_STATE * Results
Definition: acstruct.h:122
ACPI_PARSE_OBJECT * PrevOp
Definition: acstruct.h:125
UINT8 OperandIndex
Definition: acstruct.h:81
const ACPI_PREDEFINED_INFO * Predefined
Definition: acstruct.h:215
struct acpi_region_walk_info ACPI_REGION_WALK_INFO
UINT8 NumOperands
Definition: acstruct.h:80
ACPI_OPERAND_OBJECT ** Parameters
Definition: acstruct.h:209
struct acpi_walk_state ACPI_WALK_STATE
UINT8 ReturnObjectType
Definition: acstruct.h:224
struct acpi_get_devices_info ACPI_GET_DEVICES_INFO
union acpi_operand_object ** Params
Definition: acstruct.h:106
struct acpi_namespace_node * DeferredNode
Definition: acstruct.h:111
UINT32 ArgTypes
Definition: acstruct.h:92
struct acpi_aml_operands::@597 Mid
union acpi_operand_object * ReturnDesc
Definition: acstruct.h:123
struct acpi_init_walk_info ACPI_INIT_WALK_INFO
ACPI_OWNER_ID OwnerId
Definition: acstruct.h:82
const char * RelativePathname
Definition: acstruct.h:208
ACPI_OPERAND_OBJECT * Source
Definition: acstruct.h:181
UINT32 DebugLevel
Definition: acstruct.h:269
UINT32 ParseFlags
Definition: acstruct.h:95
ACPI_EVALUATE_INFO * EvaluateInfo
Definition: acstruct.h:244
ACPI_OBJECT_INTEGER * Index
Definition: acstruct.h:182
ACPI_STATUS(* ACPI_WALK_CALLBACK)(ACPI_HANDLE Object, UINT32 NestingLevel, void *Context, void **ReturnValue)
Definition: actypes.h:1224
struct acpi_aml_operands::@595 Fatal
UINT32 UserBreakpoint
Definition: acstruct.h:94
ACPI_GENERIC_STATE * ControlState
Definition: acstruct.h:110
UINT8 ResultSize
Definition: acstruct.h:89
UINT32 OpRegionCount
Definition: acstruct.h:145
ACPI_PARSE_UPWARDS AscendingCallback
Definition: acstruct.h:129
#define ACPI_METHOD_NUM_LOCALS
Definition: acconfig.h:163
#define ACPI_OBJ_NUM_OPERANDS
Definition: acconfig.h:172
unsigned int UINT32
UINT32 NonSerialMethodCount
Definition: acstruct.h:142
UINT8 ResultCount
Definition: acstruct.h:90
ACPI_OWNER_ID OwnerId
Definition: acstruct.h:271
UINT8 DescriptorType
Definition: acstruct.h:76
struct acpi_device_walk_info ACPI_DEVICE_WALK_INFO
unsigned char BOOLEAN
ACPI_WALK_CALLBACK UserFunction
Definition: acstruct.h:160
struct acpi_namespace_node * MethodCallNode
Definition: acstruct.h:113
BOOLEAN LastPredicate
Definition: acstruct.h:83
UINT8 WalkType
Definition: acstruct.h:77
ACPI_OBJECT_INTEGER * Code
Definition: acstruct.h:174
struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]
Definition: acstruct.h:103
ACPI_OWNER_ID OwnerId
Definition: acstruct.h:153
UINT8 DisplayType
Definition: acstruct.h:272
union acpi_operand_object * ResultObj
Definition: acstruct.h:121
UINT16 MethodNestingDepth
Definition: acstruct.h:100
ACPI_PARSE_OBJECT * Op
Definition: acstruct.h:118
ACPI_OBJECT_INTEGER * Length
Definition: acstruct.h:191
UINT32 ReturnFlags
Definition: acstruct.h:219
union acpi_operand_object * MethodDesc
Definition: acstruct.h:115
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
ACPI_NAMESPACE_NODE * Node
Definition: acstruct.h:211
ACPI_PARSE_OBJECT * MethodCallOp
Definition: acstruct.h:114
ACPI_NAMESPACE_NODE * PrefixNode
Definition: acstruct.h:207
const ACPI_OPCODE_INFO * OpInfo
Definition: acstruct.h:119
ACPI_GENERIC_STATE * ScopeInfo
Definition: acstruct.h:124
ACPI_PARSE_STATE ParserState
Definition: acstruct.h:97
ACPI_PARSE_OBJECT * NextOp
Definition: acstruct.h:126
struct acpi_namespace_node * MethodNode
Definition: acstruct.h:116
UINT32 SerialMethodCount
Definition: acstruct.h:141
BOOLEAN NamespaceOverride
Definition: acstruct.h:88
UINT8 ReturnUsed
Definition: acstruct.h:85
ACPI_PARSE_OBJECT * Origin
Definition: acstruct.h:120
union acpi_operand_object * Operands[ACPI_OBJ_NUM_OPERANDS+1]
Definition: acstruct.h:105
ACPI_STATUS(* ACPI_PARSE_DOWNWARDS)(struct acpi_walk_state *WalkState, union acpi_parse_object **OutOp)
Definition: aclocal.h:785
ACPI_OPERAND_OBJECT * Target
Definition: acstruct.h:183
ACPI_PARSE_DOWNWARDS DescendingCallback
Definition: acstruct.h:128
ACPI_OPERAND_OBJECT * ReturnObject
Definition: acstruct.h:216
UINT32 ArgCount
Definition: acstruct.h:99
UINT32 ReturnBtype
Definition: acstruct.h:220
ACPI_TABLE_DESC * TableDesc
Definition: acstruct.h:243
char * FullPathname
Definition: acstruct.h:213
ACPI_OPERAND_OBJECT * Operands[7]
Definition: acstruct.h:169
unsigned short UINT16
union acpi_operand_object ** CallerReturnDesc
Definition: acstruct.h:109
UINT32 Count
Definition: acstruct.h:270
union acpi_aml_operands ACPI_AML_OPERANDS
struct acpi_namespace_node LocalVariables[ACPI_METHOD_NUM_LOCALS]
Definition: acstruct.h:104
UINT8 CurrentResult
Definition: acstruct.h:84
UINT8 PassNumber
Definition: acstruct.h:87
ACPI_OBJECT_INTEGER * Argument
Definition: acstruct.h:175
UINT16 Opcode
Definition: acstruct.h:78
union acpi_operand_object * ParentPackage
Definition: acstruct.h:217
UINT8 ScopeDepth
Definition: acstruct.h:86
#define ACPI_METHOD_NUM_ARGS
Definition: acconfig.h:166
struct acpi_walk_state * Next
Definition: acstruct.h:75
UINT32 PrevArgTypes
Definition: acstruct.h:98
UINT8 NextOpInfo
Definition: acstruct.h:79
UINT32 SerializedMethodCount
Definition: acstruct.h:143
UINT8 MethodIsNested
Definition: acstruct.h:101
ACPI_OWNER_ID OwnerId
Definition: acstruct.h:258
unsigned char UINT8
struct acpi_evaluate_info ACPI_EVALUATE_INFO
UINT8 * AmlLastWhile
Definition: acstruct.h:108
ACPI_STATUS(* ACPI_PARSE_UPWARDS)(struct acpi_walk_state *WalkState)
Definition: aclocal.h:790
UINT8 * Aml
Definition: acstruct.h:91