ReactOS 0.4.15-dev-8058-ga7cbb60
dsargs.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "amlcode.h"
#include "acdispat.h"
#include "acnamesp.h"
Include dependency graph for dsargs.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_DISPATCHER
 

Functions

static ACPI_STATUS AcpiDsExecuteArguments (ACPI_NAMESPACE_NODE *Node, ACPI_NAMESPACE_NODE *ScopeNode, UINT32 AmlLength, UINT8 *AmlStart)
 
ACPI_STATUS AcpiDsGetBufferFieldArguments (ACPI_OPERAND_OBJECT *ObjDesc)
 
ACPI_STATUS AcpiDsGetBankFieldArguments (ACPI_OPERAND_OBJECT *ObjDesc)
 
ACPI_STATUS AcpiDsGetBufferArguments (ACPI_OPERAND_OBJECT *ObjDesc)
 
ACPI_STATUS AcpiDsGetPackageArguments (ACPI_OPERAND_OBJECT *ObjDesc)
 
ACPI_STATUS AcpiDsGetRegionArguments (ACPI_OPERAND_OBJECT *ObjDesc)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_DISPATCHER

Definition at line 52 of file dsargs.c.

Function Documentation

◆ AcpiDsExecuteArguments()

static ACPI_STATUS AcpiDsExecuteArguments ( ACPI_NAMESPACE_NODE Node,
ACPI_NAMESPACE_NODE ScopeNode,
UINT32  AmlLength,
UINT8 AmlStart 
)
static

Definition at line 81 of file dsargs.c.

86{
89 ACPI_WALK_STATE *WalkState;
90
91
92 ACPI_FUNCTION_TRACE_PTR (DsExecuteArguments, AmlStart);
93
94
95 /* Allocate a new parser op to be the root of the parsed tree */
96
98 if (!Op)
99 {
101 }
102
103 /* Save the Node for use in AcpiPsParseAml */
104
105 Op->Common.Node = ScopeNode;
106
107 /* Create and initialize a new parser state */
108
109 WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
110 if (!WalkState)
111 {
113 goto Cleanup;
114 }
115
116 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
117 AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
118 if (ACPI_FAILURE (Status))
119 {
120 AcpiDsDeleteWalkState (WalkState);
121 goto Cleanup;
122 }
123
124 /* Mark this parse as a deferred opcode */
125
127 WalkState->DeferredNode = Node;
128
129 /* Pass1: Parse the entire declaration */
130
131 Status = AcpiPsParseAml (WalkState);
132 if (ACPI_FAILURE (Status))
133 {
134 goto Cleanup;
135 }
136
137 /* Get and init the Op created above */
138
139 Op->Common.Node = Node;
141
142 /* Evaluate the deferred arguments */
143
144 Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP, AmlStart);
145 if (!Op)
146 {
148 }
149
150 Op->Common.Node = ScopeNode;
151
152 /* Create and initialize a new parser state */
153
154 WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
155 if (!WalkState)
156 {
158 goto Cleanup;
159 }
160
161 /* Execute the opcode and arguments */
162
163 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
164 AmlLength, NULL, ACPI_IMODE_EXECUTE);
165 if (ACPI_FAILURE (Status))
166 {
167 AcpiDsDeleteWalkState (WalkState);
168 goto Cleanup;
169 }
170
171 /* Mark this execution as a deferred opcode */
172
173 WalkState->DeferredNode = Node;
174 Status = AcpiPsParseAml (WalkState);
175
176Cleanup:
179}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_NO_MEMORY
Definition: acexcep.h:112
@ ACPI_IMODE_LOAD_PASS1
Definition: aclocal.h:167
@ ACPI_IMODE_EXECUTE
Definition: aclocal.h:169
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_PARSE_DEFERRED_OP
Definition: acparser.h:64
void AcpiPsDeleteParseTree(ACPI_PARSE_OBJECT *root)
Definition: pswalk.c:67
ACPI_STATUS AcpiPsParseAml(ACPI_WALK_STATE *WalkState)
Definition: psparse.c:453
ACPI_PARSE_OBJECT * AcpiPsAllocOp(UINT16 Opcode, UINT8 *Aml)
Definition: psutils.c:130
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AML_INT_EVAL_SUBTREE_OP
Definition: amlcode.h:212
#define NULL
Definition: types.h:112
union node Node
Definition: types.h:1255
static const WCHAR Cleanup[]
Definition: register.c:80
ACPI_WALK_STATE * AcpiDsCreateWalkState(ACPI_OWNER_ID OwnerId, ACPI_PARSE_OBJECT *Origin, ACPI_OPERAND_OBJECT *MethodDesc, ACPI_THREAD_STATE *Thread)
Definition: dswstate.c:600
ACPI_STATUS AcpiDsInitAmlWalk(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, ACPI_NAMESPACE_NODE *MethodNode, UINT8 *AmlStart, UINT32 AmlLength, ACPI_EVALUATE_INFO *Info, UINT8 PassNumber)
Definition: dswstate.c:662
void AcpiDsDeleteWalkState(ACPI_WALK_STATE *WalkState)
Definition: dswstate.c:780
Status
Definition: gdiplustypes.h:25
UINT32 ParseFlags
Definition: acstruct.h:95
struct acpi_namespace_node * DeferredNode
Definition: acstruct.h:111
ACPI_PARSE_OBJ_COMMON Common
Definition: aclocal.h:1078

Referenced by AcpiDsGetBankFieldArguments(), AcpiDsGetBufferArguments(), AcpiDsGetBufferFieldArguments(), AcpiDsGetPackageArguments(), and AcpiDsGetRegionArguments().

◆ AcpiDsGetBankFieldArguments()

ACPI_STATUS AcpiDsGetBankFieldArguments ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 245 of file dsargs.c.

247{
248 ACPI_OPERAND_OBJECT *ExtraDesc;
251
252
253 ACPI_FUNCTION_TRACE_PTR (DsGetBankFieldArguments, ObjDesc);
254
255
256 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
257 {
259 }
260
261 /* Get the AML pointer (method object) and BankField node */
262
263 ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
264 Node = ObjDesc->BankField.Node;
265
266 ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
268
269 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
271
272 /* Execute the AML code for the TermArg arguments */
273
275 ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
277}
#define AE_OK
Definition: acexcep.h:97
ACPI_OPERAND_OBJECT * AcpiNsGetSecondaryObject(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: nsobject.c:346
#define AOPOBJ_DATA_VALID
Definition: acobject.h:96
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_DEBUG_EXEC(a)
Definition: acoutput.h:477
#define ACPI_DB_EXEC
Definition: acoutput.h:165
#define ACPI_TYPE_LOCAL_BANK_FIELD
Definition: actypes.h:717
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:306
static ACPI_STATUS AcpiDsExecuteArguments(ACPI_NAMESPACE_NODE *Node, ACPI_NAMESPACE_NODE *ScopeNode, UINT32 AmlLength, UINT8 *AmlStart)
Definition: dsargs.c:81
UINT32 AmlLength
Definition: acobject.h:485
UINT8 * AmlStart
Definition: acobject.h:484
ACPI_OBJECT_BANK_FIELD BankField
Definition: acobject.h:536
ACPI_OBJECT_EXTRA Extra
Definition: acobject.h:541
ACPI_OBJECT_COMMON Common
Definition: acobject.h:519
Definition: dlist.c:348

Referenced by AcpiNsInitOneObject().

◆ AcpiDsGetBufferArguments()

ACPI_STATUS AcpiDsGetBufferArguments ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 294 of file dsargs.c.

296{
299
300
301 ACPI_FUNCTION_TRACE_PTR (DsGetBufferArguments, ObjDesc);
302
303
304 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
305 {
307 }
308
309 /* Get the Buffer node */
310
311 Node = ObjDesc->Buffer.Node;
312 if (!Node)
313 {
315 "No pointer back to namespace node in buffer object %p",
316 ObjDesc));
318 }
319
320 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n"));
321
322 /* Execute the AML code for the TermArg arguments */
323
325 ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
327}
#define AE_AML_INTERNAL
Definition: acexcep.h:194
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_INFO
Definition: acoutput.h:230
UINT8 * AmlStart
Definition: acobject.h:151
ACPI_OBJECT_COMMON_HEADER UINT32 AmlLength
Definition: acobject.h:150
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:152
ACPI_OBJECT_BUFFER Buffer
Definition: acobject.h:522

Referenced by AcpiExOpcode_1A_0T_1R(), AcpiExPrepFieldValue(), AcpiExResolveNodeToValue(), and AcpiExResolveObjectToValue().

◆ AcpiDsGetBufferFieldArguments()

ACPI_STATUS AcpiDsGetBufferFieldArguments ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 196 of file dsargs.c.

198{
199 ACPI_OPERAND_OBJECT *ExtraDesc;
202
203
204 ACPI_FUNCTION_TRACE_PTR (DsGetBufferFieldArguments, ObjDesc);
205
206
207 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
208 {
210 }
211
212 /* Get the AML pointer (method object) and BufferField node */
213
214 ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
215 Node = ObjDesc->BufferField.Node;
216
217 ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
219
220 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
222
223 /* Execute the AML code for the TermArg arguments */
224
226 ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
228}
#define ACPI_TYPE_BUFFER_FIELD
Definition: actypes.h:701
ACPI_OBJECT_BUFFER_FIELD BufferField
Definition: acobject.h:535

Referenced by AcpiExFieldDatumIo(), AcpiExReadDataFromField(), and AcpiExWriteDataToField().

◆ AcpiDsGetPackageArguments()

ACPI_STATUS AcpiDsGetPackageArguments ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 344 of file dsargs.c.

346{
349
350
351 ACPI_FUNCTION_TRACE_PTR (DsGetPackageArguments, ObjDesc);
352
353
354 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
355 {
357 }
358
359 /* Get the Package node */
360
361 Node = ObjDesc->Package.Node;
362 if (!Node)
363 {
365 "No pointer back to namespace node in package %p", ObjDesc));
367 }
368
369 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Argument Init, AML Ptr: %p\n",
370 ObjDesc->Package.AmlStart));
371
372 /* Execute the AML code for the TermArg arguments */
373
375 ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
376
378}
ACPI_OBJECT_COMMON_HEADER ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:160
ACPI_OBJECT_PACKAGE Package
Definition: acobject.h:523

Referenced by AcpiExOpcode_1A_0T_1R(), AcpiExResolveNodeToValue(), AcpiExResolveObjectToValue(), and AcpiNsInitOnePackage().

◆ AcpiDsGetRegionArguments()

ACPI_STATUS AcpiDsGetRegionArguments ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 395 of file dsargs.c.

397{
400 ACPI_OPERAND_OBJECT *ExtraDesc;
401
402
403 ACPI_FUNCTION_TRACE_PTR (DsGetRegionArguments, ObjDesc);
404
405
406 if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
407 {
409 }
410
411 ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
412 if (!ExtraDesc)
413 {
415 }
416
417 /* Get the Region node */
418
419 Node = ObjDesc->Region.Node;
420
421 ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
423
425 "[%4.4s] OpRegion Arg Init at AML %p\n",
426 AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
427
428 /* Execute the argument AML */
429
431 ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
432 if (ACPI_FAILURE (Status))
433 {
435 }
436
438 ObjDesc->Region.Address, ObjDesc->Region.Length, Node);
440}
#define AE_NOT_EXIST
Definition: acexcep.h:114
#define ACPI_TYPE_REGION
Definition: actypes.h:697
ACPI_STATUS AcpiUtAddAddressRange(ACPI_ADR_SPACE_TYPE SpaceId, ACPI_PHYSICAL_ADDRESS Address, UINT32 Length, ACPI_NAMESPACE_NODE *RegionNode)
Definition: utaddress.c:78
ACPI_NAMESPACE_NODE * ScopeNode
Definition: acobject.h:482
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
ACPI_PHYSICAL_ADDRESS Address
Definition: acobject.h:206
ACPI_OBJECT_REGION Region
Definition: acobject.h:527

Referenced by AcpiExLoadOp(), and AcpiExSetupRegion().