]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c
Add dependent protocol:"Protocol/DevicePath.h".
[mirror_edk2.git] / MdePkg / Library / UefiDriverEntryPoint / DriverEntryPoint.c
index 60177bc9c5b223fba534dee3f5f1b52ef666fd2d..8e3b30ac1e585a1b44b4fde1c3541ea2eb86388b 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,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "CommonHeader.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,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @retval EFI_SUCCESS\r
 \r
 **/\r
+STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 _DriverUnloadHandler (\r
@@ -41,6 +49,7 @@ _DriverUnloadHandler (
   // unloaded, and the library destructors should not be called\r
   //\r
   if (!EFI_ERROR (Status)) {\r
+\r
     ProcessLibraryDestructorList (ImageHandle, gST);\r
   }\r
 \r
@@ -50,6 +59,32 @@ _DriverUnloadHandler (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Notification Entry of ExitBootService event. In the entry, all notifications in _gDriverExitBootServicesEvent[]\r
+  would be invoked.\r
+\r
+  @param Event   The Event that is being processed.\r
+  @param Context Event Context.\r
+\r
+**/\r
+STATIC\r
+VOID\r
+EFIAPI\r
+_DriverExitBootServices (\r
+  IN EFI_EVENT        Event,\r
+  IN VOID             *Context\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
 \r
@@ -79,11 +114,6 @@ _ModuleEntryPoint (
     }\r
   }\r
 \r
-  //\r
-  // Call constructor for all libraries\r
-  //\r
-  ProcessLibraryConstructorList (ImageHandle, SystemTable);\r
-\r
   //\r
   //  Install unload handler...\r
   //\r
@@ -97,6 +127,11 @@ _ModuleEntryPoint (
     LoadedImage->Unload = _DriverUnloadHandler;\r
   }\r
 \r
+  //\r
+  // Call constructor for all libraries\r
+  //\r
+  ProcessLibraryConstructorList (ImageHandle, SystemTable);\r
+\r
   //\r
   // Call the driver entry point\r
   //\r