ReactOS  0.4.14-dev-49-gfb4591c
acevents.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__)   FALSE
 

Functions

ACPI_STATUS AcpiEvInitializeEvents (void)
 
ACPI_STATUS AcpiEvInstallXruptHandlers (void)
 
UINT32 AcpiEvFixedEventDetect (void)
 
BOOLEAN AcpiEvIsNotifyObject (ACPI_NAMESPACE_NODE *Node)
 
UINT32 AcpiEvGetGpeNumberIndex (UINT32 GpeNumber)
 
ACPI_STATUS AcpiEvQueueNotifyRequest (ACPI_NAMESPACE_NODE *Node, UINT32 NotifyValue)
 
ACPI_STATUS AcpiEvInitGlobalLockHandler (void)
 
 ACPI_HW_DEPENDENT_RETURN_OK (ACPI_STATUS AcpiEvAcquireGlobalLock(UINT16 Timeout)) ACPI_HW_DEPENDENT_RETURN_OK(ACPI_STATUS AcpiEvReleaseGlobalLock(void)) ACPI_STATUS AcpiEvRemoveGlobalLockHandler(void)
 
UINT32 AcpiEvGpeDetect (ACPI_GPE_XRUPT_INFO *GpeXruptList)
 
ACPI_STATUS AcpiEvUpdateGpeEnableMask (ACPI_GPE_EVENT_INFO *GpeEventInfo)
 
ACPI_STATUS AcpiEvEnableGpe (ACPI_GPE_EVENT_INFO *GpeEventInfo)
 
ACPI_STATUS AcpiEvMaskGpe (ACPI_GPE_EVENT_INFO *GpeEventInfo, BOOLEAN IsMasked)
 
ACPI_STATUS AcpiEvAddGpeReference (ACPI_GPE_EVENT_INFO *GpeEventInfo, BOOLEAN ClearOnEnable)
 
ACPI_STATUS AcpiEvRemoveGpeReference (ACPI_GPE_EVENT_INFO *GpeEventInfo)
 
ACPI_GPE_EVENT_INFOAcpiEvGetGpeEventInfo (ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_GPE_EVENT_INFOAcpiEvLowGetGpeInfo (UINT32 GpeNumber, ACPI_GPE_BLOCK_INFO *GpeBlock)
 
ACPI_STATUS AcpiEvFinishGpe (ACPI_GPE_EVENT_INFO *GpeEventInfo)
 
UINT32 AcpiEvDetectGpe (ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber)
 
ACPI_STATUS AcpiEvCreateGpeBlock (ACPI_NAMESPACE_NODE *GpeDevice, UINT64 Address, UINT8 SpaceId, UINT32 RegisterCount, UINT16 GpeBlockBaseNumber, UINT32 InterruptNumber, ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
 
ACPI_STATUS AcpiEvInitializeGpeBlock (ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
 
 ACPI_HW_DEPENDENT_RETURN_OK (ACPI_STATUS AcpiEvDeleteGpeBlock(ACPI_GPE_BLOCK_INFO *GpeBlock)) UINT32 AcpiEvGpeDispatch(ACPI_NAMESPACE_NODE *GpeDevice
 
ACPI_STATUS AcpiEvGpeInitialize (void)
 
 ACPI_HW_DEPENDENT_RETURN_VOID (void AcpiEvUpdateGpes(ACPI_OWNER_ID TableOwnerId)) ACPI_STATUS AcpiEvMatchGpeMethod(ACPI_HANDLE ObjHandle
 
ACPI_STATUS AcpiEvWalkGpeList (ACPI_GPE_CALLBACK GpeWalkCallback, void *Context)
 
ACPI_STATUS AcpiEvGetGpeDevice (ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
 
ACPI_STATUS AcpiEvGetGpeXruptBlock (UINT32 InterruptNumber, ACPI_GPE_XRUPT_INFO **GpeXruptBlock)
 
ACPI_STATUS AcpiEvDeleteGpeXrupt (ACPI_GPE_XRUPT_INFO *GpeXrupt)
 
ACPI_STATUS AcpiEvDeleteGpeHandlers (ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
 
ACPI_OPERAND_OBJECTAcpiEvFindRegionHandler (ACPI_ADR_SPACE_TYPE SpaceId, ACPI_OPERAND_OBJECT *HandlerObj)
 
BOOLEAN AcpiEvHasDefaultHandler (ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId)
 
ACPI_STATUS AcpiEvInstallRegionHandlers (void)
 
ACPI_STATUS AcpiEvInstallSpaceHandler (ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId, ACPI_ADR_SPACE_HANDLER Handler, ACPI_ADR_SPACE_SETUP Setup, void *Context)
 
ACPI_STATUS AcpiEvInitializeOpRegions (void)
 
ACPI_STATUS AcpiEvAddressSpaceDispatch (ACPI_OPERAND_OBJECT *RegionObj, ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, UINT64 *Value)
 
ACPI_STATUS AcpiEvAttachRegion (ACPI_OPERAND_OBJECT *HandlerObj, ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked)
 
void AcpiEvDetachRegion (ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked)
 
void AcpiEvExecuteRegMethods (ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId, UINT32 Function)
 
ACPI_STATUS AcpiEvExecuteRegMethod (ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function)
 
ACPI_STATUS AcpiEvSystemMemoryRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvIoSpaceRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvPciConfigRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvCmosRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvPciBarRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvDefaultRegionSetup (ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
 
ACPI_STATUS AcpiEvInitializeRegion (ACPI_OPERAND_OBJECT *RegionObj)
 
BOOLEAN AcpiEvIsPciRootBridge (ACPI_NAMESPACE_NODE *Node)
 
UINT32 ACPI_SYSTEM_XFACE AcpiEvGpeXruptHandler (void *Context)
 
UINT32 AcpiEvSciDispatch (void)
 
UINT32 AcpiEvInstallSciHandler (void)
 
ACPI_STATUS AcpiEvRemoveAllSciHandlers (void)
 

Variables

ACPI_GPE_EVENT_INFOGpeEventInfo
 
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
 
UINT32 Level
 
UINT32 voidContext
 
UINT32 void void ** ReturnValue
 

Macro Definition Documentation

◆ ACPI_GPE_IS_POLLING_NEEDED

#define ACPI_GPE_IS_POLLING_NEEDED (   __gpe__)    FALSE

Definition at line 59 of file acevents.h.

Function Documentation

◆ ACPI_HW_DEPENDENT_RETURN_OK() [1/2]

ACPI_HW_DEPENDENT_RETURN_OK ( ACPI_STATUS   AcpiEvAcquireGlobalLockUINT16 Timeout)

◆ ACPI_HW_DEPENDENT_RETURN_OK() [2/2]

ACPI_HW_DEPENDENT_RETURN_OK ( ACPI_STATUS   AcpiEvDeleteGpeBlock ACPI_GPE_BLOCK_INFO *GpeBlock)

◆ ACPI_HW_DEPENDENT_RETURN_VOID()

ACPI_HW_DEPENDENT_RETURN_VOID ( void   AcpiEvUpdateGpes ACPI_OWNER_ID TableOwnerId)

◆ AcpiEvAddGpeReference()

ACPI_STATUS AcpiEvAddGpeReference ( ACPI_GPE_EVENT_INFO GpeEventInfo,
BOOLEAN  ClearOnEnable 
)

Definition at line 221 of file evgpe.c.

224 {
226 
227 
228  ACPI_FUNCTION_TRACE (EvAddGpeReference);
229 
230 
232  {
234  }
235 
237  if (GpeEventInfo->RuntimeCount == 1)
238  {
239  /* Enable on first reference */
240 
241  if (ClearOnEnable)
242  {
244  }
245 
247  if (ACPI_SUCCESS (Status))
248  {
250  }
251 
252  if (ACPI_FAILURE (Status))
253  {
255  }
256  }
257 
259 }
#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
ACPI_STATUS AcpiEvUpdateGpeEnableMask(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:79
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AE_LIMIT
Definition: acexcep.h:124
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define ACPI_UINT8_MAX
Definition: actypes.h:64
ACPI_STATUS AcpiEvEnableGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:126
ACPI_STATUS AcpiHwClearGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: hwgpe.c:190
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 AcpiEnableGpe(), AcpiEvInitializeGpeBlock(), and AcpiRemoveGpeHandler().

◆ AcpiEvAddressSpaceDispatch()

ACPI_STATUS AcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT RegionObj,
ACPI_OPERAND_OBJECT FieldObj,
UINT32  Function,
UINT32  RegionOffset,
UINT32  BitWidth,
UINT64 Value 
)

Definition at line 148 of file evregion.c.

155 {
158  ACPI_ADR_SPACE_SETUP RegionSetup;
159  ACPI_OPERAND_OBJECT *HandlerDesc;
160  ACPI_OPERAND_OBJECT *RegionObj2;
161  void *RegionContext = NULL;
163  ACPI_PHYSICAL_ADDRESS Address;
164 
165 
166  ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
167 
168 
169  RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
170  if (!RegionObj2)
171  {
173  }
174 
175  /* Ensure that there is a handler associated with this region */
176 
177  HandlerDesc = RegionObj->Region.Handler;
178  if (!HandlerDesc)
179  {
181  "No handler for Region [%4.4s] (%p) [%s]",
182  AcpiUtGetNodeName (RegionObj->Region.Node),
183  RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
184 
186  }
187 
188  Context = HandlerDesc->AddressSpace.Context;
189 
190  /*
191  * It may be the case that the region has never been initialized.
192  * Some types of regions require special init code
193  */
194  if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE))
195  {
196  /* This region has not been initialized yet, do it */
197 
198  RegionSetup = HandlerDesc->AddressSpace.Setup;
199  if (!RegionSetup)
200  {
201  /* No initialization routine, exit with error */
202 
204  "No init routine for region(%p) [%s]",
205  RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
207  }
208 
209  /*
210  * We must exit the interpreter because the region setup will
211  * potentially execute control methods (for example, the _REG method
212  * for this region)
213  */
215 
216  Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE,
217  Context, &RegionContext);
218 
219  /* Re-enter the interpreter */
220 
222 
223  /* Check for failure of the Region Setup */
224 
225  if (ACPI_FAILURE (Status))
226  {
228  "During region initialization: [%s]",
229  AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
231  }
232 
233  /* Region initialization may have been completed by RegionSetup */
234 
235  if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE))
236  {
237  RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE;
238 
239  /*
240  * Save the returned context for use in all accesses to
241  * the handler for this particular region
242  */
243  if (!(RegionObj2->Extra.RegionContext))
244  {
245  RegionObj2->Extra.RegionContext = RegionContext;
246  }
247  }
248  }
249 
250  /* We have everything we need, we can invoke the address space handler */
251 
252  Handler = HandlerDesc->AddressSpace.Handler;
253  Address = (RegionObj->Region.Address + RegionOffset);
254 
255  /*
256  * Special handling for GenericSerialBus and GeneralPurposeIo:
257  * There are three extra parameters that must be passed to the
258  * handler via the context:
259  * 1) Connection buffer, a resource template from Connection() op
260  * 2) Length of the above buffer
261  * 3) Actual access length from the AccessAs() op
262  *
263  * In addition, for GeneralPurposeIo, the Address and BitWidth fields
264  * are defined as follows:
265  * 1) Address is the pin number index of the field (bit offset from
266  * the previous Connection)
267  * 2) BitWidth is the actual bit length of the field (number of pins)
268  */
269  if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) &&
270  Context &&
271  FieldObj)
272  {
273  /* Get the Connection (ResourceTemplate) buffer */
274 
275  Context->Connection = FieldObj->Field.ResourceBuffer;
276  Context->Length = FieldObj->Field.ResourceLength;
277  Context->AccessLength = FieldObj->Field.AccessLength;
278  }
279  if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) &&
280  Context &&
281  FieldObj)
282  {
283  /* Get the Connection (ResourceTemplate) buffer */
284 
285  Context->Connection = FieldObj->Field.ResourceBuffer;
286  Context->Length = FieldObj->Field.ResourceLength;
287  Context->AccessLength = FieldObj->Field.AccessLength;
288  Address = FieldObj->Field.PinNumberIndex;
289  BitWidth = FieldObj->Field.BitLength;
290  }
291 
293  "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
294  &RegionObj->Region.Handler->AddressSpace, Handler,
296  AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
297 
298  if (!(HandlerDesc->AddressSpace.HandlerFlags &
300  {
301  /*
302  * For handlers other than the default (supplied) handlers, we must
303  * exit the interpreter because the handler *might* block -- we don't
304  * know what it will do, so we can't hold the lock on the interpreter.
305  */
307  }
308 
309  /* Call the handler */
310 
311  Status = Handler (Function, Address, BitWidth, Value, Context,
312  RegionObj2->Extra.RegionContext);
313 
314  if (ACPI_FAILURE (Status))
315  {
316  ACPI_EXCEPTION ((AE_INFO, Status, "Returned by Handler for [%s]",
317  AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
318 
319  /*
320  * Special case for an EC timeout. These are seen so frequently
321  * that an additional error message is helpful
322  */
323  if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
324  (Status == AE_TIME))
325  {
327  "Timeout from EC hardware or EC device driver"));
328  }
329  }
330 
331  if (!(HandlerDesc->AddressSpace.HandlerFlags &
333  {
334  /*
335  * We just returned from a non-default handler, we must re-enter the
336  * interpreter
337  */
339  }
340 
342 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
union acpi_operand_object * Handler
Definition: acobject.h:204
ACPI_STATUS(* ACPI_ADR_SPACE_SETUP)(ACPI_HANDLE RegionHandle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: actypes.h:1214
ACPI_STATUS(* ACPI_ADR_SPACE_HANDLER)(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: actypes.h:1192
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
#define ACPI_ADR_SPACE_GPIO
Definition: actypes.h:859
ACPI_ADR_SPACE_SETUP Setup
Definition: acobject.h:415
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AE_TIME
Definition: acexcep.h:125
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
Definition: acobject.h:423
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_OBJECT_EXTRA Extra
Definition: acobject.h:538
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:124
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
#define AOPOBJ_SETUP_COMPLETE
Definition: acobject.h:99
#define AE_INFO
Definition: acoutput.h:230
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
ACPI_ADR_SPACE_HANDLER Handler
Definition: acobject.h:412
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
#define ACPI_ADR_SPACE_EC
Definition: actypes.h:854
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_ADR_SPACE_GSBUS
Definition: actypes.h:860
#define AE_NOT_EXIST
Definition: acexcep.h:114
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:536
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:662
Status
Definition: gdiplustypes.h:24
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
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
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO UINT16 ResourceLength
Definition: acobject.h:344
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
ACPI_OBJECT_REGION_FIELD Field
Definition: acobject.h:531
ACPI_PHYSICAL_ADDRESS Address
Definition: acobject.h:206
struct tagContext Context
Definition: acpixf.h:1024
#define ACPI_REGION_ACTIVATE
Definition: actypes.h:1220
void * RegionContext
Definition: acobject.h:480
ACPI_OPERAND_OBJECT * AcpiNsGetSecondaryObject(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: nsobject.c:346

Referenced by AcpiExAccessRegion(), and AcpiExRegionRead().

◆ AcpiEvAttachRegion()

ACPI_STATUS AcpiEvAttachRegion ( ACPI_OPERAND_OBJECT HandlerObj,
ACPI_OPERAND_OBJECT RegionObj,
BOOLEAN  AcpiNsIsLocked 
)

Definition at line 530 of file evregion.c.

534 {
535 
536  ACPI_FUNCTION_TRACE (EvAttachRegion);
537 
538 
539  /* Install the region's handler */
540 
541  if (RegionObj->Region.Handler)
542  {
544  }
545 
547  "Adding Region [%4.4s] %p to address handler %p [%s]\n",
548  AcpiUtGetNodeName (RegionObj->Region.Node),
549  RegionObj, HandlerObj,
550  AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
551 
552  /* Link this region to the front of the handler's list */
553 
554  RegionObj->Region.Next = HandlerObj->AddressSpace.RegionList;
555  HandlerObj->AddressSpace.RegionList = RegionObj;
556  RegionObj->Region.Handler = HandlerObj;
557  AcpiUtAddReference (HandlerObj);
558 
560 }
void AcpiUtAddReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:746
union acpi_operand_object * Handler
Definition: acobject.h:204
union acpi_operand_object * Next
Definition: acobject.h:205
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
union acpi_operand_object * RegionList
Definition: acobject.h:416
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:124
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:536
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInitializeRegion(), and AcpiEvInstallHandler().

◆ AcpiEvCmosRegionSetup()

ACPI_STATUS AcpiEvCmosRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 479 of file evrgnini.c.

484 {
485  ACPI_FUNCTION_TRACE (EvCmosRegionSetup);
486 
487 
489 }
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvCreateGpeBlock()

ACPI_STATUS AcpiEvCreateGpeBlock ( ACPI_NAMESPACE_NODE GpeDevice,
UINT64  Address,
UINT8  SpaceId,
UINT32  RegisterCount,
UINT16  GpeBlockBaseNumber,
UINT32  InterruptNumber,
ACPI_GPE_BLOCK_INFO **  ReturnGpeBlock 
)

Definition at line 367 of file evgpeblk.c.

375 {
377  ACPI_GPE_BLOCK_INFO *GpeBlock;
378  ACPI_GPE_WALK_INFO WalkInfo;
379 
380 
381  ACPI_FUNCTION_TRACE (EvCreateGpeBlock);
382 
383 
384  if (!RegisterCount)
385  {
387  }
388 
389  /* Allocate a new GPE block */
390 
391  GpeBlock = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_BLOCK_INFO));
392  if (!GpeBlock)
393  {
395  }
396 
397  /* Initialize the new GPE block */
398 
399  GpeBlock->Address = Address;
400  GpeBlock->SpaceId = SpaceId;
401  GpeBlock->Node = GpeDevice;
402  GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
403  GpeBlock->Initialized = FALSE;
404  GpeBlock->RegisterCount = RegisterCount;
405  GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
406 
407  /*
408  * Create the RegisterInfo and EventInfo sub-structures
409  * Note: disables and clears all GPEs in the block
410  */
411  Status = AcpiEvCreateGpeInfoBlocks (GpeBlock);
412  if (ACPI_FAILURE (Status))
413  {
414  ACPI_FREE (GpeBlock);
416  }
417 
418  /* Install the new block in the global lists */
419 
420  Status = AcpiEvInstallGpeBlock (GpeBlock, InterruptNumber);
421  if (ACPI_FAILURE (Status))
422  {
423  ACPI_FREE (GpeBlock->RegisterInfo);
424  ACPI_FREE (GpeBlock->EventInfo);
425  ACPI_FREE (GpeBlock);
427  }
428 
429  AcpiGbl_AllGpesInitialized = FALSE;
430 
431  /* Find all GPE methods (_Lxx or_Exx) for this block */
432 
433  WalkInfo.GpeBlock = GpeBlock;
434  WalkInfo.GpeDevice = GpeDevice;
435  WalkInfo.ExecuteByOwnerId = FALSE;
436 
439  AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);
440 
441  /* Return the new block */
442 
443  if (ReturnGpeBlock)
444  {
445  (*ReturnGpeBlock) = GpeBlock;
446  }
447 
449  " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
450  (UINT32) GpeBlock->BlockBaseNumber,
451  (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
452  GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
453  InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
454 
455  /* Update global count of currently available GPEs */
456 
457  AcpiCurrentGpeCount += GpeBlock->GpeCount;
459 }
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
#define AE_NO_MEMORY
Definition: acexcep.h:112
char Ascii[4]
Definition: actbl.h:394
ACPI_GPE_BLOCK_INFO * GpeBlock
Definition: aclocal.h:612
#define ACPI_NS_WALK_NO_UNLOCK
Definition: acnamesp.h:76
UINT32 ACPI_STATUS
Definition: actypes.h:460
static ACPI_STATUS AcpiEvCreateGpeInfoBlocks(ACPI_GPE_BLOCK_INFO *GpeBlock)
Definition: evgpeblk.c:227
ACPI_STATUS AcpiNsWalkNamespace(ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, ACPI_WALK_CALLBACK DescendingCallback, ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue)
Definition: nswalk.c:190
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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 void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:822
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
ACPI_NAME_UNION Name
Definition: aclocal.h:191
ACPI_NAMESPACE_NODE * GpeDevice
Definition: aclocal.h:611
static ACPI_STATUS AcpiEvInstallGpeBlock(ACPI_GPE_BLOCK_INFO *GpeBlock, UINT32 InterruptNumber)
Definition: evgpeblk.c:81
#define ACPI_TYPE_METHOD
Definition: actypes.h:686
BOOLEAN ExecuteByOwnerId
Definition: aclocal.h:615
#define ACPI_UINT32_MAX
Definition: actypes.h:66
ACPI_GPE_REGISTER_INFO * RegisterInfo
Definition: aclocal.h:587
UINT32 RegisterCount
Definition: aclocal.h:590
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_INIT
Definition: acoutput.h:151
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
unsigned short UINT16
BOOLEAN Initialized
Definition: aclocal.h:594
ACPI_STATUS AcpiEvMatchGpeMethod(ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue)
Definition: evgpeinit.c:330
#define ACPI_GPE_REGISTER_WIDTH
Definition: actypes.h:407
#define AE_OK
Definition: acexcep.h:97
ACPI_GPE_EVENT_INFO * EventInfo
Definition: aclocal.h:588
ACPI_NAMESPACE_NODE * Node
Definition: aclocal.h:583
UINT16 BlockBaseNumber
Definition: aclocal.h:592

Referenced by AcpiEvGpeInitialize(), and AcpiInstallGpeBlock().

◆ AcpiEvDefaultRegionSetup()

ACPI_STATUS AcpiEvDefaultRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 508 of file evrgnini.c.

513 {
514  ACPI_FUNCTION_TRACE (EvDefaultRegionSetup);
515 
516 
518  {
519  *RegionContext = NULL;
520  }
521  else
522  {
523  *RegionContext = HandlerContext;
524  }
525 
527 }
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1221
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
smooth NULL
Definition: ftsmooth.c:416
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvDeleteGpeHandlers()

ACPI_STATUS AcpiEvDeleteGpeHandlers ( ACPI_GPE_XRUPT_INFO GpeXruptInfo,
ACPI_GPE_BLOCK_INFO GpeBlock,
void Context 
)

Definition at line 339 of file evgpeutil.c.

343 {
346  ACPI_GPE_NOTIFY_INFO *Next;
347  UINT32 i;
348  UINT32 j;
349 
350 
351  ACPI_FUNCTION_TRACE (EvDeleteGpeHandlers);
352 
353 
354  /* Examine each GPE Register within the block */
355 
356  for (i = 0; i < GpeBlock->RegisterCount; i++)
357  {
358  /* Now look at the individual GPEs in this byte register */
359 
360  for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
361  {
362  GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
364 
369  {
370  /* Delete an installed handler block */
371 
375  }
378  {
379  /* Delete the implicit notification device list */
380 
382  while (Notify)
383  {
384  Next = Notify->Next;
385  ACPI_FREE (Notify);
386  Notify = Next;
387  }
388 
391  }
392  }
393  }
394 
396 }
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
ACPI_GPE_NOTIFY_INFO * NotifyList
Definition: aclocal.h:544
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_GPE_DISPATCH_TYPE(flags)
Definition: actypes.h:815
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
#define ACPI_GPE_DISPATCH_RAW_HANDLER
Definition: actypes.h:813
ACPI_GPE_HANDLER_INFO * Handler
Definition: aclocal.h:543
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
#define ACPI_GPE_DISPATCH_NOTIFY
Definition: actypes.h:812
unsigned int UINT32
union acpi_gpe_dispatch_info Dispatch
Definition: aclocal.h:554
#define ACPI_GPE_DISPATCH_HANDLER
Definition: actypes.h:811
smooth NULL
Definition: ftsmooth.c:416
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 GLint GLint j
Definition: glfuncs.h:250
#define ACPI_GPE_DISPATCH_MASK
Definition: actypes.h:814
UINT32 RegisterCount
Definition: aclocal.h:590
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_GPE_REGISTER_WIDTH
Definition: actypes.h:407
#define AE_OK
Definition: acexcep.h:97
ACPI_GPE_EVENT_INFO * EventInfo
Definition: aclocal.h:588

Referenced by AcpiEvTerminate().

◆ AcpiEvDeleteGpeXrupt()

ACPI_STATUS AcpiEvDeleteGpeXrupt ( ACPI_GPE_XRUPT_INFO GpeXrupt)

Definition at line 270 of file evgpeutil.c.

272 {
275 
276 
277  ACPI_FUNCTION_TRACE (EvDeleteGpeXrupt);
278 
279 
280  /* We never want to remove the SCI interrupt handler */
281 
282  if (GpeXrupt->InterruptNumber == AcpiGbl_FADT.SciInterrupt)
283  {
284  GpeXrupt->GpeBlockListHead = NULL;
286  }
287 
288  /* Disable this interrupt */
289 
292  if (ACPI_FAILURE (Status))
293  {
295  }
296 
297  /* Unlink the interrupt block with lock */
298 
299  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
300  if (GpeXrupt->Previous)
301  {
302  GpeXrupt->Previous->Next = GpeXrupt->Next;
303  }
304  else
305  {
306  /* No previous, update list head */
307 
308  AcpiGbl_GpeXruptListHead = GpeXrupt->Next;
309  }
310 
311  if (GpeXrupt->Next)
312  {
313  GpeXrupt->Next->Previous = GpeXrupt->Previous;
314  }
315  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
316 
317  /* Free the block */
318 
319  ACPI_FREE (GpeXrupt);
321 }
#define ACPI_FREE(a)
Definition: actypes.h:386
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
ACPI_STATUS AcpiOsRemoveInterruptHandler(UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine)
Definition: osl.c:606
struct acpi_gpe_xrupt_info * Next
Definition: aclocal.h:603
#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
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
UINT32 ACPI_SYSTEM_XFACE AcpiEvGpeXruptHandler(void *Context)
Definition: evsci.c:176
smooth NULL
Definition: ftsmooth.c:416
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
ACPI_GPE_BLOCK_INFO * GpeBlockListHead
Definition: aclocal.h:604
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
UINT32 InterruptNumber
Definition: aclocal.h:605
struct acpi_gpe_xrupt_info * Previous
Definition: aclocal.h:602
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvDeleteGpeBlock().

◆ AcpiEvDetachRegion()

void AcpiEvDetachRegion ( ACPI_OPERAND_OBJECT RegionObj,
BOOLEAN  AcpiNsIsLocked 
)

Definition at line 360 of file evregion.c.

363 {
364  ACPI_OPERAND_OBJECT *HandlerObj;
365  ACPI_OPERAND_OBJECT *ObjDesc;
366  ACPI_OPERAND_OBJECT *StartDesc;
367  ACPI_OPERAND_OBJECT **LastObjPtr;
368  ACPI_ADR_SPACE_SETUP RegionSetup;
369  void **RegionContext;
370  ACPI_OPERAND_OBJECT *RegionObj2;
372 
373 
374  ACPI_FUNCTION_TRACE (EvDetachRegion);
375 
376 
377  RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
378  if (!RegionObj2)
379  {
380  return_VOID;
381  }
382  RegionContext = &RegionObj2->Extra.RegionContext;
383 
384  /* Get the address handler from the region object */
385 
386  HandlerObj = RegionObj->Region.Handler;
387  if (!HandlerObj)
388  {
389  /* This region has no handler, all done */
390 
391  return_VOID;
392  }
393 
394  /* Find this region in the handler's list */
395 
396  ObjDesc = HandlerObj->AddressSpace.RegionList;
397  StartDesc = ObjDesc;
398  LastObjPtr = &HandlerObj->AddressSpace.RegionList;
399 
400  while (ObjDesc)
401  {
402  /* Is this the correct Region? */
403 
404  if (ObjDesc == RegionObj)
405  {
407  "Removing Region %p from address handler %p\n",
408  RegionObj, HandlerObj));
409 
410  /* This is it, remove it from the handler's list */
411 
412  *LastObjPtr = ObjDesc->Region.Next;
413  ObjDesc->Region.Next = NULL; /* Must clear field */
414 
415  if (AcpiNsIsLocked)
416  {
418  if (ACPI_FAILURE (Status))
419  {
420  return_VOID;
421  }
422  }
423 
424  /* Now stop region accesses by executing the _REG method */
425 
427  if (ACPI_FAILURE (Status))
428  {
429  ACPI_EXCEPTION ((AE_INFO, Status, "from region _REG, [%s]",
430  AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
431  }
432 
433  if (AcpiNsIsLocked)
434  {
436  if (ACPI_FAILURE (Status))
437  {
438  return_VOID;
439  }
440  }
441 
442  /*
443  * If the region has been activated, call the setup handler with
444  * the deactivate notification
445  */
446  if (RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)
447  {
448  RegionSetup = HandlerObj->AddressSpace.Setup;
449  Status = RegionSetup (RegionObj, ACPI_REGION_DEACTIVATE,
450  HandlerObj->AddressSpace.Context, RegionContext);
451 
452  /*
453  * RegionContext should have been released by the deactivate
454  * operation. We don't need access to it anymore here.
455  */
456  if (RegionContext)
457  {
458  *RegionContext = NULL;
459  }
460 
461  /* Init routine may fail, Just ignore errors */
462 
463  if (ACPI_FAILURE (Status))
464  {
466  "from region handler - deactivate, [%s]",
467  AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
468  }
469 
470  RegionObj->Region.Flags &= ~(AOPOBJ_SETUP_COMPLETE);
471  }
472 
473  /*
474  * Remove handler reference in the region
475  *
476  * NOTE: this doesn't mean that the region goes away, the region
477  * is just inaccessible as indicated to the _REG method
478  *
479  * If the region is on the handler's list, this must be the
480  * region's handler
481  */
482  RegionObj->Region.Handler = NULL;
483  AcpiUtRemoveReference (HandlerObj);
484 
485  return_VOID;
486  }
487 
488  /* Walk the linked list of handlers */
489 
490  LastObjPtr = &ObjDesc->Region.Next;
491  ObjDesc = ObjDesc->Region.Next;
492 
493  /* Prevent infinite loop if list is corrupted */
494 
495  if (ObjDesc == StartDesc)
496  {
498  "Circular handler list in region object %p",
499  RegionObj));
500  return_VOID;
501  }
502  }
503 
504  /* If we get here, the region was not in the handler's region list */
505 
507  "Cannot remove region %p from address handler %p\n",
508  RegionObj, HandlerObj));
509 
510  return_VOID;
511 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
union acpi_operand_object * Handler
Definition: acobject.h:204
union acpi_operand_object * Next
Definition: acobject.h:205
ACPI_STATUS(* ACPI_ADR_SPACE_SETUP)(ACPI_HANDLE RegionHandle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: actypes.h:1214
#define ACPI_REG_DISCONNECT
Definition: actypes.h:878
ACPI_ADR_SPACE_SETUP Setup
Definition: acobject.h:415
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1221
union acpi_operand_object * RegionList
Definition: acobject.h:416
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_OBJECT_EXTRA Extra
Definition: acobject.h:538
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:124
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
#define AOPOBJ_SETUP_COMPLETE
Definition: acobject.h:99
#define AE_INFO
Definition: acoutput.h:230
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define return_VOID
Definition: acoutput.h:495
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:536
ACPI_STATUS AcpiEvExecuteRegMethod(ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function)
Definition: evregion.c:577
Status
Definition: gdiplustypes.h:24
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:784
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
void * RegionContext
Definition: acobject.h:480
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
ACPI_OPERAND_OBJECT * AcpiNsGetSecondaryObject(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: nsobject.c:346

Referenced by AcpiEvInstallHandler(), and AcpiRemoveAddressSpaceHandler().

◆ AcpiEvDetectGpe()

UINT32 AcpiEvDetectGpe ( ACPI_NAMESPACE_NODE GpeDevice,
ACPI_GPE_EVENT_INFO GpeEventInfo,
UINT32  GpeNumber 
)

Definition at line 722 of file evgpe.c.

726 {
728  UINT8 EnabledStatusByte;
729  UINT64 StatusReg;
730  UINT64 EnableReg;
731  UINT32 RegisterBit;
732  ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
733  ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;
736 
737 
738  ACPI_FUNCTION_TRACE (EvGpeDetect);
739 
740 
741  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
742 
743  if (!GpeEventInfo)
744  {
746  if (!GpeEventInfo)
747  {
748  goto ErrorExit;
749  }
750  }
751 
752  /* Get the info block for the entire GPE register */
753 
754  GpeRegisterInfo = GpeEventInfo->RegisterInfo;
755 
756  /* Get the register bitmask for this GPE */
757 
758  RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
759 
760  /* GPE currently enabled (enable bit == 1)? */
761 
762  Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
763  if (ACPI_FAILURE (Status))
764  {
765  goto ErrorExit;
766  }
767 
768  /* GPE currently active (status bit == 1)? */
769 
770  Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
771  if (ACPI_FAILURE (Status))
772  {
773  goto ErrorExit;
774  }
775 
776  /* Check if there is anything active at all in this GPE */
777 
779  "Read registers for GPE %02X: Status=%02X, Enable=%02X, "
780  "RunEnable=%02X, WakeEnable=%02X\n",
781  GpeNumber,
782  (UINT32) (StatusReg & RegisterBit),
783  (UINT32) (EnableReg & RegisterBit),
784  GpeRegisterInfo->EnableForRun,
785  GpeRegisterInfo->EnableForWake));
786 
787  EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
788  if (!(EnabledStatusByte & RegisterBit))
789  {
790  goto ErrorExit;
791  }
792 
793  /* Invoke global event handler if present */
794 
795  AcpiGpeCount++;
796  if (AcpiGbl_GlobalEventHandler)
797  {
798  AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
799  GpeDevice, GpeNumber,
800  AcpiGbl_GlobalEventHandlerContext);
801  }
802 
803  /* Found an active GPE */
804 
807  {
808  /* Dispatch the event to a raw handler */
809 
810  GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
811 
812  /*
813  * There is no protection around the namespace node
814  * and the GPE handler to ensure a safe destruction
815  * because:
816  * 1. The namespace node is expected to always
817  * exist after loading a table.
818  * 2. The GPE handler is expected to be flushed by
819  * AcpiOsWaitEventsComplete() before the
820  * destruction.
821  */
822  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
823  IntStatus |= GpeHandlerInfo->Address (
824  GpeDevice, GpeNumber, GpeHandlerInfo->Context);
825  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
826  }
827  else
828  {
829  /* Dispatch the event to a standard handler or method. */
830 
831  IntStatus |= AcpiEvGpeDispatch (GpeDevice,
833  }
834 
835 ErrorExit:
836  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
837  return (IntStatus);
838 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define ACPI_GPE_DISPATCH_TYPE(flags)
Definition: actypes.h:815
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
#define ACPI_CPU_FLAGS
Definition: actypes.h:252
ACPI_GPE_EVENT_INFO * AcpiEvGetGpeEventInfo(ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evgpe.c:372
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_GPE_DISPATCH_RAW_HANDLER
Definition: actypes.h:813
ACPI_GPE_HANDLER_INFO * Handler
Definition: aclocal.h:543
#define ACPI_DB_INTERRUPTS
Definition: acoutput.h:178
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_GENERIC_ADDRESS EnableAddress
Definition: aclocal.h:568
unsigned int UINT32
union acpi_gpe_dispatch_info Dispatch
Definition: aclocal.h:554
UINT32 AcpiEvGpeDispatch(ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber)
Definition: evgpe.c:857
UINT32 AcpiHwGetGpeRegisterBit(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: hwgpe.c:81
ACPI_GPE_HANDLER Address
Definition: aclocal.h:519
struct acpi_gpe_register_info * RegisterInfo
Definition: aclocal.h:555
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_GENERIC_ADDRESS StatusAddress
Definition: aclocal.h:567
ACPI_STATUS AcpiHwRead(UINT64 *Value, ACPI_GENERIC_ADDRESS *Reg)
Definition: hwregs.c:259
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#define ACPI_INTERRUPT_NOT_HANDLED
Definition: actypes.h:1238
#define ACPI_EVENT_TYPE_GPE
Definition: actypes.h:1132
Status
Definition: gdiplustypes.h:24
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
static VOID ErrorExit(LPTSTR lpszMessage)
Definition: telnetd.c:647
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
unsigned long long UINT64
unsigned char UINT8

Referenced by AcpiDispatchGpe(), AcpiEnableGpe(), AcpiEvGpeDetect(), and AcpiRemoveGpeHandler().

◆ AcpiEvEnableGpe()

ACPI_STATUS AcpiEvEnableGpe ( ACPI_GPE_EVENT_INFO GpeEventInfo)

Definition at line 126 of file evgpe.c.

128 {
130 
131 
132  ACPI_FUNCTION_TRACE (EvEnableGpe);
133 
134 
135  /* Enable the requested GPE */
136 
139 }
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_GPE_ENABLE
Definition: actypes.h:793
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiHwLowSetGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 Action)
Definition: hwgpe.c:106

Referenced by AcpiEvAddGpeReference().

◆ AcpiEvExecuteRegMethod()

ACPI_STATUS AcpiEvExecuteRegMethod ( ACPI_OPERAND_OBJECT RegionObj,
UINT32  Function 
)

Definition at line 577 of file evregion.c.

580 {
583  ACPI_OPERAND_OBJECT *RegionObj2;
584  const ACPI_NAME *RegNamePtr = ACPI_CAST_PTR (ACPI_NAME, METHOD_NAME__REG);
585  ACPI_NAMESPACE_NODE *MethodNode;
588 
589 
590  ACPI_FUNCTION_TRACE (EvExecuteRegMethod);
591 
592 
593  if (!AcpiGbl_NamespaceInitialized ||
594  RegionObj->Region.Handler == NULL)
595  {
597  }
598 
599  RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
600  if (!RegionObj2)
601  {
603  }
604 
605  /*
606  * Find any "_REG" method associated with this region definition.
607  * The method should always be updated as this function may be
608  * invoked after a namespace change.
609  */
610  Node = RegionObj->Region.Node->Parent;
612  *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
613  if (ACPI_SUCCESS (Status))
614  {
615  /*
616  * The _REG method is optional and there can be only one per
617  * region definition. This will be executed when the handler is
618  * attached or removed.
619  */
620  RegionObj2->Extra.Method_REG = MethodNode;
621  }
622  if (RegionObj2->Extra.Method_REG == NULL)
623  {
625  }
626 
627  /* _REG(DISCONNECT) should be paired with _REG(CONNECT) */
628 
629  if ((Function == ACPI_REG_CONNECT &&
630  RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED) ||
632  !(RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED)))
633  {
635  }
636 
637  /* Allocate and initialize the evaluation information block */
638 
640  if (!Info)
641  {
643  }
644 
645  Info->PrefixNode = RegionObj2->Extra.Method_REG;
646  Info->RelativePathname = NULL;
647  Info->Parameters = Args;
649 
650  /*
651  * The _REG method has two arguments:
652  *
653  * Arg0 - Integer:
654  * Operation region space ID Same value as RegionObj->Region.SpaceId
655  *
656  * Arg1 - Integer:
657  * connection status 1 for connecting the handler, 0 for disconnecting
658  * the handler (Passed as a parameter)
659  */
660  Args[0] = AcpiUtCreateIntegerObject ((UINT64) RegionObj->Region.SpaceId);
661  if (!Args[0])
662  {
664  goto Cleanup1;
665  }
666 
668  if (!Args[1])
669  {
671  goto Cleanup2;
672  }
673 
674  Args[2] = NULL; /* Terminate list */
675 
676  /* Execute the method, no return value */
677 
679  AcpiUtDisplayInitPathname (ACPI_TYPE_METHOD, Info->PrefixNode, NULL));
680 
683 
684  if (ACPI_FAILURE (Status))
685  {
686  goto Cleanup2;
687  }
688 
689  if (Function == ACPI_REG_CONNECT)
690  {
691  RegionObj->Common.Flags |= AOPOBJ_REG_CONNECTED;
692  }
693  else
694  {
695  RegionObj->Common.Flags &= ~AOPOBJ_REG_CONNECTED;
696  }
697 
698 Cleanup2:
700 
701 Cleanup1:
702  ACPI_FREE (Info);
704 }
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
union acpi_operand_object * Handler
Definition: acobject.h:204
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
#define ACPI_REG_CONNECT
Definition: actypes.h:879
ACPI_STATUS AcpiNsEvaluate(ACPI_EVALUATE_INFO *Info)
Definition: nseval.c:82
#define ACPI_REG_DISCONNECT
Definition: actypes.h:878
#define METHOD_NAME__REG
Definition: acnames.h:69
UINT32 ACPI_STATUS
Definition: actypes.h:460
struct acpi_namespace_node * Parent
Definition: aclocal.h:192
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
struct TraceInfo Info
#define ACPI_DEBUG_EXEC(a)
Definition: acoutput.h:477
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_OBJECT_EXTRA Extra
Definition: acobject.h:538
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
union node Node
Definition: types.h:1255
smooth NULL
Definition: ftsmooth.c:416
char ** Args
Definition: acdebug.h:343
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
ACPI_STATUS AcpiNsSearchOneScope(UINT32 EntryName, ACPI_NAMESPACE_NODE *Node, ACPI_OBJECT_TYPE Type, ACPI_NAMESPACE_NODE **RetNode)
Definition: nssearch.c:98
#define ACPI_TYPE_METHOD
Definition: actypes.h:686
ACPI_OPERAND_OBJECT * AcpiUtCreateIntegerObject(UINT64 Value)
Definition: utobject.c:223
#define AOPOBJ_REG_CONNECTED
Definition: acobject.h:98
#define AE_NOT_EXIST
Definition: acexcep.h:114
UINT32 ACPI_NAME
Definition: actypes.h:461
ACPI_OBJECT_COMMON_HEADER ACPI_NAMESPACE_NODE * Method_REG
Definition: acobject.h:478
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 Common
Definition: acobject.h:516
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:784
#define ACPI_IGNORE_RETURN_VALUE
Definition: acstruct.h:231
unsigned long long UINT64
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define AE_OK
Definition: acexcep.h:97
ACPI_OPERAND_OBJECT * AcpiNsGetSecondaryObject(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: nsobject.c:346
Definition: dlist.c:348

Referenced by AcpiEvDetachRegion(), AcpiEvInitializeRegion(), and AcpiEvRegRun().

◆ AcpiEvExecuteRegMethods()

void AcpiEvExecuteRegMethods ( ACPI_NAMESPACE_NODE Node,
ACPI_ADR_SPACE_TYPE  SpaceId,
UINT32  Function 
)

Definition at line 723 of file evregion.c.

727 {
729 
730 
731  ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
732 
733  /*
734  * These address spaces do not need a call to _REG, since the ACPI
735  * specification defines them as: "must always be accessible". Since
736  * they never change state (never become unavailable), no need to ever
737  * call _REG on them. Also, a DataTable is not a "real" address space,
738  * so do not call _REG. September 2018.
739  */
743  {
744  return_VOID;
745  }
746 
747  Info.SpaceId = SpaceId;
748  Info.Function = Function;
749  Info.RegRunCount = 0;
750 
752  " Running _REG methods for SpaceId %s\n",
753  AcpiUtGetRegionName (Info.SpaceId)));
754 
755  /*
756  * Run all _REG methods for all Operation Regions for this space ID. This
757  * is a separate walk in order to handle any interdependencies between
758  * regions and _REG methods. (i.e. handlers must be installed for all
759  * regions of this Space ID before we can run any _REG methods)
760  */
763 
764  /* Special case for EC: handle "orphan" _REG methods with no region */
765 
766  if (SpaceId == ACPI_ADR_SPACE_EC)
767  {
769  }
770 
772  " Executed %u _REG methods for SpaceId %s\n",
773  Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId)));
774 
775  return_VOID;
776 }
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ACPI_NS_WALK_UNLOCK
Definition: acnamesp.h:77
#define ACPI_ADR_SPACE_DATA_TABLE
Definition: actypes.h:873
struct TraceInfo Info
ACPI_STATUS AcpiNsWalkNamespace(ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, ACPI_WALK_CALLBACK DescendingCallback, ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue)
Definition: nswalk.c:190
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 void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:822
#define ACPI_ADR_SPACE_SYSTEM_IO
Definition: actypes.h:852
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:124
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
smooth NULL
Definition: ftsmooth.c:416
static ACPI_STATUS AcpiEvRegRun(ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue)
Definition: evregion.c:790
#define ACPI_ADR_SPACE_EC
Definition: actypes.h:854
#define ACPI_UINT32_MAX
Definition: actypes.h:66
#define return_VOID
Definition: acoutput.h:495
#define ACPI_TYPE_ANY
Definition: actypes.h:678
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_DB_NAMES
Definition: acoutput.h:166
static void AcpiEvOrphanEcRegMethod(ACPI_NAMESPACE_NODE *EcDeviceNode)
Definition: evregion.c:873
#define ACPI_ADR_SPACE_SYSTEM_MEMORY
Definition: actypes.h:851
Definition: dlist.c:348

Referenced by AcpiEvInitializeOpRegions(), and AcpiInstallAddressSpaceHandler().

◆ AcpiEvFindRegionHandler()

ACPI_OPERAND_OBJECT* AcpiEvFindRegionHandler ( ACPI_ADR_SPACE_TYPE  SpaceId,
ACPI_OPERAND_OBJECT HandlerObj 
)

Definition at line 346 of file evhandler.c.

349 {
350 
351  /* Walk the handler list for this device */
352 
353  while (HandlerObj)
354  {
355  /* Same SpaceId indicates a handler is installed */
356 
357  if (HandlerObj->AddressSpace.SpaceId == SpaceId)
358  {
359  return (HandlerObj);
360  }
361 
362  /* Next handler object */
363 
364  HandlerObj = HandlerObj->AddressSpace.Next;
365  }
366 
367  return (NULL);
368 }
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 void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:822
smooth NULL
Definition: ftsmooth.c:416
union acpi_operand_object * Next
Definition: acobject.h:417
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:536
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:410

Referenced by AcpiEvInitializeRegion(), AcpiEvInstallHandler(), and AcpiEvInstallSpaceHandler().

◆ AcpiEvFinishGpe()

ACPI_STATUS AcpiEvFinishGpe ( ACPI_GPE_EVENT_INFO GpeEventInfo)

Definition at line 670 of file evgpe.c.

672 {
674 
675 
678  {
679  /*
680  * GPE is level-triggered, we clear the GPE status bit after
681  * handling the event.
682  */
684  if (ACPI_FAILURE (Status))
685  {
686  return (Status);
687  }
688  }
689 
690  /*
691  * Enable this GPE, conditionally. This means that the GPE will
692  * only be physically enabled if the EnableMask bit is set
693  * in the EventInfo.
694  */
697  return (AE_OK);
698 }
#define ACPI_GPE_CONDITIONAL_ENABLE
Definition: actypes.h:795
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
BOOLEAN DisableForDispatch
Definition: aclocal.h:559
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define ACPI_GPE_XRUPT_TYPE_MASK
Definition: actypes.h:819
#define ACPI_GPE_LEVEL_TRIGGERED
Definition: actypes.h:817
ACPI_STATUS AcpiHwClearGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: hwgpe.c:190
Status
Definition: gdiplustypes.h:24
#define AE_OK
Definition: acexcep.h:97
ACPI_STATUS AcpiHwLowSetGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 Action)
Definition: hwgpe.c:106

Referenced by AcpiEvAsynchEnableGpe(), AcpiEvGpeDispatch(), and AcpiFinishGpe().

◆ 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().

◆ AcpiEvGetGpeDevice()

ACPI_STATUS AcpiEvGetGpeDevice ( ACPI_GPE_XRUPT_INFO GpeXruptInfo,
ACPI_GPE_BLOCK_INFO GpeBlock,
void Context 
)

Definition at line 130 of file evgpeutil.c.

134 {
136 
137 
138  /* Increment Index by the number of GPEs in this block */
139 
140  Info->NextBlockBaseIndex += GpeBlock->GpeCount;
141 
142  if (Info->Index < Info->NextBlockBaseIndex)
143  {
144  /*
145  * The GPE index is within this block, get the node. Leave the node
146  * NULL for the FADT-defined GPEs
147  */
148  if ((GpeBlock->Node)->Type == ACPI_TYPE_DEVICE)
149  {
150  Info->GpeDevice = GpeBlock->Node;
151  }
152 
153  Info->Status = AE_OK;
154  return (AE_CTRL_END);
155  }
156 
157  return (AE_OK);
158 }
#define AE_CTRL_END
Definition: acexcep.h:230
struct TraceInfo Info
#define ACPI_TYPE_DEVICE
Definition: actypes.h:684
struct tagContext Context
Definition: acpixf.h:1024
#define AE_OK
Definition: acexcep.h:97
ACPI_NAMESPACE_NODE * Node
Definition: aclocal.h:583

Referenced by AcpiGetGpeDevice().

◆ AcpiEvGetGpeEventInfo()

ACPI_GPE_EVENT_INFO* AcpiEvGetGpeEventInfo ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 372 of file evgpe.c.

375 {
376  ACPI_OPERAND_OBJECT *ObjDesc;
377  ACPI_GPE_EVENT_INFO *GpeInfo;
378  UINT32 i;
379 
380 
382 
383 
384  /* A NULL GpeDevice means use the FADT-defined GPE block(s) */
385 
386  if (!GpeDevice)
387  {
388  /* Examine GPE Block 0 and 1 (These blocks are permanent) */
389 
390  for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++)
391  {
392  GpeInfo = AcpiEvLowGetGpeInfo (GpeNumber,
393  AcpiGbl_GpeFadtBlocks[i]);
394  if (GpeInfo)
395  {
396  return (GpeInfo);
397  }
398  }
399 
400  /* The GpeNumber was not in the range of either FADT GPE block */
401 
402  return (NULL);
403  }
404 
405  /* A Non-NULL GpeDevice means this is a GPE Block Device */
406 
407  ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) GpeDevice);
408  if (!ObjDesc ||
409  !ObjDesc->Device.GpeBlock)
410  {
411  return (NULL);
412  }
413 
414  return (AcpiEvLowGetGpeInfo (GpeNumber, ObjDesc->Device.GpeBlock));
415 }
#define ACPI_MAX_GPE_BLOCKS
Definition: actypes.h:403
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
ACPI_GPE_EVENT_INFO * AcpiEvLowGetGpeInfo(UINT32 GpeNumber, ACPI_GPE_BLOCK_INFO *GpeBlock)
Definition: evgpe.c:327
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO ACPI_GPE_BLOCK_INFO * GpeBlock
Definition: acobject.h:270
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
ACPI_OBJECT_DEVICE Device
Definition: acobject.h:526

Referenced by AcpiClearGpe(), AcpiDisableGpe(), AcpiEnableGpe(), AcpiEvDetectGpe(), AcpiEvInstallGpeHandler(), AcpiFinishGpe(), AcpiGetGpeStatus(), AcpiMarkGpeForWake(), AcpiMaskGpe(), AcpiRemoveGpeHandler(), AcpiSetGpe(), AcpiSetGpeWakeMask(), and AcpiSetupGpeForWake().

◆ AcpiEvGetGpeNumberIndex()

UINT32 AcpiEvGetGpeNumberIndex ( UINT32  GpeNumber)

◆ AcpiEvGetGpeXruptBlock()

ACPI_STATUS AcpiEvGetGpeXruptBlock ( UINT32  InterruptNumber,
ACPI_GPE_XRUPT_INFO **  GpeXruptBlock 
)

Definition at line 178 of file evgpeutil.c.

181 {
182  ACPI_GPE_XRUPT_INFO *NextGpeXrupt;
183  ACPI_GPE_XRUPT_INFO *GpeXrupt;
186 
187 
188  ACPI_FUNCTION_TRACE (EvGetGpeXruptBlock);
189 
190 
191  /* No need for lock since we are not changing any list elements here */
192 
193  NextGpeXrupt = AcpiGbl_GpeXruptListHead;
194  while (NextGpeXrupt)
195  {
196  if (NextGpeXrupt->InterruptNumber == InterruptNumber)
197  {
198  *GpeXruptBlock = NextGpeXrupt;
200  }
201 
202  NextGpeXrupt = NextGpeXrupt->Next;
203  }
204 
205  /* Not found, must allocate a new xrupt descriptor */
206 
207  GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO));
208  if (!GpeXrupt)
209  {
211  }
212 
213  GpeXrupt->InterruptNumber = InterruptNumber;
214 
215  /* Install new interrupt descriptor with spin lock */
216 
217  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
218  if (AcpiGbl_GpeXruptListHead)
219  {
220  NextGpeXrupt = AcpiGbl_GpeXruptListHead;
221  while (NextGpeXrupt->Next)
222  {
223  NextGpeXrupt = NextGpeXrupt->Next;
224  }
225 
226  NextGpeXrupt->Next = GpeXrupt;
227  GpeXrupt->Previous = NextGpeXrupt;
228  }
229  else
230  {
231  AcpiGbl_GpeXruptListHead = GpeXrupt;
232  }
233 
234  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
235 
236  /* Install new interrupt handler if not SCI_INT */
237 
238  if (InterruptNumber != AcpiGbl_FADT.SciInterrupt)
239  {
240  Status = AcpiOsInstallInterruptHandler (InterruptNumber,
241  AcpiEvGpeXruptHandler, GpeXrupt);
242  if (ACPI_FAILURE (Status))
243  {
245  "Could not install GPE interrupt handler at level 0x%X",
246  InterruptNumber));
248  }
249  }
250 
251  *GpeXruptBlock = GpeXrupt;
253 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define AE_NO_MEMORY
Definition: acexcep.h:112
struct acpi_gpe_xrupt_info * Next
Definition: aclocal.h:603
#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
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
UINT32 ACPI_SYSTEM_XFACE AcpiEvGpeXruptHandler(void *Context)
Definition: evsci.c:176
#define AE_INFO
Definition: acoutput.h:230
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
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
UINT32 InterruptNumber
Definition: aclocal.h:605
struct acpi_gpe_xrupt_info * Previous
Definition: aclocal.h:602
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInstallGpeBlock().

◆ AcpiEvGpeDetect()

UINT32 AcpiEvGpeDetect ( ACPI_GPE_XRUPT_INFO GpeXruptList)

Definition at line 433 of file evgpe.c.

435 {
436  ACPI_GPE_BLOCK_INFO *GpeBlock;
437  ACPI_NAMESPACE_NODE *GpeDevice;
438  ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
443  UINT32 i;
444  UINT32 j;
445 
446 
447  ACPI_FUNCTION_NAME (EvGpeDetect);
448 
449  /* Check for the case where there are no GPEs */
450 
451  if (!GpeXruptList)
452  {
453  return (IntStatus);
454  }
455 
456  /*
457  * We need to obtain the GPE lock for both the data structs and registers
458  * Note: Not necessary to obtain the hardware lock, since the GPE
459  * registers are owned by the GpeLock.
460  */
461  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
462 
463  /* Examine all GPE blocks attached to this interrupt level */
464 
465  GpeBlock = GpeXruptList->GpeBlockListHead;
466  while (GpeBlock)
467  {
468  GpeDevice = GpeBlock->Node;
469 
470  /*
471  * Read all of the 8-bit GPE status and enable registers in this GPE
472  * block, saving all of them. Find all currently active GP events.
473  */
474  for (i = 0; i < GpeBlock->RegisterCount; i++)
475  {
476  /* Get the next status/enable pair */
477 
478  GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
479 
480  /*
481  * Optimization: If there are no GPEs enabled within this
482  * register, we can safely ignore the entire register.
483  */
484  if (!(GpeRegisterInfo->EnableForRun |
485  GpeRegisterInfo->EnableForWake))
486  {
488  "Ignore disabled registers for GPE %02X-%02X: "
489  "RunEnable=%02X, WakeEnable=%02X\n",
490  GpeRegisterInfo->BaseGpeNumber,
491  GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
492  GpeRegisterInfo->EnableForRun,
493  GpeRegisterInfo->EnableForWake));
494  continue;
495  }
496 
497  /* Now look at the individual GPEs in this byte register */
498 
499  for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
500  {
501  /* Detect and dispatch one GPE bit */
502 
503  GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
505  GpeNumber = j + GpeRegisterInfo->BaseGpeNumber;
506  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
507  IntStatus |= AcpiEvDetectGpe (
508  GpeDevice, GpeEventInfo, GpeNumber);
509  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
510  }
511  }
512 
513  GpeBlock = GpeBlock->Next;
514  }
515 
516  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
517  return (IntStatus);
518 }
struct acpi_gpe_block_info * Next
Definition: aclocal.h:585
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
#define ACPI_CPU_FLAGS
Definition: actypes.h:252
#define ACPI_DB_INTERRUPTS
Definition: acoutput.h:178
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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
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 GLint GLint j
Definition: glfuncs.h:250
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_GPE_BLOCK_INFO * GpeBlockListHead
Definition: aclocal.h:604
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#define ACPI_INTERRUPT_NOT_HANDLED
Definition: actypes.h:1238
ACPI_GPE_REGISTER_INFO * RegisterInfo
Definition: aclocal.h:587
UINT32 RegisterCount
Definition: aclocal.h:590
UINT32 AcpiEvDetectGpe(ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber)
Definition: evgpe.c:722
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
#define ACPI_GPE_REGISTER_WIDTH
Definition: actypes.h:407
ACPI_GPE_EVENT_INFO * EventInfo
Definition: aclocal.h:588
ACPI_NAMESPACE_NODE * Node
Definition: aclocal.h:583

Referenced by AcpiEvGpeXruptHandler(), AcpiEvSciXruptHandler(), and AcpiUpdateAllGpes().

◆ AcpiEvGpeInitialize()

ACPI_STATUS AcpiEvGpeInitialize ( void  )

Definition at line 84 of file evgpeinit.c.

86 {
87  UINT32 RegisterCount0 = 0;
88  UINT32 RegisterCount1 = 0;
89  UINT32 GpeNumberMax = 0;
91 
92 
93  ACPI_FUNCTION_TRACE (EvGpeInitialize);
94 
95 
97  "Initializing General Purpose Events (GPEs):\n"));
98 
100  if (ACPI_FAILURE (Status))
101  {
103  }
104 
105  /*
106  * Initialize the GPE Block(s) defined in the FADT
107  *
108  * Why the GPE register block lengths are divided by 2: From the ACPI
109  * Spec, section "General-Purpose Event Registers", we have:
110  *
111  * "Each register block contains two registers of equal length
112  * GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the
113  * GPE0_STS and GPE0_EN registers is equal to half the GPE0_LEN
114  * The length of the GPE1_STS and GPE1_EN registers is equal to
115  * half the GPE1_LEN. If a generic register block is not supported
116  * then its respective block pointer and block length values in the
117  * FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need
118  * to be the same size."
119  */
120 
121  /*
122  * Determine the maximum GPE number for this machine.
123  *
124  * Note: both GPE0 and GPE1 are optional, and either can exist without
125  * the other.
126  *
127  * If EITHER the register length OR the block address are zero, then that
128  * particular block is not supported.
129  */
130  if (AcpiGbl_FADT.Gpe0BlockLength &&
131  AcpiGbl_FADT.XGpe0Block.Address)
132  {
133  /* GPE block 0 exists (has both length and address > 0) */
134 
135  RegisterCount0 = (UINT16) (AcpiGbl_FADT.Gpe0BlockLength / 2);
136  GpeNumberMax = (RegisterCount0 * ACPI_GPE_REGISTER_WIDTH) - 1;
137 
138  /* Install GPE Block 0 */
139 
140  Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
141  AcpiGbl_FADT.XGpe0Block.Address,
142  AcpiGbl_FADT.XGpe0Block.SpaceId,
143  RegisterCount0, 0,
144  AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
145 
146  if (ACPI_FAILURE (Status))
147  {
149  "Could not create GPE Block 0"));
150  }
151  }
152 
153  if (AcpiGbl_FADT.Gpe1BlockLength &&
154  AcpiGbl_FADT.XGpe1Block.Address)
155  {
156  /* GPE block 1 exists (has both length and address > 0) */
157 
158  RegisterCount1 = (UINT16) (AcpiGbl_FADT.Gpe1BlockLength / 2);
159 
160  /* Check for GPE0/GPE1 overlap (if both banks exist) */
161 
162  if ((RegisterCount0) &&
163  (GpeNumberMax >= AcpiGbl_FADT.Gpe1Base))
164  {
166  "GPE0 block (GPE 0 to %u) overlaps the GPE1 block "
167  "(GPE %u to %u) - Ignoring GPE1",
168  GpeNumberMax, AcpiGbl_FADT.Gpe1Base,
169  AcpiGbl_FADT.Gpe1Base +
170  ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1)));
171 
172  /* Ignore GPE1 block by setting the register count to zero */
173 
174  RegisterCount1 = 0;
175  }
176  else
177  {
178  /* Install GPE Block 1 */
179 
180  Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
181  AcpiGbl_FADT.XGpe1Block.Address,
182  AcpiGbl_FADT.XGpe1Block.SpaceId,
183  RegisterCount1,
184  AcpiGbl_FADT.Gpe1Base,
185  AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
186 
187  if (ACPI_FAILURE (Status))
188  {
190  "Could not create GPE Block 1"));
191  }
192 
193  /*
194  * GPE0 and GPE1 do not have to be contiguous in the GPE number
195  * space. However, GPE0 always starts at GPE number zero.
196  */
197  GpeNumberMax = AcpiGbl_FADT.Gpe1Base +
198  ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1);
199  }
200  }
201 
202  /* Exit if there are no GPE registers */
203 
204  if ((RegisterCount0 + RegisterCount1) == 0)
205  {
206  /* GPEs are not required by ACPI, this is OK */
207 
209  "There are no GPE blocks defined in the FADT\n"));
210  Status = AE_OK;
211  goto Cleanup;
212  }
213 
214 
215 Cleanup:
218 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
ACPI_STATUS AcpiEvCreateGpeBlock(ACPI_NAMESPACE_NODE *GpeDevice, UINT64 Address, UINT8 SpaceId, UINT32 RegisterCount, UINT16 GpeBlockBaseNumber, UINT32 InterruptNumber, ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
Definition: evgpeblk.c:367
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
static const WCHAR Cleanup[]
Definition: register.c:80
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_INIT
Definition: acoutput.h:151
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
unsigned short UINT16
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
#define ACPI_GPE_REGISTER_WIDTH
Definition: actypes.h:407
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInitializeEvents().

◆ 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:1238
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
struct tagContext Context
Definition: acpixf.h:1024
UINT32 AcpiEvGpeDetect(ACPI_GPE_XRUPT_INFO *GpeXruptList)
Definition: evgpe.c:433

Referenced by AcpiEvDeleteGpeXrupt(), and AcpiEvGetGpeXruptBlock().

◆ AcpiEvHasDefaultHandler()

BOOLEAN AcpiEvHasDefaultHandler ( ACPI_NAMESPACE_NODE Node,
ACPI_ADR_SPACE_TYPE  SpaceId 
)

Definition at line 166 of file evhandler.c.

169 {
170  ACPI_OPERAND_OBJECT *ObjDesc;
171  ACPI_OPERAND_OBJECT *HandlerObj;
172 
173 
174  /* Must have an existing internal object */
175 
176  ObjDesc = AcpiNsGetAttachedObject (Node);
177  if (ObjDesc)
178  {
179  HandlerObj = ObjDesc->CommonNotify.Handler;
180 
181  /* Walk the linked list of handlers for this object */
182 
183  while (HandlerObj)
184  {
185  if (HandlerObj->AddressSpace.SpaceId == SpaceId)
186  {
187  if (HandlerObj->AddressSpace.HandlerFlags &
189  {
190  return (TRUE);
191  }
192  }
193 
194  HandlerObj = HandlerObj->AddressSpace.Next;
195  }
196  }
197 
198  return (FALSE);
199 }
#define TRUE
Definition: types.h:120
#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
Definition: acobject.h:423
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 void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:822
union acpi_operand_object * Next
Definition: acobject.h:417
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:536
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:410
ACPI_OBJECT_NOTIFY_COMMON CommonNotify
Definition: acobject.h:525
Definition: dlist.c:348

Referenced by AcpiEvInitializeOpRegions().

◆ AcpiEvInitGlobalLockHandler()

ACPI_STATUS AcpiEvInitGlobalLockHandler ( void  )

Definition at line 74 of file evglock.c.

76 {
78 
79 
80  ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler);
81 
82 
83  /* If Hardware Reduced flag is set, there is no global lock */
84 
85  if (AcpiGbl_ReducedHardware)
86  {
88  }
89 
90  /* Attempt installation of the global lock handler */
91 
94 
95  /*
96  * If the global lock does not exist on this platform, the attempt to
97  * enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick).
98  * Map to AE_OK, but mark global lock as not present. Any attempt to
99  * actually use the global lock will be flagged with an error.
100  */
101  AcpiGbl_GlobalLockPresent = FALSE;
103  {
105  "No response from Global Lock hardware, disabling lock"));
106 
108  }
109 
110  Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock);
111  if (ACPI_FAILURE (Status))
112  {
114  }
115 
116  AcpiGbl_GlobalLockPending = FALSE;
117  AcpiGbl_GlobalLockPresent = TRUE;
119 }
#define TRUE
Definition: types.h:120
#define ACPI_EVENT_GLOBAL
Definition: actypes.h:755
ACPI_STATUS AcpiInstallFixedEventHandler(UINT32 Event, ACPI_EVENT_HANDLER Handler, void *Context)
Definition: evxface.c:707
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiOsCreateLock(ACPI_SPINLOCK *OutHandle)
Definition: osl.c:463
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AE_INFO
Definition: acoutput.h:230
smooth NULL
Definition: ftsmooth.c:416
#define AE_NO_HARDWARE_RESPONSE
Definition: acexcep.h:130
static UINT32 AcpiEvGlobalLockHandler(void *Context)
Definition: evglock.c:168
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInstallXruptHandlers().

◆ 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().

◆ AcpiEvInitializeGpeBlock()

ACPI_STATUS AcpiEvInitializeGpeBlock ( ACPI_GPE_XRUPT_INFO GpeXruptInfo,
ACPI_GPE_BLOCK_INFO GpeBlock,
void Context 
)

Definition at line 477 of file evgpeblk.c.

481 {
484  UINT32 GpeEnabledCount;
485  UINT32 GpeIndex;
486  UINT32 i;
487  UINT32 j;
488  BOOLEAN *IsPollingNeeded = Context;
490 
491 
492  ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);
493 
494 
495  /*
496  * Ignore a null GPE block (e.g., if no GPE block 1 exists), and
497  * any GPE blocks that have been initialized already.
498  */
499  if (!GpeBlock || GpeBlock->Initialized)
500  {
502  }
503 
504  /*
505  * Enable all GPEs that have a corresponding method and have the
506  * ACPI_GPE_CAN_WAKE flag unset. Any other GPEs within this block
507  * must be enabled via the acpi_enable_gpe() interface.
508  */
509  GpeEnabledCount = 0;
510 
511  for (i = 0; i < GpeBlock->RegisterCount; i++)
512  {
513  for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
514  {
515  /* Get the info block for this particular GPE */
516 
517  GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
518  GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
519  ACPI_ERROR_ONLY(GpeNumber = GpeBlock->BlockBaseNumber + GpeIndex);
521 
522  /*
523  * Ignore GPEs that have no corresponding _Lxx/_Exx method
524  * and GPEs that are used to wake the system
525  */
528  {
529  continue;
530  }
531 
533  if (ACPI_FAILURE (Status))
534  {
536  "Could not enable GPE 0x%02X",
537  GpeNumber));
538  continue;
539  }
540 
542 
543  if (IsPollingNeeded &&
545  {
546  *IsPollingNeeded = TRUE;
547  }
548 
549  GpeEnabledCount++;
550  }
551  }
552 
553  if (GpeEnabledCount)
554  {
555  ACPI_INFO ((
556  "Enabled %u GPEs in block %02X to %02X", GpeEnabledCount,
557  (UINT32) GpeBlock->BlockBaseNumber,
558  (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1))));
559  }
560 
561  GpeBlock->Initialized = TRUE;
563 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_GPE_INITIALIZED
Definition: actypes.h:823
#define TRUE
Definition: types.h:120
#define ACPI_ERROR_ONLY(s)
Definition: acmacros.h:467
#define ACPI_GPE_AUTO_ENABLED
Definition: actypes.h:822
#define ACPI_GPE_DISPATCH_TYPE(flags)
Definition: actypes.h:815
#define ACPI_GPE_CAN_WAKE
Definition: actypes.h:821
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
ACPI_STATUS AcpiEvAddGpeReference(ACPI_GPE_EVENT_INFO *GpeEventInfo, BOOLEAN ClearOnEnable)
Definition: evgpe.c:221
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
#define ACPI_GPE_DISPATCH_METHOD
Definition: actypes.h:810
unsigned char BOOLEAN
#define AE_INFO
Definition: acoutput.h:230
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 GLint GLint j
Definition: glfuncs.h:250
#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__)
Definition: acevents.h:59
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
UINT32 RegisterCount
Definition: aclocal.h:590
#define ACPI_INFO(plist)
Definition: acoutput.h:237
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
struct tagContext Context
Definition: acpixf.h:1024
BOOLEAN Initialized
Definition: aclocal.h:594
#define ACPI_GPE_REGISTER_WIDTH
Definition: actypes.h:407
#define AE_OK
Definition: acexcep.h:97
ACPI_GPE_EVENT_INFO * EventInfo
Definition: aclocal.h:588
UINT16 BlockBaseNumber
Definition: aclocal.h:592

Referenced by AcpiUpdateAllGpes().

◆ AcpiEvInitializeOpRegions()

ACPI_STATUS AcpiEvInitializeOpRegions ( void  )

Definition at line 84 of file evregion.c.

86 {
88  UINT32 i;
89 
90 
91  ACPI_FUNCTION_TRACE (EvInitializeOpRegions);
92 
93 
95  if (ACPI_FAILURE (Status))
96  {
98  }
99 
100  /* Run the _REG methods for OpRegions in each default address space */
101 
102  for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
103  {
104  /*
105  * Make sure the installed handler is the DEFAULT handler. If not the
106  * default, the _REG methods will have already been run (when the
107  * handler was installed)
108  */
109  if (AcpiEvHasDefaultHandler (AcpiGbl_RootNode,
111  {
112  AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
114  }
115  }
116 
119 }
#define ACPI_NUM_DEFAULT_SPACES
Definition: acconfig.h:202
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ACPI_REG_CONNECT
Definition: actypes.h:879
UINT8 AcpiGbl_DefaultAddressSpaces[]
Definition: evhandler.c:66
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
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned int UINT32
Status
Definition: gdiplustypes.h:24
void AcpiEvExecuteRegMethods(ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId, UINT32 Function)
Definition: evregion.c:723
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
BOOLEAN AcpiEvHasDefaultHandler(ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId)
Definition: evhandler.c:166

Referenced by AcpiNsInitializeDevices().

◆ AcpiEvInitializeRegion()

ACPI_STATUS AcpiEvInitializeRegion ( ACPI_OPERAND_OBJECT RegionObj)

Definition at line 569 of file evrgnini.c.

571 {
572  ACPI_OPERAND_OBJECT *HandlerObj;
573  ACPI_OPERAND_OBJECT *ObjDesc;
576 
577 
578  ACPI_FUNCTION_TRACE (EvInitializeRegion);
579 
580 
581  if (!RegionObj)
582  {
584  }
585 
586  if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED)
587  {
589  }
590 
591  RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
592 
593  Node = RegionObj->Region.Node->Parent;
594  SpaceId = RegionObj->Region.SpaceId;
595 
596  /*
597  * The following loop depends upon the root Node having no parent
598  * ie: AcpiGbl_RootNode->Parent being set to NULL
599  */
600  while (Node)
601  {
602  /* Check to see if a handler exists */
603 
604  HandlerObj = NULL;
605  ObjDesc = AcpiNsGetAttachedObject (Node);
606  if (ObjDesc)
607  {
608  /* Can only be a handler if the object exists */
609 
610  switch (Node->Type)
611  {
612  case ACPI_TYPE_DEVICE:
613  case ACPI_TYPE_PROCESSOR:
614  case ACPI_TYPE_THERMAL:
615 
616  HandlerObj = ObjDesc->CommonNotify.Handler;
617  break;
618 
619  default:
620 
621  /* Ignore other objects */
622 
623  break;
624  }
625 
626  HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj);
627  if (HandlerObj)
628  {
629  /* Found correct handler */
630 
632  "Found handler %p for region %p in obj %p\n",
633  HandlerObj, RegionObj, ObjDesc));
634 
635  (void) AcpiEvAttachRegion (HandlerObj, RegionObj, FALSE);
636 
637  /*
638  * Tell all users that this region is usable by
639  * running the _REG method
640  */
645  }
646  }
647 
648  /* This node does not have the handler we need; Pop up one level */
649 
650  Node = Node->Parent;
651  }
652 
653  /*
654  * If we get here, there is no handler for this region. This is not
655  * fatal because many regions get created before a handler is installed
656  * for said region.
657  */
659  "No handler for RegionType %s(%X) (RegionObj %p)\n",
660  AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj));
661 
663 }
UINT8 ACPI_ADR_SPACE_TYPE
Definition: actypes.h:849
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ACPI_TYPE_THERMAL
Definition: actypes.h:691
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
#define ACPI_REG_CONNECT
Definition: actypes.h:879
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
struct acpi_namespace_node * Parent
Definition: aclocal.h:192
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:202
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 void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:822
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:124
union node Node
Definition: types.h:1255
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
#define AOPOBJ_OBJECT_INITIALIZED
Definition: acobject.h:97
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
ACPI_STATUS AcpiEvAttachRegion(ACPI_OPERAND_OBJECT *HandlerObj, ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked)
Definition: evregion.c:530
#define ACPI_TYPE_DEVICE
Definition: actypes.h:684
ACPI_STATUS AcpiEvExecuteRegMethod(ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function)
Definition: evregion.c:577
#define ACPI_TYPE_PROCESSOR
Definition: actypes.h:690
ACPI_OPERAND_OBJECT * AcpiEvFindRegionHandler(ACPI_ADR_SPACE_TYPE SpaceId, ACPI_OPERAND_OBJECT *HandlerObj)
Definition: evhandler.c:346
void AcpiExExitInterpreter(void)
Definition: exutils.c:139
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
ACPI_OBJECT_COMMON Common
Definition: acobject.h:516
ACPI_OBJECT_NOTIFY_COMMON CommonNotify
Definition: acobject.h:525
#define AE_OK
Definition: acexcep.h:97
Definition: dlist.c:348

Referenced by AcpiDsInitializeRegion(), and AcpiDsLoad2EndOp().

◆ AcpiEvInstallRegionHandlers()

ACPI_STATUS AcpiEvInstallRegionHandlers ( void  )

Definition at line 88 of file evhandler.c.

90 {
92  UINT32 i;
93 
94 
95  ACPI_FUNCTION_TRACE (EvInstallRegionHandlers);
96 
97 
99  if (ACPI_FAILURE (Status))
100  {
102  }
103 
104  /*
105  * All address spaces (PCI Config, EC, SMBus) are scope dependent and
106  * registration must occur for a specific device.
107  *
108  * In the case of the system memory and IO address spaces there is
109  * currently no device associated with the address space. For these we
110  * use the root.
111  *
112  * We install the default PCI config space handler at the root so that
113  * this space is immediately available even though the we have not
114  * enumerated all the PCI Root Buses yet. This is to conform to the ACPI
115  * specification which states that the PCI config space must be always
116  * available -- even though we are nowhere near ready to find the PCI root
117  * buses at this point.
118  *
119  * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler
120  * has already been installed (via AcpiInstallAddressSpaceHandler).
121  * Similar for AE_SAME_HANDLER.
122  */
123  for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
124  {
125  Status = AcpiEvInstallSpaceHandler (AcpiGbl_RootNode,
128  switch (Status)
129  {
130  case AE_OK:
131  case AE_SAME_HANDLER:
132  case AE_ALREADY_EXISTS:
133 
134  /* These exceptions are all OK */
135 
136  Status = AE_OK;
137  break;
138 
139  default:
140 
141  goto UnlockAndExit;
142  }
143  }
144 
145 UnlockAndExit:
148 }
#define ACPI_NUM_DEFAULT_SPACES
Definition: acconfig.h:202
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_SAME_HANDLER
Definition: acexcep.h:133
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
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned int UINT32
ACPI_STATUS AcpiEvInstallSpaceHandler(ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId, ACPI_ADR_SPACE_HANDLER Handler, ACPI_ADR_SPACE_SETUP Setup, void *Context)
Definition: evhandler.c:389
smooth NULL
Definition: ftsmooth.c:416
UINT8 AcpiGbl_DefaultAddressSpaces[ACPI_NUM_DEFAULT_SPACES]
Definition: evhandler.c:66
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
#define ACPI_DEFAULT_HANDLER
Definition: actypes.h:1200
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiLoadTables().

◆ 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().

◆ AcpiEvInstallSpaceHandler()

ACPI_STATUS AcpiEvInstallSpaceHandler ( ACPI_NAMESPACE_NODE Node,
ACPI_ADR_SPACE_TYPE  SpaceId,
ACPI_ADR_SPACE_HANDLER  Handler,
ACPI_ADR_SPACE_SETUP  Setup,
void Context 
)

Definition at line 389 of file evhandler.c.

395 {
396  ACPI_OPERAND_OBJECT *ObjDesc;
397  ACPI_OPERAND_OBJECT *HandlerObj;
400  UINT8 Flags = 0;
401 
402 
403  ACPI_FUNCTION_TRACE (EvInstallSpaceHandler);
404 
405 
406  /*
407  * This registration is valid for only the types below and the root.
408  * The root node is where the default handlers get installed.
409  */
410  if ((Node->Type != ACPI_TYPE_DEVICE) &&
411  (Node->Type != ACPI_TYPE_PROCESSOR) &&
412  (Node->Type != ACPI_TYPE_THERMAL) &&
413  (Node != AcpiGbl_RootNode))
414  {
416  goto UnlockAndExit;
417  }
418 
420  {
422 
423  switch (SpaceId)
424  {
426 
429  break;
430 
432 
435  break;
436 
438 
441  break;
442 
443  case ACPI_ADR_SPACE_CMOS:
444 
447  break;
448 
450 
453  break;
454 
456 
458  Setup = NULL;
459  break;
460 
461  default:
462 
464  goto UnlockAndExit;
465  }
466  }
467 
468  /* If the caller hasn't specified a setup routine, use the default */
469 
470  if (!Setup)
471  {
473  }
474 
475  /* Check for an existing internal object */
476 
477  ObjDesc = AcpiNsGetAttachedObject (Node);
478  if (ObjDesc)
479  {
480  /*
481  * The attached device object already exists. Now make sure
482  * the handler is not already installed.
483  */
484  HandlerObj = AcpiEvFindRegionHandler (SpaceId,
485  ObjDesc->CommonNotify.Handler);
486 
487  if (HandlerObj)
488  {
489  if (HandlerObj->AddressSpace.Handler == Handler)
490  {
491  /*
492  * It is (relatively) OK to attempt to install the SAME
493  * handler twice. This can easily happen with the
494  * PCI_Config space.
495  */
497  goto UnlockAndExit;
498  }
499  else
500  {
501  /* A handler is already installed */
502 
504  }
505 
506  goto UnlockAndExit;
507  }
508  }
509  else
510  {
512  "Creating object on Device %p while installing handler\n",
513  Node));
514 
515  /* ObjDesc does not exist, create one */
516 
517  if (Node->Type == ACPI_TYPE_ANY)
518  {
520  }
521  else
522  {
523  Type = Node->Type;
524  }
525 
526  ObjDesc = AcpiUtCreateInternalObject (Type);
527  if (!ObjDesc)
528  {
530  goto UnlockAndExit;
531  }
532 
533  /* Init new descriptor */
534 
535  ObjDesc->Common.Type = (UINT8) Type;
536 
537  /* Attach the new object to the Node */
538 
539  Status = AcpiNsAttachObject (Node, ObjDesc, Type);
540 
541  /* Remove local reference to the object */
542 
543  AcpiUtRemoveReference (ObjDesc);
544 
545  if (ACPI_FAILURE (Status))
546  {
547  goto UnlockAndExit;
548  }
549  }
550 
552  "Installing address handler for region %s(%X) "
553  "on Device %4.4s %p(%p)\n",
555  AcpiUtGetNodeName (Node), Node, ObjDesc));
556 
557  /*
558  * Install the handler
559  *
560  * At this point there is no existing handler. Just allocate the object
561  * for the handler and link it into the list.
562  */
564  if (!HandlerObj)
565  {
567  goto UnlockAndExit;
568  }
569 
570  /* Init handler obj */
571 
572  HandlerObj->AddressSpace.SpaceId = (UINT8) SpaceId;
573  HandlerObj->AddressSpace.HandlerFlags = Flags;
574  HandlerObj->AddressSpace.RegionList = NULL;
575  HandlerObj->AddressSpace.Node = Node;
576  HandlerObj->AddressSpace.Handler = Handler;
577  HandlerObj->AddressSpace.Context = Context;
578  HandlerObj->AddressSpace.Setup = Setup;
579 
580  /* Install at head of Device.AddressSpace list */
581 
582  HandlerObj->AddressSpace.Next = ObjDesc->CommonNotify.Handler;
583 
584  /*
585  * The Device object is the first reference on the HandlerObj.
586  * Each region that uses the handler adds a reference.
587  */
588  ObjDesc->CommonNotify.Handler = HandlerObj;
589 
590  /*
591  * Walk the namespace finding all of the regions this handler will
592  * manage.
593  *
594  * Start at the device and search the branch toward the leaf nodes
595  * until either the leaf is encountered or a device is detected that
596  * has an address handler of the same type.
597  *
598  * In either case, back up and search down the remainder of the branch
599  */
602  AcpiEvInstallHandler, NULL, HandlerObj, NULL);
603 
604 UnlockAndExit:
606 }
ACPI_STATUS AcpiEvPciConfigRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:176
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:413
#define ACPI_TYPE_THERMAL
Definition: actypes.h:691
Type
Definition: Type.h:6
#define ACPI_NS_WALK_UNLOCK
Definition: acnamesp.h:77
ACPI_STATUS AcpiExDataTableSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: exregion.c:543
#define AE_NO_MEMORY
Definition: acexcep.h:112
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 void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:822
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define AE_SAME_HANDLER
Definition: acexcep.h:133
ACPI_STATUS AcpiEvDefaultRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:508
ACPI_ADR_SPACE_SETUP Setup
Definition: acobject.h:415
#define ACPI_ADR_SPACE_DATA_TABLE
Definition: actypes.h:873
union acpi_operand_object * RegionList
Definition: acobject.h:416
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiNsWalkNamespace(ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, ACPI_WALK_CALLBACK DescendingCallback, ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue)
Definition: nswalk.c:190
#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
Definition: acobject.h:423
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
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 void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:822
#define ACPI_ADR_SPACE_SYSTEM_IO
Definition: actypes.h:852
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:124
union node Node
Definition: types.h:1255
smooth NULL
Definition: ftsmooth.c:416
union acpi_operand_object * Next
Definition: acobject.h:417
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER
Definition: actypes.h:714
UINT32 ACPI_OBJECT_TYPE
Definition: actypes.h:676
ACPI_ADR_SPACE_HANDLER Handler
Definition: acobject.h:412
static ACPI_STATUS AcpiEvInstallHandler(ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue)
Definition: evhandler.c:220
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
#define ACPI_DEFAULT_HANDLER
Definition: actypes.h:1200
#define ACPI_UINT32_MAX
Definition: actypes.h:66
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
ACPI_STATUS AcpiExCmosSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: exregion.c:469
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:536
#define ACPI_TYPE_ANY
Definition: actypes.h:678
#define ACPI_TYPE_DEVICE
Definition: actypes.h:684
#define ACPI_TYPE_PROCESSOR
Definition: actypes.h:690
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:662
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiEvPciBarRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:448
ACPI_STATUS AcpiNsAttachObject(ACPI_NAMESPACE_NODE *Node, ACPI_OPERAND_OBJECT *Object, ACPI_OBJECT_TYPE Type)
Definition: nsobject.c:76
ACPI_OPERAND_OBJECT * AcpiEvFindRegionHandler(ACPI_ADR_SPACE_TYPE SpaceId, ACPI_OPERAND_OBJECT *HandlerObj)
Definition: evhandler.c:346
#define ACPI_ADR_SPACE_CMOS
Definition: actypes.h:856
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_OBJECT_COMMON_HEADER UINT8 SpaceId
Definition: acobject.h:410
ACPI_STATUS AcpiEvIoSpaceRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:136
ACPI_OBJECT_COMMON Common
Definition: acobject.h:516
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:784
#define ACPI_ADR_SPACE_PCI_CONFIG
Definition: actypes.h:853
ACPI_STATUS AcpiExPciConfigSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: exregion.c:388
ACPI_STATUS AcpiEvSystemMemoryRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:70
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
ACPI_OBJECT_NOTIFY_COMMON CommonNotify
Definition: acobject.h:525
struct tagContext Context
Definition: acpixf.h:1024
#define AcpiUtCreateInternalObject(t)
Definition: acutils.h:654
#define ACPI_ADR_SPACE_SYSTEM_MEMORY
Definition: actypes.h:851
ACPI_STATUS AcpiEvCmosRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:479
ACPI_STATUS AcpiExSystemIoSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: exregion.c:323
unsigned char UINT8
ACPI_STATUS AcpiExSystemMemorySpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: exregion.c:72
#define AE_OK
Definition: acexcep.h:97
ACPI_STATUS AcpiExPciBarSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: exregion.c:506
#define ACPI_ADR_SPACE_PCI_BAR_TARGET
Definition: actypes.h:857
Definition: dlist.c:348

Referenced by AcpiEvInstallRegionHandlers(), and AcpiInstallAddressSpaceHandler().

◆ 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().

◆ AcpiEvIoSpaceRegionSetup()

ACPI_STATUS AcpiEvIoSpaceRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 136 of file evrgnini.c.

141 {
142  ACPI_FUNCTION_TRACE (EvIoSpaceRegionSetup);
143 
144 
146  {
147  *RegionContext = NULL;
148  }
149  else
150  {
151  *RegionContext = HandlerContext;
152  }
153 
155 }
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1221
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
smooth NULL
Definition: ftsmooth.c:416
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvIsNotifyObject()

BOOLEAN AcpiEvIsNotifyObject ( ACPI_NAMESPACE_NODE Node)

Definition at line 75 of file evmisc.c.

77 {
78 
79  switch (Node->Type)
80  {
81  case ACPI_TYPE_DEVICE:
83  case ACPI_TYPE_THERMAL:
84  /*
85  * These are the ONLY objects that can receive ACPI notifications
86  */
87  return (TRUE);
88 
89  default:
90 
91  return (FALSE);
92  }
93 }
#define TRUE
Definition: types.h:120
#define ACPI_TYPE_THERMAL
Definition: actypes.h:691
#define ACPI_TYPE_DEVICE
Definition: actypes.h:684
#define ACPI_TYPE_PROCESSOR
Definition: actypes.h:690
Definition: dlist.c:348

Referenced by AcpiEvQueueNotifyRequest(), AcpiExOpcode_2A_0T_0R(), AcpiInstallNotifyHandler(), and AcpiRemoveNotifyHandler().

◆ AcpiEvIsPciRootBridge()

BOOLEAN AcpiEvIsPciRootBridge ( ACPI_NAMESPACE_NODE Node)

Definition at line 380 of file evrgnini.c.

382 {
384  ACPI_PNP_DEVICE_ID *Hid;
386  UINT32 i;
387  BOOLEAN Match;
388 
389 
390  /* Get the _HID and check for a PCI Root Bridge */
391 
392  Status = AcpiUtExecute_HID (Node, &Hid);
393  if (ACPI_FAILURE (Status))
394  {
395  return (FALSE);
396  }
397 
398  Match = AcpiUtIsPciRootBridge (Hid->String);
399  ACPI_FREE (Hid);
400 
401  if (Match)
402  {
403  return (TRUE);
404  }
405 
406  /* The _HID did not match. Get the _CID and check for a PCI Root Bridge */
407 
408  Status = AcpiUtExecute_CID (Node, &Cid);
409  if (ACPI_FAILURE (Status))
410  {
411  return (FALSE);
412  }
413 
414  /* Check all _CIDs in the returned list */
415 
416  for (i = 0; i < Cid->Count; i++)
417  {
418  if (AcpiUtIsPciRootBridge (Cid->Ids[i].String))
419  {
420  ACPI_FREE (Cid);
421  return (TRUE);
422  }
423  }
424 
425  ACPI_FREE (Cid);
426  return (FALSE);
427 }
#define ACPI_FREE(a)
Definition: actypes.h:386
#define TRUE
Definition: types.h:120
ACPI_PNP_DEVICE_ID Ids[1]
Definition: actypes.h:1272
BOOLEAN AcpiUtIsPciRootBridge(char *Id)
Definition: utmisc.c:66
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
unsigned char BOOLEAN
ACPI_STATUS AcpiUtExecute_HID(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
Definition: utids.c:72
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiUtExecute_CID(ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID_LIST **ReturnCidList)
Definition: utids.c:253
Definition: dlist.c:348

Referenced by AcpiEvPciConfigRegionSetup().

◆ AcpiEvLowGetGpeInfo()

ACPI_GPE_EVENT_INFO* AcpiEvLowGetGpeInfo ( UINT32  GpeNumber,
ACPI_GPE_BLOCK_INFO GpeBlock 
)

Definition at line 327 of file evgpe.c.

330 {
331  UINT32 GpeIndex;
332 
333 
334  /*
335  * Validate that the GpeNumber is within the specified GpeBlock.
336  * (Two steps)
337  */
338  if (!GpeBlock ||
339  (GpeNumber < GpeBlock->BlockBaseNumber))
340  {
341  return (NULL);
342  }
343 
344  GpeIndex = GpeNumber - GpeBlock->BlockBaseNumber;
345  if (GpeIndex >= GpeBlock->GpeCount)
346  {
347  return (NULL);
348  }
349 
350  return (&GpeBlock->EventInfo[GpeIndex]);
351 }
unsigned int UINT32
smooth NULL
Definition: ftsmooth.c:416
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
ACPI_GPE_EVENT_INFO * EventInfo
Definition: aclocal.h:588
UINT16 BlockBaseNumber
Definition: aclocal.h:592

Referenced by AcpiEvGetGpeEventInfo(), and AcpiEvMatchGpeMethod().

◆ AcpiEvMaskGpe()

ACPI_STATUS AcpiEvMaskGpe ( ACPI_GPE_EVENT_INFO GpeEventInfo,
BOOLEAN  IsMasked 
)

Definition at line 156 of file evgpe.c.

159 {
160  ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
161  UINT32 RegisterBit;
162 
163 
164  ACPI_FUNCTION_TRACE (EvMaskGpe);
165 
166 
167  GpeRegisterInfo = GpeEventInfo->RegisterInfo;
168  if (!GpeRegisterInfo)
169  {
171  }
172 
173  RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
174 
175  /* Perform the action */
176 
177  if (IsMasked)
178  {
179  if (RegisterBit & GpeRegisterInfo->MaskForRun)
180  {
182  }
183 
185  ACPI_SET_BIT (GpeRegisterInfo->MaskForRun, (UINT8) RegisterBit);
186  }
187  else
188  {
189  if (!(RegisterBit & GpeRegisterInfo->MaskForRun))
190  {
192  }
193 
194  ACPI_CLEAR_BIT (GpeRegisterInfo->MaskForRun, (UINT8) RegisterBit);
195  if (GpeEventInfo->RuntimeCount &&
197  {
199  }
200  }
201 
203 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
BOOLEAN DisableForDispatch
Definition: aclocal.h:559
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_SET_BIT(target, bit)
Definition: actypes.h:533
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
unsigned int UINT32
UINT32 AcpiHwGetGpeRegisterBit(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: hwgpe.c:81
struct acpi_gpe_register_info * RegisterInfo
Definition: aclocal.h:555
#define ACPI_CLEAR_BIT(target, bit)
Definition: actypes.h:534
#define AE_NOT_EXIST
Definition: acexcep.h:114
#define ACPI_GPE_ENABLE
Definition: actypes.h:793
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_GPE_DISABLE
Definition: actypes.h:794
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97
ACPI_STATUS AcpiHwLowSetGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 Action)
Definition: hwgpe.c:106

Referenced by AcpiMaskGpe().

◆ AcpiEvPciBarRegionSetup()

ACPI_STATUS AcpiEvPciBarRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 448 of file evrgnini.c.

453 {
454  ACPI_FUNCTION_TRACE (EvPciBarRegionSetup);
455 
456 
458 }
#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 AcpiEvInstallSpaceHandler().

◆ AcpiEvPciConfigRegionSetup()

ACPI_STATUS AcpiEvPciConfigRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 176 of file evrgnini.c.

181 {
183  UINT64 PciValue;
184  ACPI_PCI_ID *PciId = *RegionContext;
185  ACPI_OPERAND_OBJECT *HandlerObj;
186  ACPI_NAMESPACE_NODE *ParentNode;
187  ACPI_NAMESPACE_NODE *PciRootNode;
188  ACPI_NAMESPACE_NODE *PciDeviceNode;
190 
191 
192  ACPI_FUNCTION_TRACE (EvPciConfigRegionSetup);
193 
194 
195  HandlerObj = RegionObj->Region.Handler;
196  if (!HandlerObj)
197  {
198  /*
199  * No installed handler. This shouldn't happen because the dispatch
200  * routine checks before we get here, but we check again just in case.
201  */
203  "Attempting to init a region %p, with no handler\n", RegionObj));
205  }
206 
207  *RegionContext = NULL;
209  {
210  if (PciId)
211  {
212  ACPI_FREE (PciId);
213  }
215  }
216 
217  ParentNode = RegionObj->Region.Node->Parent;
218 
219  /*
220  * Get the _SEG and _BBN values from the device upon which the handler
221  * is installed.
222  *
223  * We need to get the _SEG and _BBN objects relative to the PCI BUS device.
224  * This is the device the handler has been registered to handle.
225  */
226 
227  /*
228  * If the AddressSpace.Node is still pointing to the root, we need
229  * to scan upward for a PCI Root bridge and re-associate the OpRegion
230  * handlers with that device.
231  */
232  if (HandlerObj->AddressSpace.Node == AcpiGbl_RootNode)
233  {
234  /* Start search from the parent object */
235 
236  PciRootNode = ParentNode;
237  while (PciRootNode != AcpiGbl_RootNode)
238  {
239  /* Get the _HID/_CID in order to detect a RootBridge */
240 
241  if (AcpiEvIsPciRootBridge (PciRootNode))
242  {
243  /* Install a handler for this PCI root bridge */
244 
246  (ACPI_HANDLE) PciRootNode,
249  if (ACPI_FAILURE (Status))
250  {
251  if (Status == AE_SAME_HANDLER)
252  {
253  /*
254  * It is OK if the handler is already installed on the
255  * root bridge. Still need to return a context object
256  * for the new PCI_Config operation region, however.
257  */
258  Status = AE_OK;
259  }
260  else
261  {
263  "Could not install PciConfig handler "
264  "for Root Bridge %4.4s",
265  AcpiUtGetNodeName (PciRootNode)));
266  }
267  }
268  break;
269  }
270 
271  PciRootNode = PciRootNode->Parent;
272  }
273 
274  /* PCI root bridge not found, use namespace root node */
275  }
276  else
277  {
278  PciRootNode = HandlerObj->AddressSpace.Node;
279  }
280 
281  /*
282  * If this region is now initialized, we are done.
283  * (InstallAddressSpaceHandler could have initialized it)
284  */
285  if (RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)
286  {
288  }
289 
290  /* Region is still not initialized. Create a new context */
291 
292  PciId = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PCI_ID));
293  if (!PciId)
294  {
296  }
297 
298  /*
299  * For PCI_Config space access, we need the segment, bus, device and
300  * function numbers. Acquire them here.
301  *
302  * Find the parent device object. (This allows the operation region to be
303  * within a subscope under the device, such as a control method.)
304  */
305  PciDeviceNode = RegionObj->Region.Node;
306  while (PciDeviceNode && (PciDeviceNode->Type != ACPI_TYPE_DEVICE))
307  {
308  PciDeviceNode = PciDeviceNode->Parent;
309  }
310 
311  if (!PciDeviceNode)
312  {
313  ACPI_FREE (PciId);
315  }
316 
317  /*
318  * Get the PCI device and function numbers from the _ADR object
319  * contained in the parent's scope.
320  */
322  PciDeviceNode, &PciValue);
323 
324  /*
325  * The default is zero, and since the allocation above zeroed the data,
326  * just do nothing on failure.
327  */
328  if (ACPI_SUCCESS (Status))
329  {
330  PciId->Device = ACPI_HIWORD (ACPI_LODWORD (PciValue));
331  PciId->Function = ACPI_LOWORD (ACPI_LODWORD (PciValue));
332  }
333 
334  /* The PCI segment number comes from the _SEG method */
335 
337  PciRootNode, &PciValue);
338  if (ACPI_SUCCESS (Status))
339  {
340  PciId->Segment = ACPI_LOWORD (PciValue);
341  }
342 
343  /* The PCI bus number comes from the _BBN method */
344 
346  PciRootNode, &PciValue);
347  if (ACPI_SUCCESS (Status))
348  {
349  PciId->Bus = ACPI_LOWORD (PciValue);
350  }
351 
352  /* Complete/update the PCI ID for this device */
353 
354  Status = AcpiHwDerivePciId (PciId, PciRootNode, RegionObj->Region.Node);
355  if (ACPI_FAILURE (Status))
356  {
357  ACPI_FREE (PciId);
359  }
360 
361  *RegionContext = PciId;
363 }
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_LODWORD(Integer64)
Definition: actypes.h:530
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:413
#define METHOD_NAME__SEG
Definition: acnames.h:71
union acpi_operand_object * Handler
Definition: acobject.h:204
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define METHOD_NAME__ADR
Definition: acnames.h:49
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_NAMESPACE_NODE * Node
Definition: acobject.h:203
#define AE_SAME_HANDLER
Definition: acexcep.h:133
UINT16 Bus
Definition: actypes.h:1327
#define ACPI_LOWORD(Integer)
Definition: actypes.h:528
ACPI_STATUS AcpiUtEvaluateNumericObject(const char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, UINT64 *Value)
Definition: uteval.c:221
BOOLEAN AcpiEvIsPciRootBridge(ACPI_NAMESPACE_NODE *Node)
Definition: evrgnini.c:380
UINT16 Device
Definition: actypes.h:1328
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1221
UINT32 ACPI_STATUS
Definition: actypes.h:460
struct acpi_namespace_node * Parent
Definition: aclocal.h:192
#define AE_AML_OPERAND_TYPE
Definition: acexcep.h:182
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
#define METHOD_NAME__BBN
Definition: acnames.h:51
#define AOPOBJ_SETUP_COMPLETE
Definition: acobject.h:99
#define AE_INFO
Definition: acoutput.h:230
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DB_OPREGION
Definition: acoutput.h:167
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
ACPI_STATUS AcpiInstallAddressSpaceHandler(ACPI_HANDLE Device, ACPI_ADR_SPACE_TYPE SpaceId, ACPI_ADR_SPACE_HANDLER Handler, ACPI_ADR_SPACE_SETUP Setup, void *Context)
Definition: evxfregn.c:79
_In_ HANDLE Handle
Definition: extypes.h:390
UINT16 Segment
Definition: actypes.h:1326
#define ACPI_DEFAULT_HANDLER
Definition: actypes.h:1200
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define AE_NOT_EXIST
Definition: acexcep.h:114
ACPI_OBJECT_ADDR_HANDLER AddressSpace
Definition: acobject.h:536
ACPI_STATUS AcpiHwDerivePciId(ACPI_PCI_ID *PciId, ACPI_HANDLE RootPciDevice, ACPI_HANDLE PciRegion)
Definition: hwpci.c:137
#define ACPI_HIWORD(Integer)
Definition: actypes.h:529
#define ACPI_TYPE_DEVICE
Definition: actypes.h:684
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_ADR_SPACE_PCI_CONFIG
Definition: actypes.h:853
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
UINT16 Function
Definition: actypes.h:1329
unsigned long long UINT64
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvInstallSpaceHandler().

◆ AcpiEvQueueNotifyRequest()

ACPI_STATUS AcpiEvQueueNotifyRequest ( ACPI_NAMESPACE_NODE Node,
UINT32  NotifyValue 
)

Definition at line 111 of file evmisc.c.

114 {
115  ACPI_OPERAND_OBJECT *ObjDesc;
116  ACPI_OPERAND_OBJECT *HandlerListHead = NULL;
118  UINT8 HandlerListId = 0;
120 
121 
122  ACPI_FUNCTION_NAME (EvQueueNotifyRequest);
123 
124 
125  /* Are Notifies allowed on this object? */
126 
127  if (!AcpiEvIsNotifyObject (Node))
128  {
129  return (AE_TYPE);
130  }
131 
132  /* Get the correct notify list type (System or Device) */
133 
134  if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
135  {
136  HandlerListId = ACPI_SYSTEM_HANDLER_LIST;
137  }
138  else
139  {
140  HandlerListId = ACPI_DEVICE_HANDLER_LIST;
141  }
142 
143  /* Get the notify object attached to the namespace Node */
144 
145  ObjDesc = AcpiNsGetAttachedObject (Node);
146  if (ObjDesc)
147  {
148  /* We have an attached object, Get the correct handler list */
149 
150  HandlerListHead = ObjDesc->CommonNotify.NotifyList[HandlerListId];
151  }
152 
153  /*
154  * If there is no notify handler (Global or Local)
155  * for this object, just ignore the notify
156  */
157  if (!AcpiGbl_GlobalNotify[HandlerListId].Handler && !HandlerListHead)
158  {
160  "No notify handler for Notify, ignoring (%4.4s, %X) node %p\n",
161  AcpiUtGetNodeName (Node), NotifyValue, Node));
162 
163  return (AE_OK);
164  }
165 
166  /* Setup notify info and schedule the notify dispatcher */
167 
169  if (!Info)
170  {
171  return (AE_NO_MEMORY);
172  }
173 
174  Info->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
175 
176  Info->Notify.Node = Node;
177  Info->Notify.Value = (UINT16) NotifyValue;
178  Info->Notify.HandlerListId = HandlerListId;
179  Info->Notify.HandlerListHead = HandlerListHead;
180  Info->Notify.Global = &AcpiGbl_GlobalNotify[HandlerListId];
181 
183  "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
185  NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
186 
189  if (ACPI_FAILURE (Status))
190  {
192  }
193 
194  return (Status);
195 }
void AcpiUtDeleteGenericState(ACPI_GENERIC_STATE *State)
Definition: utstate.c:340
#define AE_NO_MEMORY
Definition: acexcep.h:112
ACPI_GENERIC_STATE * AcpiUtCreateGenericState(void)
Definition: utstate.c:130
#define ACPI_MAX_SYS_NOTIFY
Definition: actypes.h:840
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_SYSTEM_HANDLER_LIST
Definition: actypes.h:843
struct TraceInfo Info
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
union node Node
Definition: types.h:1255
smooth NULL
Definition: ftsmooth.c:416
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
static void ACPI_SYSTEM_XFACE AcpiEvNotifyDispatch(void *Context)
Definition: evmisc.c:212
#define ACPI_TYPE_ANY
Definition: actypes.h:678
#define AE_TYPE
Definition: acexcep.h:116
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:662
Status
Definition: gdiplustypes.h:24
#define ACPI_DB_INFO
Definition: acoutput.h:153
unsigned short UINT16
const char * AcpiUtGetTypeName(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:249
BOOLEAN AcpiEvIsNotifyObject(ACPI_NAMESPACE_NODE *Node)
Definition: evmisc.c:75
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:305
ACPI_OBJECT_NOTIFY_COMMON CommonNotify
Definition: acobject.h:525
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
#define ACPI_DESC_TYPE_STATE_NOTIFY
Definition: acobject.h:569
unsigned char UINT8
ACPI_STATUS AcpiOsExecute(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, void *Context)
Definition: osl.c:224
#define AE_OK
Definition: acexcep.h:97
Definition: dlist.c:348
#define ACPI_DEVICE_HANDLER_LIST
Definition: actypes.h:844

Referenced by AcpiEvAsynchExecuteGpeMethod(), and AcpiExOpcode_2A_0T_0R().

◆ 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().

◆ AcpiEvRemoveGpeReference()

ACPI_STATUS AcpiEvRemoveGpeReference ( ACPI_GPE_EVENT_INFO GpeEventInfo)

Definition at line 276 of file evgpe.c.

278 {
280 
281 
282  ACPI_FUNCTION_TRACE (EvRemoveGpeReference);
283 
284 
286  {
288  }
289 
292  {
293  /* Disable on last reference */
294 
296  if (ACPI_SUCCESS (Status))
297  {
299  }
300 
301  if (ACPI_FAILURE (Status))
302  {
304  }
305  }
306 
308 }
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
ACPI_STATUS AcpiEvUpdateGpeEnableMask(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:79
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define AE_LIMIT
Definition: acexcep.h:124
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
Status
Definition: gdiplustypes.h:24
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_GPE_DISABLE
Definition: actypes.h:794
#define AE_OK
Definition: acexcep.h:97
ACPI_STATUS AcpiHwLowSetGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 Action)
Definition: hwgpe.c:106

Referenced by AcpiDisableGpe(), AcpiEvInstallGpeHandler(), and AcpiSetupGpeForWake().

◆ 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:1238
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().

◆ AcpiEvSystemMemoryRegionSetup()

ACPI_STATUS AcpiEvSystemMemoryRegionSetup ( ACPI_HANDLE  Handle,
UINT32  Function,
void HandlerContext,
void **  RegionContext 
)

Definition at line 70 of file evrgnini.c.

75 {
77  ACPI_MEM_SPACE_CONTEXT *LocalRegionContext;
78 
79 
80  ACPI_FUNCTION_TRACE (EvSystemMemoryRegionSetup);
81 
82 
84  {
85  if (*RegionContext)
86  {
87  LocalRegionContext = (ACPI_MEM_SPACE_CONTEXT *) *RegionContext;
88 
89  /* Delete a cached mapping if present */
90 
91  if (LocalRegionContext->MappedLength)
92  {
93  AcpiOsUnmapMemory (LocalRegionContext->MappedLogicalAddress,
94  LocalRegionContext->MappedLength);
95  }
96  ACPI_FREE (LocalRegionContext);
97  *RegionContext = NULL;
98  }
100  }
101 
102  /* Create a new context */
103 
104  LocalRegionContext = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_MEM_SPACE_CONTEXT));
105  if (!(LocalRegionContext))
106  {
108  }
109 
110  /* Save the region length and address for use in the handler */
111 
112  LocalRegionContext->Length = RegionDesc->Region.Length;
113  LocalRegionContext->Address = RegionDesc->Region.Address;
114 
115  *RegionContext = LocalRegionContext;
117 }
#define ACPI_FREE(a)
Definition: actypes.h:386
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define ACPI_REGION_DEACTIVATE
Definition: actypes.h:1221
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
smooth NULL
Definition: ftsmooth.c:416
ACPI_SIZE MappedLength
Definition: actypes.h:1339
ACPI_OBJECT_REGION Region
Definition: acobject.h:524
_In_ HANDLE Handle
Definition: extypes.h:390
ACPI_PHYSICAL_ADDRESS Address
Definition: actypes.h:1336
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_PHYSICAL_ADDRESS Address
Definition: acobject.h:206
UINT8 * MappedLogicalAddress
Definition: actypes.h:1338
#define AE_OK
Definition: acexcep.h:97
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Size)
Definition: osl.c:128

Referenced by AcpiEvInstallSpaceHandler().

◆ AcpiEvUpdateGpeEnableMask()

ACPI_STATUS AcpiEvUpdateGpeEnableMask ( ACPI_GPE_EVENT_INFO GpeEventInfo)

Definition at line 79 of file evgpe.c.

81 {
82  ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
83  UINT32 RegisterBit;
84 
85 
86  ACPI_FUNCTION_TRACE (EvUpdateGpeEnableMask);
87 
88 
89  GpeRegisterInfo = GpeEventInfo->RegisterInfo;
90  if (!GpeRegisterInfo)
91  {
93  }
94 
95  RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
96 
97  /* Clear the run bit up front */
98 
99  ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
100 
101  /* Set the mask bit only if there are references to this GPE */
102 
104  {
105  ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
106  }
107 
108  GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
110 }
#define ACPI_SET_BIT(target, bit)
Definition: actypes.h:533
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
unsigned int UINT32
UINT32 AcpiHwGetGpeRegisterBit(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: hwgpe.c:81
struct acpi_gpe_register_info * RegisterInfo
Definition: aclocal.h:555
#define ACPI_CLEAR_BIT(target, bit)
Definition: actypes.h:534
#define AE_NOT_EXIST
Definition: acexcep.h:114
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvAddGpeReference(), and AcpiEvRemoveGpeReference().

◆ AcpiEvWalkGpeList()

ACPI_STATUS AcpiEvWalkGpeList ( ACPI_GPE_CALLBACK  GpeWalkCallback,
void Context 
)

Definition at line 67 of file evgpeutil.c.

70 {
71  ACPI_GPE_BLOCK_INFO *GpeBlock;
72  ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
75 
76 
77  ACPI_FUNCTION_TRACE (EvWalkGpeList);
78 
79 
80  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
81 
82  /* Walk the interrupt level descriptor list */
83 
84  GpeXruptInfo = AcpiGbl_GpeXruptListHead;
85  while (GpeXruptInfo)
86  {
87  /* Walk all Gpe Blocks attached to this interrupt level */
88 
89  GpeBlock = GpeXruptInfo->GpeBlockListHead;
90  while (GpeBlock)
91  {
92  /* One callback per GPE block */
93 
94  Status = GpeWalkCallback (GpeXruptInfo, GpeBlock, Context);
95  if (ACPI_FAILURE (Status))
96  {
97  if (Status == AE_CTRL_END) /* Callback abort */
98  {
99  Status = AE_OK;
100  }
101  goto UnlockAndExit;
102  }
103 
104  GpeBlock = GpeBlock->Next;
105  }
106 
107  GpeXruptInfo = GpeXruptInfo->Next;
108  }
109 
110 UnlockAndExit:
111  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
113 }
struct acpi_gpe_block_info * Next
Definition: aclocal.h:585
#define AE_CTRL_END
Definition: acexcep.h:230
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
struct acpi_gpe_xrupt_info * Next
Definition: aclocal.h:603
#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
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_GPE_BLOCK_INFO * GpeBlockListHead
Definition: aclocal.h:604
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
#define AE_OK
Definition: acexcep.h:97

Referenced by AcpiEvTerminate(), AcpiGetGpeDevice(), AcpiHwClearAcpiStatus(), AcpiHwDisableAllGpes(), AcpiHwEnableAllRuntimeGpes(), AcpiHwEnableAllWakeupGpes(), and AcpiUpdateAllGpes().

Variable Documentation

◆ Context

Definition at line 214 of file acevents.h.

◆ GpeEventInfo

◆ GpeNumber

◆ Level

UINT32 Level

Definition at line 214 of file acevents.h.

◆ ReturnValue