ReactOS  0.4.15-dev-439-g292f67a
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 HowLong)
 
ACPI_STATUS AcpiExSystemDoSleep (UINT64 HowLong)
 
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  HowLong)

Definition at line 218 of file exsystem.c.

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

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemDoStall()

ACPI_STATUS AcpiExSystemDoStall ( UINT32  HowLong)

Definition at line 174 of file exsystem.c.

176 {
178 
179 
181 
182 
183  if (HowLong > 255) /* 255 microseconds */
184  {
185  /*
186  * Longer than 255 usec, 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)", HowLong));
194  }
195  else
196  {
197  AcpiOsStall (HowLong);
198  }
199 
200  return (Status);
201 }
void AcpiOsStall(UINT32 Microseconds)
Definition: osl.c:264
#define AE_AML_OPERAND_VALUE
Definition: acexcep.h:183
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
Status
Definition: gdiplustypes.h:24
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemResetEvent()

ACPI_STATUS AcpiExSystemResetEvent ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 327 of file exsystem.c.

329 {
331  ACPI_SEMAPHORE TempSemaphore;
332 
333 
335 
336 
337  /*
338  * We are going to simply delete the existing semaphore and
339  * create a new one!
340  */
341  Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT, 0, &TempSemaphore);
342  if (ACPI_SUCCESS (Status))
343  {
345  ObjDesc->Event.OsSemaphore = TempSemaphore;
346  }
347 
348  return (Status);
349 }
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ACPI_SEMAPHORE
Definition: actypes.h:287
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_OBJECT_EVENT Event
Definition: acobject.h:522
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
ACPI_STATUS AcpiOsDeleteSemaphore(ACPI_SEMAPHORE Handle)
Definition: osl.c:378
ACPI_STATUS AcpiOsCreateSemaphore(UINT32 MaxUnits, UINT32 InitialUnits, ACPI_SEMAPHORE *OutHandle)
Definition: osl.c:352
Status
Definition: gdiplustypes.h:24
#define ACPI_NO_UNIT_LIMIT
Definition: acpiosxf.h:67
ACPI_OBJECT_COMMON_HEADER ACPI_SEMAPHORE OsSemaphore
Definition: acobject.h:178
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemSignalEvent()

ACPI_STATUS AcpiExSystemSignalEvent ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 260 of file exsystem.c.

262 {
264 
265 
266  ACPI_FUNCTION_TRACE (ExSystemSignalEvent);
267 
268 
269  if (ObjDesc)
270  {
272  }
273 
275 }
ACPI_STATUS AcpiOsSignalSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units)
Definition: osl.c:439
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_OBJECT_EVENT Event
Definition: acobject.h:522
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_OBJECT_COMMON_HEADER ACPI_SEMAPHORE OsSemaphore
Definition: acobject.h:178
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiExOpcode_1A_0T_0R().

◆ AcpiExSystemWaitEvent()

ACPI_STATUS AcpiExSystemWaitEvent ( ACPI_OPERAND_OBJECT TimeDesc,
ACPI_OPERAND_OBJECT ObjDesc 
)

Definition at line 294 of file exsystem.c.

297 {
299 
300 
301  ACPI_FUNCTION_TRACE (ExSystemWaitEvent);
302 
303 
304  if (ObjDesc)
305  {
307  (UINT16) TimeDesc->Integer.Value);
308  }
309 
311 }
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_OBJECT_EVENT Event
Definition: acobject.h:522
ACPI_STATUS AcpiExSystemWaitSemaphore(ACPI_SEMAPHORE Semaphore, UINT16 Timeout)
Definition: exsystem.c:68
ACPI_OBJECT_INTEGER Integer
Definition: acobject.h:518
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
unsigned short UINT16
ACPI_OBJECT_COMMON_HEADER ACPI_SEMAPHORE OsSemaphore
Definition: acobject.h:178
#define AE_OK
Definition: acexcep.h:97

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 ACPI_SUCCESS(a)
Definition: acexcep.h:94
ACPI_STATUS AcpiOsAcquireMutex(ACPI_MUTEX Handle, UINT16 Timeout)
Definition: osl.c:306
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AE_TIME
Definition: acexcep.h:125
Definition: Mutex.h:15
const char * AcpiFormatException(ACPI_STATUS Status)
Definition: utexcep.c:70
#define ACPI_DO_NOT_WAIT
Definition: actypes.h:502
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_EXEC
Definition: acoutput.h:165
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
static ULONG Timeout
Definition: ping.c:61
void AcpiExEnterInterpreter(void)
Definition: exutils.c:91
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480

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 }
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AE_TIME
Definition: acexcep.h:125
const char * AcpiFormatException(ACPI_STATUS Status)
Definition: utexcep.c:70
#define ACPI_DO_NOT_WAIT
Definition: actypes.h:502
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_STATUS AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units, UINT16 Timeout)
Definition: osl.c:393
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_EXEC
Definition: acoutput.h:165
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
static ULONG Timeout
Definition: ping.c:61
void AcpiExEnterInterpreter(void)
Definition: exutils.c:91
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480

Referenced by AcpiEvAcquireGlobalLock(), and AcpiExSystemWaitEvent().