2 Entry point library instance to a UEFI application.
4 Copyright (c) 2007, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 // The package level header files this module uses
20 // The protocols, PPI and GUID defintions for this module
23 // The Library classes this module consumes
25 #include <Library/UefiApplicationEntryPoint.h>
26 #include <Library/UefiBootServicesTableLib.h>
29 Enrty point to UEFI application.
31 @param ImageHandle ImageHandle of the loaded driver.
32 @param SystemTable Pointer to the EFI System Table.
34 @retval EFI_SUCCESS One or more of the drivers returned a success code.
35 @retval !EFI_SUCESS The return status from the last driver entry point in the list.
41 IN EFI_HANDLE ImageHandle
,
42 IN EFI_SYSTEM_TABLE
*SystemTable
47 if (_gUefiDriverRevision
!= 0) {
49 // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the application.
51 if (SystemTable
->Hdr
.Revision
< _gUefiDriverRevision
) {
52 return EFI_INCOMPATIBLE_VERSION
;
57 // Call constructor for all libraries.
59 ProcessLibraryConstructorList (ImageHandle
, SystemTable
);
62 // Call the module's entry point
64 Status
= ProcessModuleEntryPointList (ImageHandle
, SystemTable
);
67 // Process destructor for all libraries.
69 ProcessLibraryDestructorList (ImageHandle
, SystemTable
);
72 // Return the return status code from the driver entry point
78 Invoke the destuctors of all libraries and call gBS->Exit
79 to return control to firmware core.
81 @param Status Status returned by the application that is exiting.
93 ProcessLibraryDestructorList (gImageHandle
, gST
);
95 gBS
->Exit (gImageHandle
, Status
, 0, NULL
);
99 Enrty point wrapper of UEFI Application.
101 @param ImageHandle ImageHandle of the loaded driver.
102 @param SystemTable Pointer to the EFI System Table.
104 @retval EFI_SUCCESS One or more of the drivers returned a success code.
105 @retval !EFI_SUCESS The return status from the last driver entry point in the list.
111 IN EFI_HANDLE ImageHandle
,
112 IN EFI_SYSTEM_TABLE
*SystemTable
115 return _ModuleEntryPoint (ImageHandle
, SystemTable
);