ReactOS  0.4.15-dev-1018-g0695ecb
evsci.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
Include dependency graph for evsci.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_EVENTS
 

Functions

static UINT32 ACPI_SYSTEM_XFACE AcpiEvSciXruptHandler (void *Context)
 
UINT32 AcpiEvSciDispatch (void)
 
UINT32 ACPI_SYSTEM_XFACE AcpiEvGpeXruptHandler (void *Context)
 
UINT32 AcpiEvInstallSciHandler (void)
 
ACPI_STATUS AcpiEvRemoveAllSciHandlers (void)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EVENTS

Definition at line 50 of file evsci.c.

Function Documentation

◆ AcpiEvGpeXruptHandler()

UINT32 ACPI_SYSTEM_XFACE AcpiEvGpeXruptHandler ( void Context)

Definition at line 176 of file evsci.c.

178 {
179  ACPI_GPE_XRUPT_INFO *GpeXruptList = Context;
180  UINT32 InterruptHandled = ACPI_INTERRUPT_NOT_HANDLED;
181 
182 
183  ACPI_FUNCTION_TRACE (EvGpeXruptHandler);
184 
185 
186  /*
187  * We are guaranteed by the ACPICA initialization/shutdown code that
188  * if this interrupt handler is installed, ACPI is enabled.
189  */
190 
191  /* GPEs: Check for and dispatch any GPEs that have occurred */
192 
193  InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
194  return_UINT32 (InterruptHandled);
195 }
#define return_UINT32(s)
Definition: acoutput.h:501
unsigned int UINT32
#define ACPI_INTERRUPT_NOT_HANDLED
Definition: actypes.h:1240
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
struct tagContext Context
Definition: acpixf.h:1034
UINT32 AcpiEvGpeDetect(ACPI_GPE_XRUPT_INFO *GpeXruptList)
Definition: evgpe.c:433

Referenced by AcpiEvDeleteGpeXrupt(), and AcpiEvGetGpeXruptBlock().

◆ AcpiEvInstallSciHandler()

UINT32 AcpiEvInstallSciHandler ( void  )

Definition at line 211 of file evsci.c.

213 {
214  UINT32 Status = AE_OK;
215 
216 
217  ACPI_FUNCTION_TRACE (EvInstallSciHandler);
218 
219 
220  Status = AcpiOsInstallInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
221  AcpiEvSciXruptHandler, AcpiGbl_GpeXruptListHead);
223 }
static UINT32 ACPI_SYSTEM_XFACE AcpiEvSciXruptHandler(void *Context)
Definition: evsci.c:127
unsigned int UINT32
ACPI_STATUS AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine, void *Context)
Definition: osl.c:548
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInstallXruptHandlers().

◆ AcpiEvRemoveAllSciHandlers()

ACPI_STATUS AcpiEvRemoveAllSciHandlers ( void  )

Definition at line 246 of file evsci.c.

248 {
249  ACPI_SCI_HANDLER_INFO *SciHandler;
252 
253 
254  ACPI_FUNCTION_TRACE (EvRemoveAllSciHandlers);
255 
256 
257  /* Just let the OS remove the handler and disable the level */
258 
259  Status = AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
261 
262  if (!AcpiGbl_SciHandlerList)
263  {
264  return (Status);
265  }
266 
267  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
268 
269  /* Free all host-installed SCI handlers */
270 
271  while (AcpiGbl_SciHandlerList)
272  {
273  SciHandler = AcpiGbl_SciHandlerList;
274  AcpiGbl_SciHandlerList = SciHandler->Next;
275  ACPI_FREE (SciHandler);
276  }
277 
278  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
280 }
#define ACPI_FREE(a)
Definition: actypes.h:386
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
static UINT32 ACPI_SYSTEM_XFACE AcpiEvSciXruptHandler(void *Context)
Definition: evsci.c:127
ACPI_STATUS AcpiOsRemoveInterruptHandler(UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine)
Definition: osl.c:606
#define ACPI_CPU_FLAGS
Definition: actypes.h:252
UINT32 ACPI_STATUS
Definition: actypes.h:460
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
unsigned int UINT32
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
struct acpi_sci_handler_info * Next
Definition: aclocal.h:509

Referenced by AcpiEvTerminate().

◆ AcpiEvSciDispatch()

UINT32 AcpiEvSciDispatch ( void  )

Definition at line 75 of file evsci.c.

77 {
78  ACPI_SCI_HANDLER_INFO *SciHandler;
81 
82 
83  ACPI_FUNCTION_NAME (EvSciDispatch);
84 
85 
86  /* Are there any host-installed SCI handlers? */
87 
88  if (!AcpiGbl_SciHandlerList)
89  {
90  return (IntStatus);
91  }
92 
93  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
94 
95  /* Invoke all host-installed SCI handlers */
96 
97  SciHandler = AcpiGbl_SciHandlerList;
98  while (SciHandler)
99  {
100  /* Invoke the installed handler (at interrupt level) */
101 
102  IntStatus |= SciHandler->Address (
103  SciHandler->Context);
104 
105  SciHandler = SciHandler->Next;
106  }
107 
108  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
109  return (IntStatus);
110 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define ACPI_CPU_FLAGS
Definition: actypes.h:252
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
unsigned int UINT32
ACPI_SCI_HANDLER Address
Definition: aclocal.h:510
#define ACPI_INTERRUPT_NOT_HANDLED
Definition: actypes.h:1240
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
struct acpi_sci_handler_info * Next
Definition: aclocal.h:509

Referenced by AcpiEvSciXruptHandler().

◆ AcpiEvSciXruptHandler()

static UINT32 ACPI_SYSTEM_XFACE AcpiEvSciXruptHandler ( void Context)
static

Definition at line 127 of file evsci.c.

129 {
130  ACPI_GPE_XRUPT_INFO *GpeXruptList = Context;
131  UINT32 InterruptHandled = ACPI_INTERRUPT_NOT_HANDLED;
132 
133 
134  ACPI_FUNCTION_TRACE (EvSciXruptHandler);
135 
136 
137  /*
138  * We are guaranteed by the ACPICA initialization/shutdown code that
139  * if this interrupt handler is installed, ACPI is enabled.
140  */
141 
142  /*
143  * Fixed Events:
144  * Check for and dispatch any Fixed Events that have occurred
145  */
146  InterruptHandled |= AcpiEvFixedEventDetect ();
147 
148  /*
149  * General Purpose Events:
150  * Check for and dispatch any GPEs that have occurred
151  */
152  InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
153 
154  /* Invoke all host-installed SCI handlers */
155 
156  InterruptHandled |= AcpiEvSciDispatch ();
157 
158  AcpiSciCount++;
159  return_UINT32 (InterruptHandled);
160 }
#define return_UINT32(s)
Definition: acoutput.h:501
UINT32 AcpiEvFixedEventDetect(void)
Definition: evevent.c:232
unsigned int UINT32
#define ACPI_INTERRUPT_NOT_HANDLED
Definition: actypes.h:1240
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
struct tagContext Context
Definition: acpixf.h:1034
UINT32 AcpiEvGpeDetect(ACPI_GPE_XRUPT_INFO *GpeXruptList)
Definition: evgpe.c:433
UINT32 AcpiEvSciDispatch(void)
Definition: evsci.c:75

Referenced by AcpiEvInstallSciHandler(), and AcpiEvRemoveAllSciHandlers().