ReactOS 0.4.16-dev-125-g798ea90
psutils.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "amlcode.h"
#include "acconvert.h"
Include dependency graph for psutils.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_PARSER
 

Functions

ACPI_PARSE_OBJECTAcpiPsCreateScopeOp (UINT8 *Aml)
 
void AcpiPsInitOp (ACPI_PARSE_OBJECT *Op, UINT16 Opcode)
 
ACPI_PARSE_OBJECTAcpiPsAllocOp (UINT16 Opcode, UINT8 *Aml)
 
void AcpiPsFreeOp (ACPI_PARSE_OBJECT *Op)
 
BOOLEAN AcpiPsIsLeadingChar (UINT32 c)
 
UINT32 AcpiPsGetName (ACPI_PARSE_OBJECT *Op)
 
void AcpiPsSetName (ACPI_PARSE_OBJECT *Op, UINT32 name)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_PARSER

Definition at line 50 of file psutils.c.

Function Documentation

◆ AcpiPsAllocOp()

ACPI_PARSE_OBJECT * AcpiPsAllocOp ( UINT16  Opcode,
UINT8 Aml 
)

Definition at line 130 of file psutils.c.

133{
135 const ACPI_OPCODE_INFO *OpInfo;
137
138
140
141
142 OpInfo = AcpiPsGetOpcodeInfo (Opcode);
143
144 /* Determine type of ParseOp required */
145
146 if (OpInfo->Flags & AML_DEFER)
147 {
149 }
150 else if (OpInfo->Flags & AML_NAMED)
151 {
153 }
154 else if (Opcode == AML_INT_BYTELIST_OP)
155 {
157 }
158
159 /* Allocate the minimum required size object */
160
162 {
163 /* The generic op (default) is by far the most common (16 to 1) */
164
165 Op = AcpiOsAcquireObject (AcpiGbl_PsNodeCache);
166 }
167 else
168 {
169 /* Extended parseop */
170
171 Op = AcpiOsAcquireObject (AcpiGbl_PsNodeExtCache);
172 }
173
174 /* Initialize the Op */
175
176 if (Op)
177 {
178 AcpiPsInitOp (Op, Opcode);
179 Op->Common.Aml = Aml;
180 Op->Common.Flags = Flags;
182
183 if (Opcode == AML_SCOPE_OP)
184 {
185 AcpiGbl_CurrentScope = Op;
186 }
187
188 if (AcpiGbl_CaptureComments)
189 {
191 }
192 }
193
194 return (Op);
195}
unsigned char UINT8
#define ACPI_PARSEOP_NAMED_OBJECT
Definition: aclocal.h:1118
#define ACPI_PARSEOP_GENERIC
Definition: aclocal.h:1117
#define ACPI_PARSEOP_BYTELIST
Definition: aclocal.h:1120
#define ACPI_PARSEOP_DEFERRED
Definition: aclocal.h:1119
#define ASL_CV_TRANSFER_COMMENTS(a)
Definition: acmacros.h:527
#define ASL_CV_CLEAR_OP_COMMENTS(a)
Definition: acmacros.h:531
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
const ACPI_OPCODE_INFO * AcpiPsGetOpcodeInfo(UINT16 Opcode)
Definition: psopinfo.c:72
void * AcpiOsAcquireObject(ACPI_CACHE_T *Cache)
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1302
#define AML_INT_BYTELIST_OP
Definition: amlcode.h:209
#define AML_SCOPE_OP
Definition: amlcode.h:60
#define AML_DEFER
Definition: amlcode.h:322
#define AML_NAMED
Definition: amlcode.h:323
_In_ PVOID _In_ ULONG Opcode
Definition: hubbusif.h:331
void AcpiPsInitOp(ACPI_PARSE_OBJECT *Op, UINT16 Opcode)
Definition: psutils.c:98
UINT16 Flags
Definition: aclocal.h:873
ACPI_PARSE_OBJ_COMMON Common
Definition: aclocal.h:1078
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by AcpiDsAutoSerializeMethod(), AcpiDsExecuteArguments(), AcpiDsLoad1BeginOp(), AcpiDsLoad2BeginOp(), AcpiPsCompleteThisOp(), AcpiPsCreateOp(), AcpiPsCreateScopeOp(), AcpiPsGetNextArg(), AcpiPsGetNextField(), and AcpiPsGetNextNamepath().

◆ AcpiPsCreateScopeOp()

ACPI_PARSE_OBJECT * AcpiPsCreateScopeOp ( UINT8 Aml)

Definition at line 67 of file psutils.c.

69{
70 ACPI_PARSE_OBJECT *ScopeOp;
71
72
73 ScopeOp = AcpiPsAllocOp (AML_SCOPE_OP, Aml);
74 if (!ScopeOp)
75 {
76 return (NULL);
77 }
78
79 ScopeOp->Named.Name = ACPI_ROOT_NAME;
80 return (ScopeOp);
81}
#define ACPI_ROOT_NAME
Definition: acnames.h:92
#define NULL
Definition: types.h:112
ACPI_PARSE_OBJECT * AcpiPsAllocOp(UINT16 Opcode, UINT8 *Aml)
Definition: psutils.c:130
ACPI_PARSE_OBJ_NAMED Named
Definition: aclocal.h:1079

Referenced by AcpiNsOneCompleteParse(), AcpiPsExecuteMethod(), and AcpiPsExecuteTable().

◆ AcpiPsFreeOp()

void AcpiPsFreeOp ( ACPI_PARSE_OBJECT Op)

Definition at line 212 of file psutils.c.

214{
215 ACPI_FUNCTION_NAME (PsFreeOp);
216
217
219 if (Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
220 {
222 "Free retval op: %p\n", Op));
223 }
224
225 if (Op->Common.Flags & ACPI_PARSEOP_GENERIC)
226 {
227 (void) AcpiOsReleaseObject (AcpiGbl_PsNodeCache, Op);
228 }
229 else
230 {
231 (void) AcpiOsReleaseObject (AcpiGbl_PsNodeExtCache, Op);
232 }
233}
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_DB_ALLOCATIONS
Definition: acoutput.h:175
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
ACPI_STATUS AcpiOsReleaseObject(ACPI_CACHE_T *Cache, void *Object)
#define AML_INT_RETURN_VALUE_OP
Definition: amlcode.h:211

Referenced by AcpiDsAutoSerializeMethod(), AcpiNsOneCompleteParse(), AcpiPsCreateOp(), AcpiPsDeleteParseTree(), AcpiPsGetNextArg(), and AcpiPsGetNextField().

◆ AcpiPsGetName()

UINT32 AcpiPsGetName ( ACPI_PARSE_OBJECT Op)

Definition at line 260 of file psutils.c.

262{
263
264 /* The "generic" object has no name associated with it */
265
266 if (Op->Common.Flags & ACPI_PARSEOP_GENERIC)
267 {
268 return (0);
269 }
270
271 /* Only the "Extended" parse objects have a name */
272
273 return (Op->Named.Name);
274}

◆ AcpiPsInitOp()

void AcpiPsInitOp ( ACPI_PARSE_OBJECT Op,
UINT16  Opcode 
)

Definition at line 98 of file psutils.c.

101{
103
104
105 Op->Common.DescriptorType = ACPI_DESC_TYPE_PARSER;
106 Op->Common.AmlOpcode = Opcode;
107
108 ACPI_DISASM_ONLY_MEMBERS (AcpiUtSafeStrncpy (Op->Common.AmlOpName,
110 sizeof (Op->Common.AmlOpName)));
111}
#define ACPI_DISASM_ONLY_MEMBERS(a)
Definition: aclocal.h:907
#define ACPI_DESC_TYPE_PARSER
Definition: acobject.h:575

Referenced by AcpiPsAllocOp(), AcpiPsGetNextNamepath(), and AcpiPsGetNextSimpleArg().

◆ AcpiPsIsLeadingChar()

BOOLEAN AcpiPsIsLeadingChar ( UINT32  c)

Definition at line 249 of file psutils.c.

251{
252 return ((BOOLEAN) (c == '_' || (c >= 'A' && c <= 'Z')));
253}
unsigned char BOOLEAN
const GLubyte * c
Definition: glext.h:8905

Referenced by AcpiPsGetNextArg().

◆ AcpiPsSetName()

void AcpiPsSetName ( ACPI_PARSE_OBJECT Op,
UINT32  name 
)

Definition at line 281 of file psutils.c.

284{
285
286 /* The "generic" object has no name associated with it */
287
288 if (Op->Common.Flags & ACPI_PARSEOP_GENERIC)
289 {
290 return;
291 }
292
293 Op->Named.Name = name;
294}
Definition: name.c:39

Referenced by AcpiDsAutoSerializeMethod(), and AcpiPsGetNextField().