From 21998b6778c9b77085330c4711f4cc55aa7c1e41 Mon Sep 17 00:00:00 2001 From: yshang1 Date: Wed, 27 Jun 2007 09:00:15 +0000 Subject: Add exit boot service event registry. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2801 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/UefiRuntimeLib/RuntimeLib.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'MdePkg/Library/UefiRuntimeLib') diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c index 3cb11d8924..2b0155e691 100644 --- a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c +++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c @@ -19,6 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /// STATIC EFI_EVENT mEfiVirtualNotifyEvent; +STATIC EFI_EVENT mEfiExitBootServicesEvent; STATIC BOOLEAN mEfiGoneVirtual = FALSE; STATIC BOOLEAN mEfiAtRuntime = FALSE; EFI_RUNTIME_SERVICES *mRT; @@ -29,9 +30,10 @@ EFI_RUNTIME_SERVICES *mRT; @param[in] Event The Event that is being processed @param[in] Context Event Context **/ +STATIC VOID EFIAPI -RuntimeDriverExitBootServices ( +RuntimeLibExitBootServicesEvent ( IN EFI_EVENT Event, IN VOID *Context ) @@ -60,16 +62,6 @@ RuntimeLibVirtualNotifyEvent ( IN VOID *Context ) { - UINTN Index; - EFI_EVENT_NOTIFY ChildNotifyEventHandler; - - for (Index = 0; - _gDriverSetVirtualAddressMapEvent[Index] != NULL; - Index++) { - ChildNotifyEventHandler = _gDriverSetVirtualAddressMapEvent[Index]; - ChildNotifyEventHandler (Event, NULL); - } - // // Update global for Runtime Services Table and IO // @@ -113,6 +105,16 @@ RuntimeDriverLibConstruct ( ASSERT_EFI_ERROR (Status); + Status = gBS->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, + TPL_NOTIFY, + RuntimeLibExitBootServicesEvent, + NULL, + &mEfiExitBootServicesEvent + ); + + ASSERT_EFI_ERROR (Status); + return Status; } @@ -140,6 +142,9 @@ RuntimeDriverLibDeconstruct ( Status = gBS->CloseEvent (mEfiVirtualNotifyEvent); ASSERT_EFI_ERROR (Status); + Status = gBS->CloseEvent (mEfiExitBootServicesEvent); + ASSERT_EFI_ERROR (Status); + return Status; } -- cgit v1.2.3