ReactOS 0.4.15-dev-8102-g108db8f
evxfevnt.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
Include dependency graph for evxfevnt.c:

Go to the source code of this file.

Macros

#define EXPORT_ACPI_INTERFACES
 
#define _COMPONENT   ACPI_EVENTS
 

Functions

ACPI_STATUS AcpiEnable (void)
 
ACPI_STATUS AcpiDisable (void)
 
ACPI_STATUS AcpiEnableEvent (UINT32 Event, UINT32 Flags)
 
ACPI_STATUS AcpiDisableEvent (UINT32 Event, UINT32 Flags)
 
ACPI_STATUS AcpiClearEvent (UINT32 Event)
 
ACPI_STATUS AcpiGetEventStatus (UINT32 Event, ACPI_EVENT_STATUS *EventStatus)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EVENTS

Definition at line 50 of file evxfevnt.c.

◆ EXPORT_ACPI_INTERFACES

#define EXPORT_ACPI_INTERFACES

Definition at line 44 of file evxfevnt.c.

Function Documentation

◆ AcpiClearEvent()

ACPI_STATUS AcpiClearEvent ( UINT32  Event)

Definition at line 333 of file evxfevnt.c.

335{
337
338
340
341
342 /* If Hardware Reduced flag is set, there are no fixed events */
343
344 if (AcpiGbl_ReducedHardware)
345 {
347 }
348
349 /* Decode the Fixed Event */
350
351 if (Event > ACPI_EVENT_MAX)
352 {
354 }
355
356 /*
357 * Clear the requested fixed event (By writing a one to the status
358 * register bit)
359 */
361 AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
363
365}
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define AE_OK
Definition: acexcep.h:97
ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]
Definition: utglobal.c:175
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_CLEAR_STATUS
Definition: actypes.h:939
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_EVENT_MAX
Definition: actypes.h:769
ACPI_STATUS AcpiClearEvent(UINT32 Event)
Definition: evxfevnt.c:333
Status
Definition: gdiplustypes.h:25
ACPI_STATUS AcpiWriteBitRegister(UINT32 RegisterId, UINT32 Value)
Definition: hwxface.c:282

Referenced by AcpiClearEvent().

◆ AcpiDisable()

ACPI_STATUS AcpiDisable ( void  )

Definition at line 132 of file evxfevnt.c.

134{
136
137
139
140
141 /* If the Hardware Reduced flag is set, machine is always in acpi mode */
142
143 if (AcpiGbl_ReducedHardware)
144 {
146 }
147
149 {
151 "System is already in legacy (non-ACPI) mode\n"));
152 }
153 else
154 {
155 /* Transition to LEGACY mode */
156
158
159 if (ACPI_FAILURE (Status))
160 {
162 "Could not exit ACPI mode to legacy mode"));
164 }
165
167 "ACPI mode disabled\n"));
168 }
169
171}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_DB_INIT
Definition: acoutput.h:151
#define ACPI_SYS_MODE_LEGACY
Definition: actypes.h:1085
ACPI_STATUS AcpiHwSetMode(UINT32 Mode)
Definition: hwacpi.c:66
UINT32 AcpiHwGetMode(void)
Definition: hwacpi.c:179
ACPI_STATUS AcpiDisable(void)
Definition: evxfevnt.c:132

Referenced by AcpiDisable(), and AcpiEvTerminate().

◆ AcpiDisableEvent()

ACPI_STATUS AcpiDisableEvent ( UINT32  Event,
UINT32  Flags 
)

Definition at line 263 of file evxfevnt.c.

266{
269
270
272
273
274 /* If Hardware Reduced flag is set, there are no fixed events */
275
276 if (AcpiGbl_ReducedHardware)
277 {
279 }
280
281 /* Decode the Fixed Event */
282
283 if (Event > ACPI_EVENT_MAX)
284 {
286 }
287
288 /*
289 * Disable the requested fixed event (by writing a zero to the enable
290 * register bit)
291 */
293 AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
295 if (ACPI_FAILURE (Status))
296 {
298 }
299
301 AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
302 if (ACPI_FAILURE (Status))
303 {
305 }
306
307 if (Value != 0)
308 {
310 "Could not disable %s events", AcpiUtGetEventName (Event)));
312 }
313
315}
unsigned int UINT32
#define AE_NO_HARDWARE_RESPONSE
Definition: acexcep.h:130
#define ACPI_DISABLE_EVENT
Definition: actypes.h:944
const char * AcpiUtGetEventName(UINT32 EventId)
Definition: utdecode.c:175
ACPI_STATUS AcpiDisableEvent(UINT32 Event, UINT32 Flags)
Definition: evxfevnt.c:263
ACPI_STATUS AcpiReadBitRegister(UINT32 RegisterId, UINT32 *ReturnValue)
Definition: hwxface.c:213
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by AcpiDisableEvent(), AcpiEvTerminate(), and AcpiRemoveFixedEventHandler().

◆ AcpiEnable()

ACPI_STATUS AcpiEnable ( void  )

Definition at line 68 of file evxfevnt.c.

70{
72
73
75
76
77 /* ACPI tables must be present */
78
79 if (AcpiGbl_FadtIndex == ACPI_INVALID_TABLE_INDEX)
80 {
82 }
83
84 /* If the Hardware Reduced flag is set, machine is always in acpi mode */
85
86 if (AcpiGbl_ReducedHardware)
87 {
89 }
90
91 /* Check current mode */
92
94 {
96 "System is already in ACPI mode\n"));
97 }
98 else
99 {
100 /* Transition to ACPI mode */
101
103 if (ACPI_FAILURE (Status))
104 {
105 ACPI_ERROR ((AE_INFO, "Could not transition to ACPI mode"));
107 }
108
110 "Transition to ACPI mode successful\n"));
111 }
112
114}
#define AE_NO_ACPI_TABLES
Definition: acexcep.h:110
#define ACPI_INVALID_TABLE_INDEX
Definition: aclocal.h:260
#define ACPI_SYS_MODE_ACPI
Definition: actypes.h:1084
ACPI_STATUS AcpiEnable(void)
Definition: evxfevnt.c:68

Referenced by AcpiEnable(), and AcpiEnableSubsystem().

◆ AcpiEnableEvent()

ACPI_STATUS AcpiEnableEvent ( UINT32  Event,
UINT32  Flags 
)

Definition at line 190 of file evxfevnt.c.

193{
196
197
199
200
201 /* If Hardware Reduced flag is set, there are no fixed events */
202
203 if (AcpiGbl_ReducedHardware)
204 {
206 }
207
208 /* Decode the Fixed Event */
209
210 if (Event > ACPI_EVENT_MAX)
211 {
213 }
214
215 /*
216 * Enable the requested fixed event (by writing a one to the enable
217 * register bit)
218 */
220 AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
222 if (ACPI_FAILURE (Status))
223 {
225 }
226
227 /* Make sure that the hardware responded */
228
230 AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
231 if (ACPI_FAILURE (Status))
232 {
234 }
235
236 if (Value != 1)
237 {
239 "Could not enable %s event", AcpiUtGetEventName (Event)));
241 }
242
244}
#define ACPI_ENABLE_EVENT
Definition: actypes.h:943
ACPI_STATUS AcpiEnableEvent(UINT32 Event, UINT32 Flags)
Definition: evxfevnt.c:190

Referenced by AcpiEnableEvent(), and AcpiInstallFixedEventHandler().

◆ AcpiGetEventStatus()

ACPI_STATUS AcpiGetEventStatus ( UINT32  Event,
ACPI_EVENT_STATUS EventStatus 
)

Definition at line 385 of file evxfevnt.c.

388{
390 ACPI_EVENT_STATUS LocalEventStatus = 0;
391 UINT32 InByte;
392
393
395
396
397 if (!EventStatus)
398 {
400 }
401
402 /* Decode the Fixed Event */
403
404 if (Event > ACPI_EVENT_MAX)
405 {
407 }
408
409 /* Fixed event currently can be dispatched? */
410
411 if (AcpiGbl_FixedEventHandlers[Event].Handler)
412 {
413 LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
414 }
415
416 /* Fixed event currently enabled? */
417
419 AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
420 if (ACPI_FAILURE (Status))
421 {
423 }
424
425 if (InByte)
426 {
427 LocalEventStatus |=
429 }
430
431 /* Fixed event currently active? */
432
434 AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
435 if (ACPI_FAILURE (Status))
436 {
438 }
439
440 if (InByte)
441 {
442 LocalEventStatus |= ACPI_EVENT_FLAG_STATUS_SET;
443 }
444
445 (*EventStatus) = LocalEventStatus;
447}
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 Handler
Definition: acpixf.h:672
#define ACPI_EVENT_FLAG_ENABLED
Definition: actypes.h:793
#define ACPI_EVENT_FLAG_HAS_HANDLER
Definition: actypes.h:797
#define ACPI_EVENT_FLAG_STATUS_SET
Definition: actypes.h:795
UINT32 ACPI_EVENT_STATUS
Definition: actypes.h:790
#define ACPI_EVENT_FLAG_ENABLE_SET
Definition: actypes.h:796
ACPI_STATUS AcpiGetEventStatus(UINT32 Event, ACPI_EVENT_STATUS *EventStatus)
Definition: evxfevnt.c:385

Referenced by AcpiGetEventStatus().