ReactOS 0.4.15-dev-7846-g8ba6c66
nsxfobj.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
Include dependency graph for nsxfobj.c:

Go to the source code of this file.

Macros

#define EXPORT_ACPI_INTERFACES
 
#define _COMPONENT   ACPI_NAMESPACE
 

Functions

ACPI_STATUS AcpiGetType (ACPI_HANDLE Handle, ACPI_OBJECT_TYPE *RetType)
 
ACPI_STATUS AcpiGetParent (ACPI_HANDLE Handle, ACPI_HANDLE *RetHandle)
 
ACPI_STATUS AcpiGetNextObject (ACPI_OBJECT_TYPE Type, ACPI_HANDLE Parent, ACPI_HANDLE Child, ACPI_HANDLE *RetHandle)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_NAMESPACE

Definition at line 52 of file nsxfobj.c.

◆ EXPORT_ACPI_INTERFACES

#define EXPORT_ACPI_INTERFACES

Definition at line 45 of file nsxfobj.c.

Function Documentation

◆ AcpiGetNextObject()

ACPI_STATUS AcpiGetNextObject ( ACPI_OBJECT_TYPE  Type,
ACPI_HANDLE  Parent,
ACPI_HANDLE  Child,
ACPI_HANDLE RetHandle 
)

Definition at line 209 of file nsxfobj.c.

214{
217 ACPI_NAMESPACE_NODE *ParentNode = NULL;
218 ACPI_NAMESPACE_NODE *ChildNode = NULL;
219
220
221 /* Parameter validation */
222
224 {
225 return (AE_BAD_PARAMETER);
226 }
227
229 if (ACPI_FAILURE (Status))
230 {
231 return (Status);
232 }
233
234 /* If null handle, use the parent */
235
236 if (!Child)
237 {
238 /* Start search at the beginning of the specified scope */
239
240 ParentNode = AcpiNsValidateHandle (Parent);
241 if (!ParentNode)
242 {
244 goto UnlockAndExit;
245 }
246 }
247 else
248 {
249 /* Non-null handle, ignore the parent */
250 /* Convert and validate the handle */
251
252 ChildNode = AcpiNsValidateHandle (Child);
253 if (!ChildNode)
254 {
256 goto UnlockAndExit;
257 }
258 }
259
260 /* Internal function does the real work */
261
262 Node = AcpiNsGetNextNodeTyped (Type, ParentNode, ChildNode);
263 if (!Node)
264 {
266 goto UnlockAndExit;
267 }
268
269 if (RetHandle)
270 {
271 *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
272 }
273
274
275UnlockAndExit:
276
278 return (Status);
279}
Type
Definition: Type.h:7
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define AE_NOT_FOUND
Definition: acexcep.h:113
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
ACPI_NAMESPACE_NODE * AcpiNsValidateHandle(ACPI_HANDLE Handle)
Definition: nsutils.c:655
ACPI_NAMESPACE_NODE * AcpiNsGetNextNodeTyped(ACPI_OBJECT_TYPE Type, ACPI_NAMESPACE_NODE *Parent, ACPI_NAMESPACE_NODE *Child)
Definition: nswalk.c:112
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define ACPI_TYPE_EXTERNAL_MAX
Definition: actypes.h:705
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
#define NULL
Definition: types.h:112
union node Node
Definition: types.h:1255
Status
Definition: gdiplustypes.h:25
Definition: dlist.c:348
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

Referenced by acpi_bus_scan().

◆ AcpiGetParent()

ACPI_STATUS AcpiGetParent ( ACPI_HANDLE  Handle,
ACPI_HANDLE RetHandle 
)

Definition at line 132 of file nsxfobj.c.

135{
137 ACPI_NAMESPACE_NODE *ParentNode;
139
140
141 if (!RetHandle)
142 {
143 return (AE_BAD_PARAMETER);
144 }
145
146 /* Special case for the predefined Root Node (no parent) */
147
149 {
150 return (AE_NULL_ENTRY);
151 }
152
154 if (ACPI_FAILURE (Status))
155 {
156 return (Status);
157 }
158
159 /* Convert and validate the handle */
160
162 if (!Node)
163 {
165 goto UnlockAndExit;
166 }
167
168 /* Get the parent entry */
169
170 ParentNode = Node->Parent;
171 *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, ParentNode);
172
173 /* Return exception if parent is null */
174
175 if (!ParentNode)
176 {
178 }
179
180
181UnlockAndExit:
182
184 return (Status);
185}
#define AE_NULL_ENTRY
Definition: acexcep.h:118
#define ACPI_ROOT_OBJECT
Definition: actypes.h:500
ULONG Handle
Definition: gdb_input.c:15

Referenced by acpi_bus_scan(), and AcpiHwBuildPciList().

◆ AcpiGetType()

ACPI_STATUS AcpiGetType ( ACPI_HANDLE  Handle,
ACPI_OBJECT_TYPE RetType 
)

Definition at line 70 of file nsxfobj.c.

73{
76
77
78 /* Parameter Validation */
79
80 if (!RetType)
81 {
82 return (AE_BAD_PARAMETER);
83 }
84
85 /* Special case for the predefined Root Node (return type ANY) */
86
88 {
89 *RetType = ACPI_TYPE_ANY;
90 return (AE_OK);
91 }
92
94 if (ACPI_FAILURE (Status))
95 {
96 return (Status);
97 }
98
99 /* Convert and validate the handle */
100
102 if (!Node)
103 {
105 return (AE_BAD_PARAMETER);
106 }
107
108 *RetType = Node->Type;
109
111 return (Status);
112}
#define AE_OK
Definition: acexcep.h:97
#define ACPI_TYPE_ANY
Definition: actypes.h:687

Referenced by acpi_bus_scan(), and AcpiHwGetPciDeviceInfo().