]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c
add a error macro to prevent this file from included for now #error "UEFI 2.1 HII...
[mirror_edk2.git] / MdePkg / Library / UefiDriverEntryPoint / DriverEntryPoint.c
index cd096c59b5edca493bd483f7f263ca11c919b18a..20abcdaf6b821e7d63629463f9d902c6c5afbaad 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Entry point to a EFI/DXE driver.\r
 \r
-Copyright (c) 2006, Intel Corporation<BR>\r
+Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -12,6 +12,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
+\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <Uefi.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Protocol/LoadedImage.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+\r
+\r
 /**\r
   Unload function that is registered in the LoadImage protocol.  It un-installs\r
   protocols produced and deallocates pool used by the driver.  Called by the core\r
@@ -22,9 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @retval EFI_SUCCESS\r
 \r
 **/\r
-\r
-EFI_EVENT  _mDriverExitBootServicesNotifyEvent;\r
-\r
+STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 _DriverUnloadHandler (\r
@@ -44,14 +59,6 @@ _DriverUnloadHandler (
   // unloaded, and the library destructors should not be called\r
   //\r
   if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Close our ExitBootServices () notify function\r
-    //\r
-    if (_gDriverExitBootServicesEvent[0] != NULL) {\r
-      Status = gBS->CloseEvent (_mDriverExitBootServicesNotifyEvent);\r
-      ASSERT_EFI_ERROR (Status);\r
-    }\r
-\r
     ProcessLibraryDestructorList (ImageHandle, gST);\r
   }\r
 \r
@@ -61,38 +68,6 @@ _DriverUnloadHandler (
   return Status;\r
 }\r
 \r
-VOID\r
-EFIAPI\r
-_DriverExitBootServices (\r
-  IN EFI_EVENT        Event,\r
-  IN VOID             *Context\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set AtRuntime flag as TRUE after ExitBootServices\r
-\r
-Arguments:\r
-\r
-  Event   - The Event that is being processed\r
-  \r
-  Context - Event Context\r
-\r
-Returns: \r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_EVENT_NOTIFY  ChildNotifyEventHandler;\r
-  UINTN             Index;\r
-\r
-  for (Index = 0; _gDriverExitBootServicesEvent[Index] != NULL; Index++) {\r
-    ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];\r
-    ChildNotifyEventHandler (Event, NULL);\r
-  }\r
-}\r
 \r
 /**\r
   Enrty point to DXE Driver.\r
@@ -128,21 +103,6 @@ _ModuleEntryPoint (
   //\r
   ProcessLibraryConstructorList (ImageHandle, SystemTable);\r
 \r
-  //\r
-  // Register our ExitBootServices () notify function\r
-  //\r
-  if (_gDriverExitBootServicesEvent[0] != NULL) {\r
-    Status = gBS->CreateEvent (\r
-                    EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,\r
-                    EFI_TPL_NOTIFY,\r
-                    _DriverExitBootServices,\r
-                    NULL,\r
-                    &_mDriverExitBootServicesNotifyEvent\r
-                    );\r
-\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
   //\r
   //  Install unload handler...\r
   //\r
@@ -165,14 +125,6 @@ _ModuleEntryPoint (
   // If all of the drivers returned errors, then invoke all of the library destructors\r
   //\r
   if (EFI_ERROR (Status)) {\r
-    //\r
-    // Close our ExitBootServices () notify function\r
-    //\r
-    if (_gDriverExitBootServicesEvent[0] != NULL) {\r
-      Status = gBS->CloseEvent (_mDriverExitBootServicesNotifyEvent);\r
-      ASSERT_EFI_ERROR (Status);\r
-    }\r
-\r
     ProcessLibraryDestructorList (ImageHandle, SystemTable);\r
   }\r
 \r