summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation/Library
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-11 04:22:00 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-11 04:22:00 +0000
commitc9c0c803ecde461695329acaeae6a4ed6a770a26 (patch)
tree2b5cee42a79d5d36be614ec701d76f485d9b8edd /EdkCompatibilityPkg/Foundation/Library
parent5405e9a66b5ecf9f8a7ba571ead43cbee45161ae (diff)
downloadedk2-platforms-c9c0c803ecde461695329acaeae6a4ed6a770a26.tar.xz
Do not use statically macros of EFI_SPECIFICATION_VERSION: Use gST->Hdr.Revision to judge the use of UEFI 2.0 services or EFI 1.0 services
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6448 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c159
1 files changed, 79 insertions, 80 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c
index 3cb668e966..c4fd2afbbd 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c
@@ -190,8 +190,6 @@ Returns:
return EFI_SUCCESS;
}
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
static
VOID
EFIAPI
@@ -211,7 +209,7 @@ EventNotifySignalAllNullEvent (
return;
}
-#endif
+
EFI_STATUS
EFIAPI
@@ -245,49 +243,50 @@ Returns:
UINT32 EventType;
EFI_EVENT_NOTIFY WorkerNotifyFunction;
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- LegacyBootEvent
- );
-#else
-
- EventType = EFI_EVENT_NOTIFY_SIGNAL;
- if (NotifyFunction == NULL) {
+ if (gST->Hdr.Revision < 0x00020000) {
+
+ if (NotifyFunction == NULL) {
+ EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
+ } else {
+ EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;
+ }
+ WorkerNotifyFunction = NotifyFunction;
+
//
- // CreatEventEx will check NotifyFunction is NULL or not
+ // prior to UEFI 2.0 use Tiano extension to EFI
//
- WorkerNotifyFunction = EventNotifySignalAllNullEvent;
+ Status = gBS->CreateEvent (
+ EventType,
+ NotifyTpl,
+ WorkerNotifyFunction,
+ NotifyContext,
+ LegacyBootEvent
+ );
} else {
- WorkerNotifyFunction = NotifyFunction;
+
+ EventType = EFI_EVENT_NOTIFY_SIGNAL;
+ if (NotifyFunction == NULL) {
+ //
+ // CreatEventEx will check NotifyFunction is NULL or not
+ //
+ WorkerNotifyFunction = EventNotifySignalAllNullEvent;
+ } else {
+ WorkerNotifyFunction = NotifyFunction;
+ }
+
+ //
+ // For UEFI 2.0 and the future use an Event Group
+ //
+ Status = gBS->CreateEventEx (
+ EventType,
+ NotifyTpl,
+ WorkerNotifyFunction,
+ NotifyContext,
+ &gEfiEventLegacyBootGuid,
+ LegacyBootEvent
+ );
}
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventLegacyBootGuid,
- LegacyBootEvent
- );
-#endif
return Status;
}
@@ -324,48 +323,48 @@ Return:
UINT32 EventType;
EFI_EVENT_NOTIFY WorkerNotifyFunction;
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- ReadyToBootEvent
- );
-#else
-
- EventType = EFI_EVENT_NOTIFY_SIGNAL;
- if (NotifyFunction == NULL) {
+ if (gST->Hdr.Revision < 0x00020000) {
+
+ if (NotifyFunction == NULL) {
+ EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
+ } else {
+ EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;
+ }
+ WorkerNotifyFunction = NotifyFunction;
+
//
- // CreatEventEx will check NotifyFunction is NULL or not
+ // prior to UEFI 2.0 use Tiano extension to EFI
//
- WorkerNotifyFunction = EventNotifySignalAllNullEvent;
+ Status = gBS->CreateEvent (
+ EventType,
+ NotifyTpl,
+ WorkerNotifyFunction,
+ NotifyContext,
+ ReadyToBootEvent
+ );
} else {
- WorkerNotifyFunction = NotifyFunction;
+
+ EventType = EFI_EVENT_NOTIFY_SIGNAL;
+ if (NotifyFunction == NULL) {
+ //
+ // CreatEventEx will check NotifyFunction is NULL or not
+ //
+ WorkerNotifyFunction = EventNotifySignalAllNullEvent;
+ } else {
+ WorkerNotifyFunction = NotifyFunction;
+ }
+
+ //
+ // For UEFI 2.0 and the future use an Event Group
+ //
+ Status = gBS->CreateEventEx (
+ EventType,
+ NotifyTpl,
+ WorkerNotifyFunction,
+ NotifyContext,
+ &gEfiEventReadyToBootGuid,
+ ReadyToBootEvent
+ );
}
-
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventReadyToBootGuid,
- ReadyToBootEvent
- );
-#endif
return Status;
}