ReactOS  0.4.14-dev-552-g2fad488
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 208 of file nsxfobj.c.

213 {
216  ACPI_NAMESPACE_NODE *ParentNode = NULL;
217  ACPI_NAMESPACE_NODE *ChildNode = NULL;
218 
219 
220  /* Parameter validation */
221 
223  {
224  return (AE_BAD_PARAMETER);
225  }
226 
228  if (ACPI_FAILURE (Status))
229  {
230  return (Status);
231  }
232 
233  /* If null handle, use the parent */
234 
235  if (!Child)
236  {
237  /* Start search at the beginning of the specified scope */
238 
239  ParentNode = AcpiNsValidateHandle (Parent);
240  if (!ParentNode)
241  {
243  goto UnlockAndExit;
244  }
245  }
246  else
247  {
248  /* Non-null handle, ignore the parent */
249  /* Convert and validate the handle */
250 
251  ChildNode = AcpiNsValidateHandle (Child);
252  if (!ChildNode)
253  {
255  goto UnlockAndExit;
256  }
257  }
258 
259  /* Internal function does the real work */
260 
261  Node = AcpiNsGetNextNodeTyped (Type, ParentNode, ChildNode);
262  if (!Node)
263  {
265  goto UnlockAndExit;
266  }
267 
268  if (RetHandle)
269  {
270  *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
271  }
272 
273 
274 UnlockAndExit:
275 
277  return (Status);
278 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
Type
Definition: Type.h:6
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical 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:728
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_NAMESPACE_NODE * AcpiNsGetNextNodeTyped(ACPI_OBJECT_TYPE Type, ACPI_NAMESPACE_NODE *Parent, ACPI_NAMESPACE_NODE *Child)
Definition: nswalk.c:112
#define ACPI_TYPE_EXTERNAL_MAX
Definition: actypes.h:696
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
union node Node
Definition: types.h:1255
smooth NULL
Definition: ftsmooth.c:416
#define AE_NOT_FOUND
Definition: acexcep.h:113
Status
Definition: gdiplustypes.h:24
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical 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 ACPI_HANDLE Child
Definition: acpixf.h:728
ACPI_NAMESPACE_NODE * AcpiNsValidateHandle(ACPI_HANDLE Handle)
Definition: nsutils.c:655
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
Definition: dlist.c:348

Referenced by acpi_bus_scan().

◆ AcpiGetParent()

ACPI_STATUS AcpiGetParent ( ACPI_HANDLE  Handle,
ACPI_HANDLE RetHandle 
)

Definition at line 131 of file nsxfobj.c.

134 {
136  ACPI_NAMESPACE_NODE *ParentNode;
138 
139 
140  if (!RetHandle)
141  {
142  return (AE_BAD_PARAMETER);
143  }
144 
145  /* Special case for the predefined Root Node (no parent) */
146 
147  if (Handle == ACPI_ROOT_OBJECT)
148  {
149  return (AE_NULL_ENTRY);
150  }
151 
153  if (ACPI_FAILURE (Status))
154  {
155  return (Status);
156  }
157 
158  /* Convert and validate the handle */
159 
161  if (!Node)
162  {
164  goto UnlockAndExit;
165  }
166 
167  /* Get the parent entry */
168 
169  ParentNode = Node->Parent;
170  *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, ParentNode);
171 
172  /* Return exception if parent is null */
173 
174  if (!ParentNode)
175  {
177  }
178 
179 
180 UnlockAndExit:
181 
183  return (Status);
184 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
union node Node
Definition: types.h:1255
#define ACPI_ROOT_OBJECT
Definition: actypes.h:500
_In_ HANDLE Handle
Definition: extypes.h:390
Status
Definition: gdiplustypes.h:24
#define AE_NULL_ENTRY
Definition: acexcep.h:118
ACPI_NAMESPACE_NODE * AcpiNsValidateHandle(ACPI_HANDLE Handle)
Definition: nsutils.c:655
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
Definition: dlist.c:348

Referenced by acpi_bus_scan(), and AcpiHwBuildPciList().

◆ AcpiGetType()

ACPI_STATUS AcpiGetType ( ACPI_HANDLE  Handle,
ACPI_OBJECT_TYPE RetType 
)

Definition at line 69 of file nsxfobj.c.

72 {
75 
76 
77  /* Parameter Validation */
78 
79  if (!RetType)
80  {
81  return (AE_BAD_PARAMETER);
82  }
83 
84  /* Special case for the predefined Root Node (return type ANY) */
85 
86  if (Handle == ACPI_ROOT_OBJECT)
87  {
88  *RetType = ACPI_TYPE_ANY;
89  return (AE_OK);
90  }
91 
93  if (ACPI_FAILURE (Status))
94  {
95  return (Status);
96  }
97 
98  /* Convert and validate the handle */
99 
101  if (!Node)
102  {
104  return (AE_BAD_PARAMETER);
105  }
106 
107  *RetType = Node->Type;
108 
110  return (Status);
111 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
union node Node
Definition: types.h:1255
#define ACPI_ROOT_OBJECT
Definition: actypes.h:500
_In_ HANDLE Handle
Definition: extypes.h:390
#define ACPI_TYPE_ANY
Definition: actypes.h:678
Status
Definition: gdiplustypes.h:24
ACPI_NAMESPACE_NODE * AcpiNsValidateHandle(ACPI_HANDLE Handle)
Definition: nsutils.c:655
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
#define AE_OK
Definition: acexcep.h:97
Definition: dlist.c:348

Referenced by acpi_bus_scan(), and AcpiHwGetPciDeviceInfo().