summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Library/EdkUefiRuntimeLib
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-06 05:17:50 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-06 05:17:50 +0000
commitf1cd55fe2445361c02a74ac2e353f42aaf52765c (patch)
tree8b491db30f0be10e19b7385b12a5bda0df1b3690 /EdkModulePkg/Library/EdkUefiRuntimeLib
parent756e4264d3e06c986cab44abe9a4db55787f7a49 (diff)
downloadedk2-platforms-f1cd55fe2445361c02a74ac2e353f42aaf52765c.tar.xz
Add DxeDebugLibSerialPort that provides a debug library that layers directly on top of a serial port
Add an EdkDxeRuntimeSalLib that provide a SalLib that is safe for runtime use. The EdkDxeSalLib is now a boot service only lib. Move the registration and processing of ExitBootServicesEvents() from the RuntimeLib to the UEFI DriverEntryPointLib in the MdePkg. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2057 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Library/EdkUefiRuntimeLib')
-rw-r--r--EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c36
-rw-r--r--EdkModulePkg/Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.msa3
-rw-r--r--EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c68
3 files changed, 26 insertions, 81 deletions
diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c b/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c
index 12f06e1324..0cef1f7ffc 100644
--- a/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c
+++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c
@@ -21,14 +21,11 @@ Module Name:
// Driver Lib Module Globals
//
-STATIC EFI_EVENT mRuntimeNotifyEvent;
STATIC EFI_EVENT mEfiVirtualNotifyEvent;
STATIC BOOLEAN mEfiGoneVirtual = FALSE;
STATIC BOOLEAN mEfiAtRuntime = FALSE;
-
EFI_RUNTIME_SERVICES *mRT;
-STATIC
VOID
EFIAPI
RuntimeDriverExitBootServices (
@@ -53,16 +50,6 @@ Returns:
--*/
{
- EFI_EVENT_NOTIFY ChildNotifyEventHandler;
- UINTN Index;
-
- for (Index = 0;
- _gDriverExitBootServicesEvent[Index] != NULL;
- Index++) {
- ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];
- ChildNotifyEventHandler (Event, NULL);
- }
-
//
// Clear out BootService globals
//
@@ -147,21 +134,9 @@ Returns:
mRT = SystemTable->RuntimeServices;
//
- // Register our ExitBootServices () notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
- EFI_TPL_NOTIFY,
- RuntimeDriverExitBootServices,
- NULL,
- &mRuntimeNotifyEvent
- );
-
- ASSERT_EFI_ERROR (Status);
-
- //
// Register SetVirtualAddressMap () notify function
//
+ if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {
Status = gBS->CreateEvent (
EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
EFI_TPL_NOTIFY,
@@ -171,6 +146,7 @@ Returns:
);
ASSERT_EFI_ERROR (Status);
+ }
return EFI_SUCCESS;
}
@@ -202,16 +178,12 @@ Returns:
EFI_STATUS Status;
//
- // Close our ExitBootServices () notify function
- //
- Status = gBS->CloseEvent (mRuntimeNotifyEvent);
- ASSERT_EFI_ERROR (Status);
-
- //
// Close SetVirtualAddressMap () notify function
//
+ if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {
Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
ASSERT_EFI_ERROR (Status);
+ }
return EFI_SUCCESS;
}
diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.msa b/EdkModulePkg/Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.msa
index 3cba52c514..32aa525bc8 100644
--- a/EdkModulePkg/Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.msa
+++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/EdkUefiRuntimeLib.msa
@@ -71,5 +71,8 @@
<Constructor>RuntimeDriverLibConstruct</Constructor>
<Destructor>RuntimeDriverLibDeconstruct</Destructor>
</Extern>
+ <Extern>
+ <ExitBootServicesCallBack>RuntimeDriverExitBootServices</ExitBootServicesCallBack>
+ </Extern>
</Externs>
</ModuleSurfaceArea> \ No newline at end of file
diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
index 00f557aa41..35598f2958 100644
--- a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
+++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
@@ -21,13 +21,9 @@ Module Name:
//
// Driver Lib Module Globals
//
+static EFI_EVENT mEfiVirtualNotifyEvent;
+EFI_RUNTIME_SERVICES *mRT;
-STATIC EFI_EVENT mRuntimeNotifyEvent;
-STATIC EFI_EVENT mEfiVirtualNotifyEvent;
-
-EFI_RUNTIME_SERVICES *mRT;
-
-STATIC
VOID
EFIAPI
RuntimeDriverExitBootServices (
@@ -52,21 +48,11 @@ Returns:
--*/
{
- EFI_EVENT_NOTIFY ChildNotifyEventHandler;
- UINTN Index;
-
- for (Index = 0; _gDriverExitBootServicesEvent[Index] != NULL; Index++) {
- ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];
- ChildNotifyEventHandler (Event, NULL);
+ if (EfiAtRuntime()) {
+ return;
}
-
- //
- // Clear out BootService globals
- //
- gBS = NULL;
}
-STATIC
VOID
EFIAPI
RuntimeLibVirtualNotifyEvent (
@@ -93,7 +79,7 @@ Returns:
--*/
{
- UINTN Index;
+ UINTN Index;
EFI_EVENT_NOTIFY ChildNotifyEventHandler;
for (Index = 0; _gDriverSetVirtualAddressMapEvent[Index] != NULL; Index++) {
@@ -138,30 +124,18 @@ Returns:
mRT = SystemTable->RuntimeServices;
//
- // Register our ExitBootServices () notify function
- //
-
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
- EFI_TPL_NOTIFY,
- RuntimeDriverExitBootServices,
- NULL,
- &mRuntimeNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- //
// Register SetVirtualAddressMap () notify function
//
-
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- EFI_TPL_NOTIFY,
- RuntimeLibVirtualNotifyEvent,
- NULL,
- &mEfiVirtualNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
+ if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {
+ Status = gBS->CreateEvent (
+ EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
+ EFI_TPL_NOTIFY,
+ RuntimeLibVirtualNotifyEvent,
+ NULL,
+ &mEfiVirtualNotifyEvent
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
return EFI_SUCCESS;
}
@@ -193,16 +167,12 @@ Returns:
EFI_STATUS Status;
//
- // Close our ExitBootServices () notify function
- //
- Status = gBS->CloseEvent (mRuntimeNotifyEvent);
- ASSERT_EFI_ERROR (Status);
-
- //
// Close SetVirtualAddressMap () notify function
//
- Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
- ASSERT_EFI_ERROR (Status);
+ if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {
+ Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
+ ASSERT_EFI_ERROR (Status);
+ }
return EFI_SUCCESS;
}