ReactOS  0.4.15-dev-1207-g698a8e6
evxfgpe.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
Include dependency graph for evxfgpe.c:

Go to the source code of this file.

Macros

#define EXPORT_ACPI_INTERFACES
 
#define _COMPONENT   ACPI_EVENTS
 

Functions

ACPI_STATUS AcpiUpdateAllGpes (void)
 
ACPI_STATUS AcpiEnableGpe (ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_STATUS AcpiDisableGpe (ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_STATUS AcpiSetGpe (ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT8 Action)
 
ACPI_STATUS AcpiMaskGpe (ACPI_HANDLE GpeDevice, UINT32 GpeNumber, BOOLEAN IsMasked)
 
ACPI_STATUS AcpiMarkGpeForWake (ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_STATUS AcpiSetupGpeForWake (ACPI_HANDLE WakeDevice, ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_STATUS AcpiSetGpeWakeMask (ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT8 Action)
 
ACPI_STATUS AcpiClearGpe (ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_STATUS AcpiGetGpeStatus (ACPI_HANDLE GpeDevice, UINT32 GpeNumber, ACPI_EVENT_STATUS *EventStatus)
 
UINT32 AcpiDispatchGpe (ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_STATUS AcpiFinishGpe (ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
 
ACPI_STATUS AcpiDisableAllGpes (void)
 
ACPI_STATUS AcpiEnableAllRuntimeGpes (void)
 
ACPI_STATUS AcpiEnableAllWakeupGpes (void)
 
UINT32 AcpiAnyGpeStatusSet (void)
 
ACPI_STATUS AcpiInstallGpeBlock (ACPI_HANDLE GpeDevice, ACPI_GENERIC_ADDRESS *GpeBlockAddress, UINT32 RegisterCount, UINT32 InterruptNumber)
 
ACPI_STATUS AcpiRemoveGpeBlock (ACPI_HANDLE GpeDevice)
 
ACPI_STATUS AcpiGetGpeDevice (UINT32 Index, ACPI_HANDLE *GpeDevice)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EVENTS

Definition at line 51 of file evxfgpe.c.

◆ EXPORT_ACPI_INTERFACES

#define EXPORT_ACPI_INTERFACES

Definition at line 44 of file evxfgpe.c.

Function Documentation

◆ AcpiAnyGpeStatusSet()

UINT32 AcpiAnyGpeStatusSet ( void  )

Definition at line 974 of file evxfgpe.c.

976 {
978  UINT8 Ret;
979 
980 
982 
984  if (ACPI_FAILURE (Status))
985  {
986  return (FALSE);
987  }
988 
989  Ret = AcpiHwCheckAllGpes ();
991 
992  return (Ret);
993 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
UINT32 ACPI_STATUS
Definition: actypes.h:460
UINT32 AcpiAnyGpeStatusSet(void)
Definition: evxfgpe.c:974
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
#define FALSE
Definition: types.h:117
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
Status
Definition: gdiplustypes.h:24
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_MTX_EVENTS
Definition: aclocal.h:87
UINT8 AcpiHwCheckAllGpes(void)
Definition: hwgpe.c:677
unsigned char UINT8

◆ AcpiClearGpe()

ACPI_STATUS AcpiClearGpe ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 685 of file evxfgpe.c.

688 {
692 
693 
695 
696 
697  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
698 
699  /* Ensure that we have a valid GPE number */
700 
702  if (!GpeEventInfo)
703  {
705  goto UnlockAndExit;
706  }
707 
709 
710 UnlockAndExit:
711  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
713 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
ACPI_STATUS AcpiHwClearGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: hwgpe.c:190
ACPI_STATUS AcpiClearGpe(ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evxfgpe.c:685
#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

◆ AcpiDisableAllGpes()

ACPI_STATUS AcpiDisableAllGpes ( void  )

Definition at line 861 of file evxfgpe.c.

863 {
865 
866 
868 
869 
871  if (ACPI_FAILURE (Status))
872  {
874  }
875 
878 
880 }
ACPI_STATUS AcpiHwDisableAllGpes(void)
Definition: hwgpe.c:595
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
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
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_EVENTS
Definition: aclocal.h:87
ACPI_STATUS AcpiDisableAllGpes(void)
Definition: evxfgpe.c:861

◆ AcpiDisableGpe()

ACPI_STATUS AcpiDisableGpe ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 203 of file evxfgpe.c.

206 {
210 
211 
213 
214 
215  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
216 
217  /* Ensure that we have a valid GPE number */
218 
220  if (GpeEventInfo)
221  {
223  }
224 
225  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
227 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
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
ACPI_STATUS AcpiDisableGpe(ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evxfgpe.c:203
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ACPI_STATUS AcpiEvRemoveGpeReference(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:276
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#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

◆ AcpiDispatchGpe()

UINT32 AcpiDispatchGpe ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 785 of file evxfgpe.c.

788 {
789  ACPI_FUNCTION_TRACE(acpi_dispatch_gpe);
790 
791  return (AcpiEvDetectGpe (GpeDevice, NULL, GpeNumber));
792 }
smooth NULL
Definition: ftsmooth.c:416
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
UINT32 AcpiEvDetectGpe(ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber)
Definition: evgpe.c:722

◆ AcpiEnableAllRuntimeGpes()

ACPI_STATUS AcpiEnableAllRuntimeGpes ( void  )

Definition at line 898 of file evxfgpe.c.

900 {
902 
903 
905 
906 
908  if (ACPI_FAILURE (Status))
909  {
911  }
912 
915 
917 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
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
ACPI_STATUS AcpiHwEnableAllRuntimeGpes(void)
Definition: hwgpe.c:622
ACPI_STATUS AcpiEnableAllRuntimeGpes(void)
Definition: evxfgpe.c:898
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_EVENTS
Definition: aclocal.h:87

◆ AcpiEnableAllWakeupGpes()

ACPI_STATUS AcpiEnableAllWakeupGpes ( void  )

Definition at line 936 of file evxfgpe.c.

938 {
940 
941 
943 
944 
946  if (ACPI_FAILURE (Status))
947  {
949  }
950 
953 
955 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
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
ACPI_STATUS AcpiHwEnableAllWakeupGpes(void)
Definition: hwgpe.c:649
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiEnableAllWakeupGpes(void)
Definition: evxfgpe.c:936
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_MTX_EVENTS
Definition: aclocal.h:87

◆ AcpiEnableGpe()

ACPI_STATUS AcpiEnableGpe ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 137 of file evxfgpe.c.

140 {
144 
145 
147 
148 
149  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
150 
151  /*
152  * Ensure that we have a valid GPE number and that there is some way
153  * of handling the GPE (handler or a GPE method). In other words, we
154  * won't allow a valid GPE to be enabled if there is no way to handle it.
155  */
157  if (GpeEventInfo)
158  {
161  {
163  if (ACPI_SUCCESS (Status) &&
165  {
166  /* Poll edge-triggered GPEs to handle existing events */
167 
168  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
170  GpeDevice, GpeEventInfo, GpeNumber);
171  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
172  }
173  }
174  else
175  {
177  }
178  }
179 
180  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
182 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define TRUE
Definition: types.h:120
#define ACPI_GPE_DISPATCH_NONE
Definition: actypes.h:810
#define ACPI_GPE_DISPATCH_TYPE(flags)
Definition: actypes.h:816
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
ACPI_STATUS AcpiEvAddGpeReference(ACPI_GPE_EVENT_INFO *GpeEventInfo, BOOLEAN ClearOnEnable)
Definition: evgpe.c:221
#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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ACPI_STATUS AcpiEnableGpe(ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evxfgpe.c:137
#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__)
Definition: acevents.h:59
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
UINT32 AcpiEvDetectGpe(ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber)
Definition: evgpe.c:722
#define AE_NO_HANDLER
Definition: acexcep.h:134
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516

◆ AcpiFinishGpe()

ACPI_STATUS AcpiFinishGpe ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 815 of file evxfgpe.c.

818 {
822 
823 
825 
826 
827  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
828 
829  /* Ensure that we have a valid GPE number */
830 
832  if (!GpeEventInfo)
833  {
835  goto UnlockAndExit;
836  }
837 
839 
840 UnlockAndExit:
841  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
843 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiEvFinishGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:670
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
ACPI_STATUS AcpiFinishGpe(ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evxfgpe.c:815

◆ AcpiGetGpeDevice()

ACPI_STATUS AcpiGetGpeDevice ( UINT32  Index,
ACPI_HANDLE GpeDevice 
)

Definition at line 1207 of file evxfgpe.c.

1210 {
1213 
1214 
1216 
1217 
1218  if (!GpeDevice)
1219  {
1221  }
1222 
1223  if (Index >= AcpiCurrentGpeCount)
1224  {
1226  }
1227 
1228  /* Setup and walk the GPE list */
1229 
1230  Info.Index = Index;
1231  Info.Status = AE_NOT_EXIST;
1232  Info.GpeDevice = NULL;
1233  Info.NextBlockBaseIndex = 0;
1234 
1236  if (ACPI_FAILURE (Status))
1237  {
1239  }
1240 
1241  *GpeDevice = ACPI_CAST_PTR (ACPI_HANDLE, Info.GpeDevice);
1242  return_ACPI_STATUS (Info.Status);
1243 }
ACPI_STATUS AcpiEvGetGpeDevice(ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
Definition: evgpeutil.c:130
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
UINT32 ACPI_STATUS
Definition: actypes.h:460
struct TraceInfo Info
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18
Status
Definition: gdiplustypes.h:24
#define AE_NOT_EXIST
Definition: acexcep.h:114
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
ACPI_STATUS AcpiGetGpeDevice(UINT32 Index, ACPI_HANDLE *GpeDevice)
Definition: evxfgpe.c:1207
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_STATUS AcpiEvWalkGpeList(ACPI_GPE_CALLBACK GpeWalkCallback, void *Context)
Definition: evgpeutil.c:67
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544

◆ AcpiGetGpeStatus()

ACPI_STATUS AcpiGetGpeStatus ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber,
ACPI_EVENT_STATUS EventStatus 
)

Definition at line 734 of file evxfgpe.c.

738 {
742 
743 
745 
746 
747  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
748 
749  /* Ensure that we have a valid GPE number */
750 
752  if (!GpeEventInfo)
753  {
755  goto UnlockAndExit;
756  }
757 
758  /* Obtain status on the requested GPE number */
759 
760  Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus);
761 
762 UnlockAndExit:
763  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
765 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
ACPI_STATUS AcpiGetGpeStatus(ACPI_HANDLE GpeDevice, UINT32 GpeNumber, ACPI_EVENT_STATUS *EventStatus)
Definition: evxfgpe.c:734
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ACPI_STATUS AcpiHwGetGpeStatus(ACPI_GPE_EVENT_INFO *GpeEventInfo, ACPI_EVENT_STATUS *EventStatus)
Definition: hwgpe.c:233
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#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

◆ AcpiInstallGpeBlock()

ACPI_STATUS AcpiInstallGpeBlock ( ACPI_HANDLE  GpeDevice,
ACPI_GENERIC_ADDRESS GpeBlockAddress,
UINT32  RegisterCount,
UINT32  InterruptNumber 
)

Definition at line 1015 of file evxfgpe.c.

1020 {
1022  ACPI_OPERAND_OBJECT *ObjDesc;
1024  ACPI_GPE_BLOCK_INFO *GpeBlock;
1025 
1026 
1028 
1029 
1030  if ((!GpeDevice) ||
1031  (!GpeBlockAddress) ||
1032  (!RegisterCount))
1033  {
1035  }
1036 
1038  if (ACPI_FAILURE (Status))
1039  {
1041  }
1042 
1043  Node = AcpiNsValidateHandle (GpeDevice);
1044  if (!Node)
1045  {
1047  goto UnlockAndExit;
1048  }
1049 
1050  /* Validate the parent device */
1051 
1052  if (Node->Type != ACPI_TYPE_DEVICE)
1053  {
1054  Status = AE_TYPE;
1055  goto UnlockAndExit;
1056  }
1057 
1058  if (Node->Object)
1059  {
1061  goto UnlockAndExit;
1062  }
1063 
1064  /*
1065  * For user-installed GPE Block Devices, the GpeBlockBaseNumber
1066  * is always zero
1067  */
1068  Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
1069  GpeBlockAddress->SpaceId, RegisterCount,
1070  0, InterruptNumber, &GpeBlock);
1071  if (ACPI_FAILURE (Status))
1072  {
1073  goto UnlockAndExit;
1074  }
1075 
1076  /* Install block in the DeviceObject attached to the node */
1077 
1078  ObjDesc = AcpiNsGetAttachedObject (Node);
1079  if (!ObjDesc)
1080  {
1081  /*
1082  * No object, create a new one (Device nodes do not always have
1083  * an attached object)
1084  */
1086  if (!ObjDesc)
1087  {
1088  Status = AE_NO_MEMORY;
1089  goto UnlockAndExit;
1090  }
1091 
1093 
1094  /* Remove local reference to the object */
1095 
1096  AcpiUtRemoveReference (ObjDesc);
1097  if (ACPI_FAILURE (Status))
1098  {
1099  goto UnlockAndExit;
1100  }
1101  }
1102 
1103  /* Now install the GPE block in the DeviceObject */
1104 
1105  ObjDesc->Device.GpeBlock = GpeBlock;
1106 
1107 
1108 UnlockAndExit:
1111 }
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:371
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
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
union node Node
Definition: types.h:1255
ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO ACPI_GPE_BLOCK_INFO * GpeBlock
Definition: acobject.h:270
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
ACPI_OPERAND_OBJECT * AcpiNsGetAttachedObject(ACPI_NAMESPACE_NODE *Node)
Definition: nsobject.c:308
Status
Definition: gdiplustypes.h:24
#define ACPI_TYPE_DEVICE
Definition: actypes.h:685
#define AE_TYPE
Definition: acexcep.h:116
ACPI_STATUS AcpiNsAttachObject(ACPI_NAMESPACE_NODE *Node, ACPI_OPERAND_OBJECT *Object, ACPI_OBJECT_TYPE Type)
Definition: nsobject.c:76
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:781
ACPI_OBJECT_DEVICE Device
Definition: acobject.h:527
ACPI_NAMESPACE_NODE * AcpiNsValidateHandle(ACPI_HANDLE Handle)
Definition: nsutils.c:655
#define AcpiUtCreateInternalObject(t)
Definition: acutils.h:655
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
ACPI_STATUS AcpiInstallGpeBlock(ACPI_HANDLE GpeDevice, ACPI_GENERIC_ADDRESS *GpeBlockAddress, UINT32 RegisterCount, UINT32 InterruptNumber)
Definition: evxfgpe.c:1015
Definition: dlist.c:348

◆ AcpiMarkGpeForWake()

ACPI_STATUS AcpiMarkGpeForWake ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 388 of file evxfgpe.c.

391 {
395 
396 
398 
399 
400  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
401 
402  /* Ensure that we have a valid GPE number */
403 
405  if (GpeEventInfo)
406  {
407  /* Mark the GPE as a possible wake event */
408 
410  Status = AE_OK;
411  }
412 
413  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
415 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_GPE_CAN_WAKE
Definition: actypes.h:822
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ACPI_STATUS AcpiMarkGpeForWake(ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evxfgpe.c:388
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#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

◆ AcpiMaskGpe()

ACPI_STATUS AcpiMaskGpe ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber,
BOOLEAN  IsMasked 
)

Definition at line 332 of file evxfgpe.c.

336 {
340 
341 
343 
344 
345  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
346 
347  /* Ensure that we have a valid GPE number */
348 
350  if (!GpeEventInfo)
351  {
353  goto UnlockAndExit;
354  }
355 
356  Status = AcpiEvMaskGpe (GpeEventInfo, IsMasked);
357 
358 UnlockAndExit:
359  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
361 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
ACPI_STATUS AcpiEvMaskGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo, BOOLEAN IsMasked)
Definition: evgpe.c:156
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Status
Definition: gdiplustypes.h:24
ACPI_STATUS AcpiMaskGpe(ACPI_HANDLE GpeDevice, UINT32 GpeNumber, BOOLEAN IsMasked)
Definition: evxfgpe.c:332
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#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

◆ AcpiRemoveGpeBlock()

ACPI_STATUS AcpiRemoveGpeBlock ( ACPI_HANDLE  GpeDevice)

Definition at line 1129 of file evxfgpe.c.

1131 {
1132  ACPI_OPERAND_OBJECT *ObjDesc;
1135 
1136 
1138 
1139 
1140  if (!GpeDevice)
1141  {
1143  }
1144 
1146  if (ACPI_FAILURE (Status))
1147  {
1149  }
1150 
1151  Node = AcpiNsValidateHandle (GpeDevice);
1152  if (!Node)
1153  {
1155  goto UnlockAndExit;
1156  }
1157 
1158  /* Validate the parent device */
1159 
1160  if (Node->Type != ACPI_TYPE_DEVICE)
1161  {
1162  Status = AE_TYPE;
1163  goto UnlockAndExit;
1164  }
1165 
1166  /* Get the DeviceObject attached to the node */
1167 
1168  ObjDesc = AcpiNsGetAttachedObject (Node);
1169  if (!ObjDesc ||
1170  !ObjDesc->Device.GpeBlock)
1171  {
1173  }
1174 
1175  /* Delete the GPE block (but not the DeviceObject) */
1176 
1178  if (ACPI_SUCCESS (Status))
1179  {
1180  ObjDesc->Device.GpeBlock = NULL;
1181  }
1182 
1183 UnlockAndExit:
1186 }
#define AE_NULL_OBJECT
Definition: acexcep.h:117
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
ACPI_STATUS AcpiRemoveGpeBlock(ACPI_HANDLE GpeDevice)
Definition: evxfgpe.c:1129
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
union node Node
Definition: types.h:1255
smooth NULL
Definition: ftsmooth.c:416
ACPI_STATUS AcpiEvDeleteGpeBlock(ACPI_GPE_BLOCK_INFO *GpeBlock)
Definition: evgpeblk.c:148
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
Status
Definition: gdiplustypes.h:24
#define ACPI_TYPE_DEVICE
Definition: actypes.h:685
#define AE_TYPE
Definition: acexcep.h:116
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_OBJECT_DEVICE Device
Definition: acobject.h:527
ACPI_NAMESPACE_NODE * AcpiNsValidateHandle(ACPI_HANDLE Handle)
Definition: nsutils.c:655
#define ACPI_MTX_NAMESPACE
Definition: aclocal.h:85
Definition: dlist.c:348

◆ AcpiSetGpe()

ACPI_STATUS AcpiSetGpe ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber,
UINT8  Action 
)

Definition at line 262 of file evxfgpe.c.

266 {
270 
271 
273 
274 
275  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
276 
277  /* Ensure that we have a valid GPE number */
278 
280  if (!GpeEventInfo)
281  {
283  goto UnlockAndExit;
284  }
285 
286  /* Perform the action */
287 
288  switch (Action)
289  {
290  case ACPI_GPE_ENABLE:
291 
294  break;
295 
296  case ACPI_GPE_DISABLE:
297 
300  break;
301 
302  default:
303 
305  break;
306  }
307 
308 UnlockAndExit:
309  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
311 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
BOOLEAN DisableForDispatch
Definition: aclocal.h:559
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define TRUE
Definition: types.h:120
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define FALSE
Definition: types.h:117
ACPI_STATUS AcpiSetGpe(ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT8 Action)
Definition: evxfgpe.c:262
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#define ACPI_GPE_ENABLE
Definition: actypes.h:794
#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:795
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
ACPI_STATUS AcpiHwLowSetGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 Action)
Definition: hwgpe.c:106

◆ AcpiSetGpeWakeMask()

ACPI_STATUS AcpiSetGpeWakeMask ( ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber,
UINT8  Action 
)

Definition at line 599 of file evxfgpe.c.

603 {
606  ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
608  UINT32 RegisterBit;
609 
610 
612 
613 
614  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
615 
616  /*
617  * Ensure that we have a valid GPE number and that this GPE is in
618  * fact a wake GPE
619  */
621  if (!GpeEventInfo)
622  {
624  goto UnlockAndExit;
625  }
626 
628  {
629  Status = AE_TYPE;
630  goto UnlockAndExit;
631  }
632 
633  GpeRegisterInfo = GpeEventInfo->RegisterInfo;
634  if (!GpeRegisterInfo)
635  {
637  goto UnlockAndExit;
638  }
639 
640  RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
641 
642  /* Perform the action */
643 
644  switch (Action)
645  {
646  case ACPI_GPE_ENABLE:
647 
648  ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
649  break;
650 
651  case ACPI_GPE_DISABLE:
652 
653  ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
654  break;
655 
656  default:
657 
658  ACPI_ERROR ((AE_INFO, "%u, Invalid action", Action));
660  break;
661  }
662 
663 UnlockAndExit:
664  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
666 }
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_SET_BIT(target, bit)
Definition: actypes.h:533
#define ACPI_GPE_CAN_WAKE
Definition: actypes.h:822
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
UINT32 AcpiHwGetGpeRegisterBit(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: hwgpe.c:81
struct acpi_gpe_register_info * RegisterInfo
Definition: aclocal.h:555
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
#define ACPI_CLEAR_BIT(target, bit)
Definition: actypes.h:534
Status
Definition: gdiplustypes.h:24
#define AE_NOT_EXIST
Definition: acexcep.h:114
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
ACPI_STATUS AcpiSetGpeWakeMask(ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT8 Action)
Definition: evxfgpe.c:599
#define ACPI_GPE_ENABLE
Definition: actypes.h:794
#define AE_TYPE
Definition: acexcep.h:116
#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 ACPI_GPE_DISABLE
Definition: actypes.h:795
void AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags)
Definition: osl.c:516
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97

◆ AcpiSetupGpeForWake()

ACPI_STATUS AcpiSetupGpeForWake ( ACPI_HANDLE  WakeDevice,
ACPI_HANDLE  GpeDevice,
UINT32  GpeNumber 
)

Definition at line 440 of file evxfgpe.c.

444 {
449  ACPI_GPE_NOTIFY_INFO *NewNotify;
451 
452 
454 
455 
456  /* Parameter Validation */
457 
458  if (!WakeDevice)
459  {
460  /*
461  * By forcing WakeDevice to be valid, we automatically enable the
462  * implicit notify feature on all hosts.
463  */
465  }
466 
467  /* Handle root object case */
468 
469  if (WakeDevice == ACPI_ROOT_OBJECT)
470  {
471  DeviceNode = AcpiGbl_RootNode;
472  }
473  else
474  {
476  }
477 
478  /* Validate WakeDevice is of type Device */
479 
480  if (DeviceNode->Type != ACPI_TYPE_DEVICE)
481  {
483  }
484 
485  /*
486  * Allocate a new notify object up front, in case it is needed.
487  * Memory allocation while holding a spinlock is a big no-no
488  * on some hosts.
489  */
490  NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO));
491  if (!NewNotify)
492  {
494  }
495 
496  Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
497 
498  /* Ensure that we have a valid GPE number */
499 
501  if (!GpeEventInfo)
502  {
504  goto UnlockAndExit;
505  }
506 
507  /*
508  * If there is no method or handler for this GPE, then the
509  * WakeDevice will be notified whenever this GPE fires. This is
510  * known as an "implicit notify". Note: The GPE is assumed to be
511  * level-triggered (for windows compatibility).
512  */
515  {
516  /*
517  * This is the first device for implicit notify on this GPE.
518  * Just set the flags here, and enter the NOTIFY block below.
519  */
522  }
524  {
525  /*
526  * A reference to this GPE has been added during the GPE block
527  * initialization, so drop it now to prevent the GPE from being
528  * permanently enabled and clear its ACPI_GPE_AUTO_ENABLED flag.
529  */
532  }
533 
534  /*
535  * If we already have an implicit notify on this GPE, add
536  * this device to the notify list.
537  */
540  {
541  /* Ensure that the device is not already in the list */
542 
544  while (Notify)
545  {
546  if (Notify->DeviceNode == DeviceNode)
547  {
549  goto UnlockAndExit;
550  }
551  Notify = Notify->Next;
552  }
553 
554  /* Add this device to the notify list for this GPE */
555 
556  NewNotify->DeviceNode = DeviceNode;
557  NewNotify->Next = GpeEventInfo->Dispatch.NotifyList;
558  GpeEventInfo->Dispatch.NotifyList = NewNotify;
559  NewNotify = NULL;
560  }
561 
562  /* Mark the GPE as a possible wake event */
563 
565  Status = AE_OK;
566 
567 
568 UnlockAndExit:
569  AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
570 
571  /* Delete the notify object if it was not used above */
572 
573  if (NewNotify)
574  {
575  ACPI_FREE (NewNotify);
576  }
578 }
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_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
ACPI_CPU_FLAGS AcpiOsAcquireLock(ACPI_SPINLOCK Handle)
Definition: osl.c:498
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_GPE_AUTO_ENABLED
Definition: actypes.h:823
#define ACPI_GPE_DISPATCH_NONE
Definition: actypes.h:810
#define ACPI_GPE_DISPATCH_TYPE(flags)
Definition: actypes.h:816
#define ACPI_GPE_CAN_WAKE
Definition: actypes.h:822
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
ACPI_STATUS AcpiSetupGpeForWake(ACPI_HANDLE WakeDevice, ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evxfgpe.c:440
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ACPI_GPE_DISPATCH_NOTIFY
Definition: actypes.h:813
union acpi_gpe_dispatch_info Dispatch
Definition: aclocal.h:554
smooth NULL
Definition: ftsmooth.c:416
ACPI_STATUS AcpiEvRemoveGpeReference(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:276
#define ACPI_ROOT_OBJECT
Definition: actypes.h:500
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
Definition: Node.h:9
#define ACPI_GPE_LEVEL_TRIGGERED
Definition: actypes.h:818
Status
Definition: gdiplustypes.h:24
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
#define ACPI_TYPE_DEVICE
Definition: actypes.h:685
struct acpi_gpe_notify_info * Next
Definition: aclocal.h:532
ACPI_NAMESPACE_NODE * DeviceNode
Definition: aclocal.h:531
#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 ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
#define AE_OK
Definition: acexcep.h:97

◆ AcpiUpdateAllGpes()

ACPI_STATUS AcpiUpdateAllGpes ( void  )

Definition at line 79 of file evxfgpe.c.

81 {
83  BOOLEAN IsPollingNeeded = FALSE;
84 
85 
87 
88 
90  if (ACPI_FAILURE (Status))
91  {
93  }
94 
95  if (AcpiGbl_AllGpesInitialized)
96  {
97  goto UnlockAndExit;
98  }
99 
101  &IsPollingNeeded);
102  if (ACPI_SUCCESS (Status))
103  {
104  AcpiGbl_AllGpesInitialized = TRUE;
105  }
106 
107 UnlockAndExit:
109 
110  if (IsPollingNeeded && AcpiGbl_AllGpesInitialized)
111  {
112  /* Poll GPEs to handle already triggered events */
113 
114  AcpiEvGpeDetect (AcpiGbl_GpeXruptListHead);
115  }
117 }
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define TRUE
Definition: types.h:120
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiUpdateAllGpes(void)
Definition: evxfgpe.c:79
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
#define FALSE
Definition: types.h:117
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
unsigned char BOOLEAN
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_EVENTS
Definition: aclocal.h:87
ACPI_STATUS AcpiEvWalkGpeList(ACPI_GPE_CALLBACK GpeWalkCallback, void *Context)
Definition: evgpeutil.c:67
ACPI_STATUS AcpiEvInitializeGpeBlock(ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
Definition: evgpeblk.c:481
UINT32 AcpiEvGpeDetect(ACPI_GPE_XRUPT_INFO *GpeXruptList)
Definition: evgpe.c:433