ReactOS 0.4.15-dev-7842-g558ab78
dsinit.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
#include "acnamesp.h"
#include "actables.h"
#include "acinterp.h"
Include dependency graph for dsinit.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_DISPATCHER
 

Functions

static ACPI_STATUS AcpiDsInitOneObject (ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue)
 
ACPI_STATUS AcpiDsInitializeObjects (UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_DISPATCHER

Definition at line 51 of file dsinit.c.

Function Documentation

◆ AcpiDsInitializeObjects()

ACPI_STATUS AcpiDsInitializeObjects ( UINT32  TableIndex,
ACPI_NAMESPACE_NODE StartNode 
)

Definition at line 204 of file dsinit.c.

207{
212
213
214 ACPI_FUNCTION_TRACE (DsInitializeObjects);
215
216
217 Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
218 if (ACPI_FAILURE (Status))
219 {
221 }
222
224 "**** Starting initialization of namespace objects ****\n"));
225
226 /* Set all init info to zero */
227
228 memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
229
230 Info.OwnerId = OwnerId;
231 Info.TableIndex = TableIndex;
232
233 /* Walk entire namespace from the supplied root */
234
235 /*
236 * We don't use AcpiWalkNamespace since we do not want to acquire
237 * the namespace reader lock.
238 */
241 if (ACPI_FAILURE (Status))
242 {
243 ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
244 }
245
246 Status = AcpiGetTableByIndex (TableIndex, &Table);
247 if (ACPI_FAILURE (Status))
248 {
250 }
251
252 /* DSDT is always the first AML table */
253
254 if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT))
255 {
257 "\nACPI table initialization:\n"));
258 }
259
260 /* Summary of objects initialized */
261
263 "Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
264 "%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
265 Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount,
266 Info.DeviceCount,Info.OpRegionCount, Info.MethodCount,
267 Info.SerialMethodCount, Info.NonSerialMethodCount,
268 Info.SerializedMethodCount));
269
270 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
271 Info.MethodCount, Info.OpRegionCount));
272
274}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_OK
Definition: acexcep.h:97
#define ACPI_NS_WALK_NO_UNLOCK
Definition: acnamesp.h:76
ACPI_STATUS AcpiNsWalkNamespace(ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, ACPI_WALK_CALLBACK DescendingCallback, ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue)
Definition: nswalk.c:190
#define ACPI_DB_DISPATCH
Definition: acoutput.h:163
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
#define ACPI_DB_INIT
Definition: acoutput.h:151
ACPI_STATUS AcpiTbGetOwnerId(UINT32 TableIndex, ACPI_OWNER_ID *OwnerId)
Definition: tbdata.c:993
#define ACPI_SIG_DSDT
Definition: actbl.h:67
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:564
#define ACPI_TYPE_ANY
Definition: actypes.h:687
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_UINT32_MAX
Definition: actypes.h:66
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
#define NULL
Definition: types.h:112
static ACPI_STATUS AcpiDsInitOneObject(ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue)
Definition: dsinit.c:86
_Must_inspect_result_ _In_opt_ PVOID OwnerId
Definition: fsrtlfuncs.h:907
Status
Definition: gdiplustypes.h:25
ASMGENDATA Table[]
Definition: genincdata.c:61
#define memset(x, y, z)
Definition: compat.h:39
ACPI_STATUS AcpiGetTableByIndex(UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable)
Definition: tbxface.c:491
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by AcpiNsLoadTable().

◆ AcpiDsInitOneObject()

static ACPI_STATUS AcpiDsInitOneObject ( ACPI_HANDLE  ObjHandle,
UINT32  Level,
void Context,
void **  ReturnValue 
)
static

Definition at line 86 of file dsinit.c.

91{
95 ACPI_OPERAND_OBJECT *ObjDesc;
96
97
99
100
101 /*
102 * We are only interested in NS nodes owned by the table that
103 * was just loaded
104 */
105 if (Node->OwnerId != Info->OwnerId)
106 {
107 return (AE_OK);
108 }
109
110 Info->ObjectCount++;
111
112 /* And even then, we are only interested in a few object types */
113
114 switch (AcpiNsGetType (ObjHandle))
115 {
116 case ACPI_TYPE_REGION:
117
118 Status = AcpiDsInitializeRegion (ObjHandle);
119 if (ACPI_FAILURE (Status))
120 {
122 "During Region initialization %p [%4.4s]",
123 ObjHandle, AcpiUtGetNodeName (ObjHandle)));
124 }
125
126 Info->OpRegionCount++;
127 break;
128
129 case ACPI_TYPE_METHOD:
130 /*
131 * Auto-serialization support. We will examine each method that is
132 * NotSerialized to determine if it creates any Named objects. If
133 * it does, it will be marked serialized to prevent problems if
134 * the method is entered by two or more threads and an attempt is
135 * made to create the same named object twice -- which results in
136 * an AE_ALREADY_EXISTS exception and method abort.
137 */
138 Info->MethodCount++;
139 ObjDesc = AcpiNsGetAttachedObject (Node);
140 if (!ObjDesc)
141 {
142 break;
143 }
144
145 /* Ignore if already serialized */
146
148 {
149 Info->SerialMethodCount++;
150 break;
151 }
152
153 if (AcpiGbl_AutoSerializeMethods)
154 {
155 /* Parse/scan method and serialize it if necessary */
156
159 {
160 /* Method was just converted to Serialized */
161
162 Info->SerialMethodCount++;
163 Info->SerializedMethodCount++;
164 break;
165 }
166 }
167
168 Info->NonSerialMethodCount++;
169 break;
170
171 case ACPI_TYPE_DEVICE:
172
173 Info->DeviceCount++;
174 break;
175
176 default:
177
178 break;
179 }
180
181 /*
182 * We ignore errors from above, and always return OK, since
183 * we don't want to abort the walk on a single error.
184 */
185 return (AE_OK);
186}
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
ACPI_OBJECT_TYPE AcpiNsGetType(ACPI_NAMESPACE_NODE *Node)
Definition: nsutils.c:120
#define ACPI_METHOD_SERIALIZED
Definition: acobject.h:238
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
#define ACPI_TYPE_REGION
Definition: actypes.h:697
#define ACPI_TYPE_DEVICE
Definition: actypes.h:693
#define ACPI_TYPE_METHOD
Definition: actypes.h:695
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:306
ACPI_STATUS AcpiDsAutoSerializeMethod(ACPI_NAMESPACE_NODE *Node, ACPI_OPERAND_OBJECT *ObjDesc)
Definition: dsmethod.c:94
ACPI_STATUS AcpiDsInitializeRegion(ACPI_HANDLE ObjHandle)
Definition: dsopcode.c:82
ACPI_OBJECT_COMMON_HEADER UINT8 InfoFlags
Definition: acobject.h:216
ACPI_OBJECT_METHOD Method
Definition: acobject.h:525
Definition: dlist.c:348

Referenced by AcpiDsInitializeObjects().