ReactOS 0.4.15-dev-7942-gd23573b
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
161 if (ACPI_FAILURE (Status))
162 {
163 return (Status);
164 }
165
166 /* Acquire the OS mutex */
167
169 return (Status);
170}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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 Pathname
Definition: acpixf.h:704
#define AcpiOsAcquireMutex(Handle, Time)
Definition: actypes.h:276
UINT32 ACPI_STATUS
Definition: actypes.h:460
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
static ULONG Timeout
Definition: ping.c:61
ACPI_MUTEX OsMutex
Definition: acobject.h:188
ACPI_OBJECT_MUTEX Mutex
Definition: acobject.h:526
static ACPI_STATUS AcpiUtGetMutexObject(ACPI_HANDLE Handle, ACPI_STRING Pathname, ACPI_OPERAND_OBJECT **RetObj)
Definition: utxfmutex.c:79

◆ 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
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}
#define AE_OK
Definition: acexcep.h:97
#define AcpiOsReleaseMutex(Handle)
Definition: actypes.h:277

◆ 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_BAD_PARAMETER
Definition: acexcep.h:151
#define AE_NULL_OBJECT
Definition: acexcep.h:117
#define AE_TYPE
Definition: acexcep.h:116
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
#define ACPI_TYPE_MUTEX
Definition: actypes.h:696
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define NULL
Definition: types.h:112
ACPI_STATUS AcpiGetHandle(ACPI_HANDLE Parent, ACPI_STRING Pathname, ACPI_HANDLE *RetHandle)
Definition: nsxfname.c:85

Referenced by AcpiAcquireMutex(), and AcpiReleaseMutex().