ReactOS  0.4.14-dev-999-g61c8d34
utxfmutex.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
Include dependency graph for utxfmutex.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_UTILITIES
 

Functions

static ACPI_STATUS AcpiUtGetMutexObject (ACPI_HANDLE Handle, ACPI_STRING Pathname, ACPI_OPERAND_OBJECT **RetObj)
 
ACPI_STATUS AcpiAcquireMutex (ACPI_HANDLE Handle, ACPI_STRING Pathname, UINT16 Timeout)
 
ACPI_STATUS AcpiReleaseMutex (ACPI_HANDLE Handle, ACPI_STRING Pathname)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_UTILITIES

Definition at line 49 of file utxfmutex.c.

Function Documentation

◆ AcpiAcquireMutex()

ACPI_STATUS AcpiAcquireMutex ( ACPI_HANDLE  Handle,
ACPI_STRING  Pathname,
UINT16  Timeout 
)

Definition at line 149 of file utxfmutex.c.

153 {
155  ACPI_OPERAND_OBJECT *MutexObj;
156 
157 
158  /* Get the low-level mutex associated with Handle:Pathname */
159 
160  Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj);
161  if (ACPI_FAILURE (Status))
162  {
163  return (Status);
164  }
165 
166  /* Acquire the OS mutex */
167 
169  return (Status);
170 }
ACPI_MUTEX OsMutex
Definition: acobject.h:188
ACPI_OBJECT_MUTEX Mutex
Definition: acobject.h:524
ACPI_STATUS AcpiOsAcquireMutex(ACPI_MUTEX Handle, UINT16 Timeout)
Definition: osl.c:306
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
static ACPI_STATUS AcpiUtGetMutexObject(ACPI_HANDLE Handle, ACPI_STRING Pathname, ACPI_OPERAND_OBJECT **RetObj)
Definition: utxfmutex.c:79
_In_ HANDLE Handle
Definition: extypes.h:390
Status
Definition: gdiplustypes.h:24
static ULONG Timeout
Definition: ping.c:61
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 Pathname
Definition: acpixf.h:700

◆ AcpiReleaseMutex()

ACPI_STATUS AcpiReleaseMutex ( ACPI_HANDLE  Handle,
ACPI_STRING  Pathname 
)

Definition at line 193 of file utxfmutex.c.

196 {
198  ACPI_OPERAND_OBJECT *MutexObj;
199 
200 
201  /* Get the low-level mutex associated with Handle:Pathname */
202 
203  Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj);
204  if (ACPI_FAILURE (Status))
205  {
206  return (Status);
207  }
208 
209  /* Release the OS mutex */
210 
211  AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex);
212  return (AE_OK);
213 }
ACPI_MUTEX OsMutex
Definition: acobject.h:188
ACPI_OBJECT_MUTEX Mutex
Definition: acobject.h:524
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
static ACPI_STATUS AcpiUtGetMutexObject(ACPI_HANDLE Handle, ACPI_STRING Pathname, ACPI_OPERAND_OBJECT **RetObj)
Definition: utxfmutex.c:79
_In_ HANDLE Handle
Definition: extypes.h:390
Status
Definition: gdiplustypes.h:24
void AcpiOsReleaseMutex(ACPI_MUTEX Handle)
Definition: osl.c:333
#define AE_OK
Definition: acexcep.h:97
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 Pathname
Definition: acpixf.h:700

◆ AcpiUtGetMutexObject()

static ACPI_STATUS AcpiUtGetMutexObject ( ACPI_HANDLE  Handle,
ACPI_STRING  Pathname,
ACPI_OPERAND_OBJECT **  RetObj 
)
static

Definition at line 79 of file utxfmutex.c.

83 {
84  ACPI_NAMESPACE_NODE *MutexNode;
85  ACPI_OPERAND_OBJECT *MutexObj;
87 
88 
89  /* Parameter validation */
90 
91  if (!RetObj || (!Handle && !Pathname))
92  {
93  return (AE_BAD_PARAMETER);
94  }
95 
96  /* Get a the namespace node for the mutex */
97 
98  MutexNode = Handle;
99  if (Pathname != NULL)
100  {
102  Handle, Pathname, ACPI_CAST_PTR (ACPI_HANDLE, &MutexNode));
103  if (ACPI_FAILURE (Status))
104  {
105  return (Status);
106  }
107  }
108 
109  /* Ensure that we actually have a Mutex object */
110 
111  if (!MutexNode ||
112  (MutexNode->Type != ACPI_TYPE_MUTEX))
113  {
114  return (AE_TYPE);
115  }
116 
117  /* Get the low-level mutex object */
118 
119  MutexObj = AcpiNsGetAttachedObject (MutexNode);
120  if (!MutexObj)
121  {
122  return (AE_NULL_OBJECT);
123  }
124 
125  *RetObj = MutexObj;
126  return (AE_OK);
127 }
#define AE_NULL_OBJECT
Definition: acexcep.h:117
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
smooth NULL
Definition: ftsmooth.c:416
_In_ HANDLE Handle
Definition: extypes.h:390
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
ACPI_STATUS AcpiGetHandle(ACPI_HANDLE Parent, ACPI_STRING Pathname, ACPI_HANDLE *RetHandle)
Definition: nsxfname.c:85
#define AE_TYPE
Definition: acexcep.h:116
Status
Definition: gdiplustypes.h:24
#define ACPI_TYPE_MUTEX
Definition: actypes.h:688
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define AE_OK
Definition: acexcep.h:97
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 Pathname
Definition: acpixf.h:700

Referenced by AcpiAcquireMutex(), and AcpiReleaseMutex().