X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FUefiDriverEntryPoint%2FDriverEntryPoint.c;h=b4ed987bf93d17279117ca42ce9fc2b62de61ddd;hb=6517edbe5156bdf40f4bbd46af001d10ef81c8ed;hp=9ec19e3f4af1d0bc00fb0f95078cd782d5270966;hpb=582510249f2fb1334e507b99421b9485f6b89159;p=mirror_edk2.git diff --git a/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c b/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c index 9ec19e3f4a..b4ed987bf9 100644 --- a/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c +++ b/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c @@ -1,8 +1,8 @@ /** @file Entry point to a EFI/DXE driver. -Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -13,19 +13,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -EFI_EVENT _mDriverExitBootServicesNotifyEvent; + +#include + +#include + +#include +#include +#include +#include + /** Unload function that is registered in the LoadImage protocol. It un-installs protocols produced and deallocates pool used by the driver. Called by the core when unloading the driver. - @param ImageHandle + @param ImageHandle ImageHandle of the loaded driver. - @retval EFI_SUCCESS + @return Status returned by all unload(). **/ -STATIC EFI_STATUS EFIAPI _DriverUnloadHandler ( @@ -45,14 +53,6 @@ _DriverUnloadHandler ( // unloaded, and the library destructors should not be called // if (!EFI_ERROR (Status)) { - // - // Close our ExitBootServices () notify function - // - if (_gDriverExitBootServicesEvent[0] != NULL) { - Status = gBS->CloseEvent (_mDriverExitBootServicesNotifyEvent); - ASSERT_EFI_ERROR (Status); - } - ProcessLibraryDestructorList (ImageHandle, gST); } @@ -64,38 +64,29 @@ _DriverUnloadHandler ( /** - Notification Entry of ExitBootService event. In the entry, all notifications in _gDriverExitBootServicesEvent[] - would be invoked. - - @param Event The Event that is being processed. - @param Context Event Context. - -**/ -STATIC -VOID -EFIAPI -_DriverExitBootServices ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - EFI_EVENT_NOTIFY ChildNotifyEventHandler; - UINTN Index; - - for (Index = 0; _gDriverExitBootServicesEvent[Index] != NULL; Index++) { - ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index]; - ChildNotifyEventHandler (Event, NULL); - } -} - -/** - Enrty point to DXE Driver. - - @param ImageHandle ImageHandle of the loaded driver. - @param SystemTable Pointer to the EFI System Table. - - @retval EFI_SUCCESS One or more of the drivers returned a success code. - @retval !EFI_SUCESS The return status from the last driver entry point in the list. + The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM + Driver, or UEFI Driver. + + This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, + or UEFI Driver. This function must call ProcessLibraryConstructorList() and + ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList() + is an error status, then ProcessLibraryDestructorList() must be called. The return + value from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount + is greater than zero, then an unload handler must be registered for this image + and the unload handler must invoke ProcessModuleUnloadList(). + If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than + _gUefiDriverRevison, then return EFI_INCOMPATIBLE_VERSION. + + + @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, + DXE SMM Driver, or UEFI Driver. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM + Driver, or UEFI Driver exited normally. + @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than + SystemTable->Hdr.Revision. + @retval Other Return value from ProcessModuleEntryPointList(). **/ EFI_STATUS @@ -122,21 +113,6 @@ _ModuleEntryPoint ( // ProcessLibraryConstructorList (ImageHandle, SystemTable); - // - // Register our ExitBootServices () notify function - // - if (_gDriverExitBootServicesEvent[0] != NULL) { - Status = gBS->CreateEvent ( - EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES, - EFI_TPL_NOTIFY, - _DriverExitBootServices, - NULL, - &_mDriverExitBootServicesNotifyEvent - ); - - ASSERT_EFI_ERROR (Status); - } - // // Install unload handler... // @@ -159,14 +135,6 @@ _ModuleEntryPoint ( // If all of the drivers returned errors, then invoke all of the library destructors // if (EFI_ERROR (Status)) { - // - // Close our ExitBootServices () notify function - // - if (_gDriverExitBootServicesEvent[0] != NULL) { - Status = gBS->CloseEvent (_mDriverExitBootServicesNotifyEvent); - ASSERT_EFI_ERROR (Status); - } - ProcessLibraryDestructorList (ImageHandle, SystemTable); } @@ -178,14 +146,20 @@ _ModuleEntryPoint ( /** - Enrty point wrapper of DXE Driver. + Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). - @param ImageHandle ImageHandle of the loaded driver. - @param SystemTable Pointer to the EFI System Table. + This function is required to call _ModuleEntryPoint() passing in ImageHandle, + and SystemTable. - @retval EFI_SUCCESS One or more of the drivers returned a success code. - @retval !EFI_SUCESS The return status from the last driver entry point in the list. + @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE + SMM Driver, or UEFI Driver. + @param SystemTable A pointer to the EFI System Table. + @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM + Driver, or UEFI Driver exited normally. + @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than + SystemTable->Hdr.Revision. + @retval Other Return value from ProcessModuleEntryPointList(). **/ EFI_STATUS EFIAPI