ReactOS 0.4.15-dev-7918-g2a2556c
exsystem.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acinterp.h"
Include dependency graph for exsystem.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_EXECUTER
 

Functions

ACPI_STATUS AcpiExSystemWaitSemaphore (ACPI_SEMAPHORE Semaphore, UINT16 Timeout)
 
ACPI_STATUS AcpiExSystemWaitMutex (ACPI_MUTEX Mutex, UINT16 Timeout)
 
ACPI_STATUS AcpiExSystemDoStall (UINT32 HowLongUs)
 
ACPI_STATUS AcpiExSystemDoSleep (UINT64 HowLongMs)
 
ACPI_STATUS AcpiExSystemSignalEvent (ACPI_OPERAND_OBJECT *ObjDesc)
 
ACPI_STATUS AcpiExSystemWaitEvent (ACPI_OPERAND_OBJECT *TimeDesc, ACPI_OPERAND_OBJECT *ObjDesc)
 
ACPI_STATUS AcpiExSystemResetEvent (ACPI_OPERAND_OBJECT *ObjDesc)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EXECUTER

Definition at line 48 of file exsystem.c.

Function Documentation

◆ AcpiExSystemDoSleep()

ACPI_STATUS AcpiExSystemDoSleep ( UINT64  HowLongMs)

Definition at line 223 of file exsystem.c.

225{
227
228
229 /* Since this thread will sleep, we must release the interpreter */
230
232
233 /*
234 * For compatibility with other ACPI implementations and to prevent
235 * accidental deep sleeps, limit the sleep time to something reasonable.
236 */
237 if (HowLongMs > ACPI_MAX_SLEEP)
238 {
239 HowLongMs = ACPI_MAX_SLEEP;
240 }
241
242 AcpiOsSleep (HowLongMs);
243
244 /* And now we must get the interpreter again */
245
247 return (AE_OK);
248}
#define AE_OK
Definition: acexcep.h:97
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
void AcpiOsSleep(UINT64 Milliseconds)
Definition: osl.c:257
#define ACPI_MAX_SLEEP
Definition: acconfig.h:144
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
void AcpiExEnterInterpreter(void)
Definition: exutils.c:91

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemDoStall()

ACPI_STATUS AcpiExSystemDoStall ( UINT32  HowLongUs)

Definition at line 174 of file exsystem.c.

176{
178
179
181
182
183 if (HowLongUs > 255)
184 {
185 /*
186 * Longer than 255 microseconds, this is an error
187 *
188 * (ACPI specifies 100 usec as max, but this gives some slack in
189 * order to support existing BIOSs)
190 */
192 "Time parameter is too large (%u)", HowLongUs));
194 }
195 else
196 {
197 if (HowLongUs > 100)
198 {
200 "Time parameter %u us > 100 us violating ACPI spec, please fix the firmware.", HowLongUs));
201 }
202 AcpiOsStall (HowLongUs);
203 }
204
205 return (Status);
206}
#define AE_AML_OPERAND_VALUE
Definition: acexcep.h:183
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_INFO
Definition: acoutput.h:230
void AcpiOsStall(UINT32 Microseconds)
Definition: osl.c:264
UINT32 ACPI_STATUS
Definition: actypes.h:460
Status
Definition: gdiplustypes.h:25

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemResetEvent()

ACPI_STATUS AcpiExSystemResetEvent ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 332 of file exsystem.c.

334{
336 ACPI_SEMAPHORE TempSemaphore;
337
338
340
341
342 /*
343 * We are going to simply delete the existing semaphore and
344 * create a new one!
345 */
346 Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT, 0, &TempSemaphore);
347 if (ACPI_SUCCESS (Status))
348 {
350 ObjDesc->Event.OsSemaphore = TempSemaphore;
351 }
352
353 return (Status);
354}
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
ACPI_STATUS AcpiOsCreateSemaphore(UINT32 MaxUnits, UINT32 InitialUnits, ACPI_SEMAPHORE *OutHandle)
Definition: osl.c:352
ACPI_STATUS AcpiOsDeleteSemaphore(ACPI_SEMAPHORE Handle)
Definition: osl.c:378
#define ACPI_NO_UNIT_LIMIT
Definition: acpiosxf.h:67
#define ACPI_SEMAPHORE
Definition: actypes.h:287
ACPI_OBJECT_COMMON_HEADER ACPI_SEMAPHORE OsSemaphore
Definition: acobject.h:178
ACPI_OBJECT_EVENT Event
Definition: acobject.h:524

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemSignalEvent()

ACPI_STATUS AcpiExSystemSignalEvent ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 265 of file exsystem.c.

267{
269
270
271 ACPI_FUNCTION_TRACE (ExSystemSignalEvent);
272
273
274 if (ObjDesc)
275 {
277 }
278
280}
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiOsSignalSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units)
Definition: osl.c:439

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemWaitEvent()

ACPI_STATUS AcpiExSystemWaitEvent ( ACPI_OPERAND_OBJECT TimeDesc,
ACPI_OPERAND_OBJECT ObjDesc 
)

Definition at line 299 of file exsystem.c.

302{
304
305
306 ACPI_FUNCTION_TRACE (ExSystemWaitEvent);
307
308
309 if (ObjDesc)
310 {
312 (UINT16) TimeDesc->Integer.Value);
313 }
314
316}
unsigned short UINT16
ACPI_STATUS AcpiExSystemWaitSemaphore(ACPI_SEMAPHORE Semaphore, UINT16 Timeout)
Definition: exsystem.c:68
ACPI_OBJECT_INTEGER Integer
Definition: acobject.h:520

Referenced by AcpiExOpcode_2A_0T_1R().

◆ AcpiExSystemWaitMutex()

ACPI_STATUS AcpiExSystemWaitMutex ( ACPI_MUTEX  Mutex,
UINT16  Timeout 
)

Definition at line 120 of file exsystem.c.

123{
125
126
127 ACPI_FUNCTION_TRACE (ExSystemWaitMutex);
128
129
131 if (ACPI_SUCCESS (Status))
132 {
134 }
135
136 if (Status == AE_TIME)
137 {
138 /* We must wait, so unlock the interpreter */
139
142
144 "*** Thread awake after blocking, %s\n",
146
147 /* Reacquire the interpreter */
148
150 }
151
153}
#define AE_TIME
Definition: acexcep.h:125
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_DB_EXEC
Definition: acoutput.h:165
#define AcpiOsAcquireMutex(Handle, Time)
Definition: actypes.h:276
#define ACPI_DO_NOT_WAIT
Definition: actypes.h:502
Definition: Mutex.h:16
static ULONG Timeout
Definition: ping.c:61
const char * AcpiFormatException(ACPI_STATUS Status)
Definition: utexcep.c:70

Referenced by AcpiDsBeginMethodExecution(), AcpiEvAcquireGlobalLock(), and AcpiExAcquireMutexObject().

◆ AcpiExSystemWaitSemaphore()

ACPI_STATUS AcpiExSystemWaitSemaphore ( ACPI_SEMAPHORE  Semaphore,
UINT16  Timeout 
)

Definition at line 68 of file exsystem.c.

71{
73
74
75 ACPI_FUNCTION_TRACE (ExSystemWaitSemaphore);
76
77
79 if (ACPI_SUCCESS (Status))
80 {
82 }
83
84 if (Status == AE_TIME)
85 {
86 /* We must wait, so unlock the interpreter */
87
89 Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
90
92 "*** Thread awake after blocking, %s\n",
94
95 /* Reacquire the interpreter */
96
98 }
99
101}
ACPI_STATUS AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units, UINT16 Timeout)
Definition: osl.c:393

Referenced by AcpiEvAcquireGlobalLock(), and AcpiExSystemWaitEvent().