ReactOS  0.4.14-dev-376-gaedba84
evevent.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
Include dependency graph for evevent.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_EVENTS
 

Functions

static ACPI_STATUS AcpiEvFixedEventInitialize (void)
 
static UINT32 AcpiEvFixedEventDispatch (UINT32 Event)
 
ACPI_STATUS AcpiEvInitializeEvents (void)
 
ACPI_STATUS AcpiEvInstallXruptHandlers (void)
 
UINT32 AcpiEvFixedEventDetect (void)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EVENTS

Definition at line 48 of file evevent.c.

Function Documentation

◆ AcpiEvFixedEventDetect()

UINT32 AcpiEvFixedEventDetect ( void  )

Definition at line 232 of file evevent.c.

234 {
236  UINT32 FixedStatus;
237  UINT32 FixedEnable;
238  UINT32 i;
240 
241 
242  ACPI_FUNCTION_NAME (EvFixedEventDetect);
243 
244 
245  /*
246  * Read the fixed feature status and enable registers, as all the cases
247  * depend on their values. Ignore errors here.
248  */
251  if (ACPI_FAILURE (Status))
252  {
253  return (IntStatus);
254  }
255 
257  "Fixed Event Block: Enable %08X Status %08X\n",
258  FixedEnable, FixedStatus));
259 
260  /*
261  * Check for all possible Fixed Events and dispatch those that are active
262  */
263  for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
264  {
265  /* Both the status and enable bits must be on for this event */
266 
267  if ((FixedStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) &&
268  (FixedEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask))
269  {
270  /*
271  * Found an active (signalled) event. Invoke global event
272  * handler if present.
273  */
274  AcpiFixedEventCount[i]++;
275  if (AcpiGbl_GlobalEventHandler)
276  {
277  AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_FIXED, NULL,
278  i, AcpiGbl_GlobalEventHandlerContext);
279  }
280 
281  IntStatus |= AcpiEvFixedEventDispatch (i);
282  }
283  }
284 
285  return (IntStatus);
286 }
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_DB_INTERRUPTS
Definition: acoutput.h:178
ACPI_STATUS AcpiHwRegisterRead(UINT32 RegisterId, UINT32 *ReturnValue)
Definition: hwregs.c:574
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
static UINT32 AcpiEvFixedEventDispatch(UINT32 Event)
Definition: evevent.c:305
#define ACPI_REGISTER_PM1_STATUS
Definition: aclocal.h:1184
ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]
Definition: utglobal.c:175
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_NUM_FIXED_EVENTS
Definition: actypes.h:760
#define ACPI_INTERRUPT_NOT_HANDLED
Definition: actypes.h:1238
Status
Definition: gdiplustypes.h:24
#define ACPI_EVENT_TYPE_FIXED
Definition: actypes.h:1133
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
#define ACPI_REGISTER_PM1_ENABLE
Definition: aclocal.h:1185

Referenced by AcpiEvSciXruptHandler().

◆ AcpiEvFixedEventDispatch()

static UINT32 AcpiEvFixedEventDispatch ( UINT32  Event)
static

Definition at line 305 of file evevent.c.

307 {
308 
310 
311 
312  /* Clear the status bit */
313 
315  AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
317 
318  /*
319  * Make sure that a handler exists. If not, report an error
320  * and disable the event to prevent further interrupts.
321  */
322  if (!AcpiGbl_FixedEventHandlers[Event].Handler)
323  {
325  AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
327 
329  "No installed handler for fixed event - %s (%u), disabling",
331 
333  }
334 
335  /* Invoke the Fixed Event handler */
336 
337  return ((AcpiGbl_FixedEventHandlers[Event].Handler)(
338  AcpiGbl_FixedEventHandlers[Event].Context));
339 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiWriteBitRegister(UINT32 RegisterId, UINT32 Value)
Definition: hwxface.c:282
#define ACPI_CLEAR_STATUS
Definition: actypes.h:928
const char * AcpiUtGetEventName(UINT32 EventId)
Definition: utdecode.c:174
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]
Definition: utglobal.c:175
#define ACPI_INTERRUPT_NOT_HANDLED
Definition: actypes.h:1238
#define ACPI_DISABLE_EVENT
Definition: actypes.h:933
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical 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:668
#define ACPI_ERROR(plist)
Definition: acoutput.h:240

Referenced by AcpiEvFixedEventDetect().

◆ AcpiEvFixedEventInitialize()

static ACPI_STATUS AcpiEvFixedEventInitialize ( void  )
static

Definition at line 185 of file evevent.c.

187 {
188  UINT32 i;
190 
191 
192  /*
193  * Initialize the structure that keeps track of fixed event handlers and
194  * enable the fixed events.
195  */
196  for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
197  {
198  AcpiGbl_FixedEventHandlers[i].Handler = NULL;
199  AcpiGbl_FixedEventHandlers[i].Context = NULL;
200 
201  /* Disable the fixed event */
202 
203  if (AcpiGbl_FixedEventInfo[i].EnableRegisterId != 0xFF)
204  {
206  AcpiGbl_FixedEventInfo[i].EnableRegisterId,
208  if (ACPI_FAILURE (Status))
209  {
210  return (Status);
211  }
212  }
213  }
214 
215  return (AE_OK);
216 }
ACPI_STATUS AcpiWriteBitRegister(UINT32 RegisterId, UINT32 Value)
Definition: hwxface.c:282
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]
Definition: utglobal.c:175
#define ACPI_NUM_FIXED_EVENTS
Definition: actypes.h:760
#define ACPI_DISABLE_EVENT
Definition: actypes.h:933
Status
Definition: gdiplustypes.h:24
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInitializeEvents().

◆ AcpiEvInitializeEvents()

ACPI_STATUS AcpiEvInitializeEvents ( void  )

Definition at line 77 of file evevent.c.

79 {
81 
82 
83  ACPI_FUNCTION_TRACE (EvInitializeEvents);
84 
85 
86  /* If Hardware Reduced flag is set, there are no fixed events */
87 
88  if (AcpiGbl_ReducedHardware)
89  {
91  }
92 
93  /*
94  * Initialize the Fixed and General Purpose Events. This is done prior to
95  * enabling SCIs to prevent interrupts from occurring before the handlers
96  * are installed.
97  */
99  if (ACPI_FAILURE (Status))
100  {
102  "Unable to initialize fixed events"));
104  }
105 
107  if (ACPI_FAILURE (Status))
108  {
110  "Unable to initialize general purpose events"));
112  }
113 
115 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
ACPI_STATUS AcpiEvGpeInitialize(void)
Definition: evgpeinit.c:84
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_INFO
Definition: acoutput.h:230
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
static ACPI_STATUS AcpiEvFixedEventInitialize(void)
Definition: evevent.c:185

Referenced by AcpiEnableSubsystem().

◆ AcpiEvInstallXruptHandlers()

ACPI_STATUS AcpiEvInstallXruptHandlers ( void  )

Definition at line 131 of file evevent.c.

133 {
135 
136 
137  ACPI_FUNCTION_TRACE (EvInstallXruptHandlers);
138 
139 
140  /* If Hardware Reduced flag is set, there is no ACPI h/w */
141 
142  if (AcpiGbl_ReducedHardware)
143  {
145  }
146 
147  /* Install the SCI handler */
148 
150  if (ACPI_FAILURE (Status))
151  {
153  "Unable to install System Control Interrupt handler"));
155  }
156 
157  /* Install the handler for the Global Lock */
158 
160  if (ACPI_FAILURE (Status))
161  {
163  "Unable to initialize Global Lock handler"));
165  }
166 
167  AcpiGbl_EventsInitialized = TRUE;
169 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define TRUE
Definition: types.h:120
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiEvInitGlobalLockHandler(void)
Definition: evglock.c:74
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_INFO
Definition: acoutput.h:230
UINT32 AcpiEvInstallSciHandler(void)
Definition: evsci.c:211
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 AcpiEnableSubsystem().