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 #include <Library/UefiApplicationEntryPoint.h>
17 #include <Library/UefiBootServicesTableLib.h>
21 Enrty point to UEFI application.
23 @param ImageHandle ImageHandle of the loaded driver.
24 @param SystemTable Pointer to the EFI System Table.
26 @retval EFI_SUCCESS One or more of the drivers returned a success code.
27 @retval !EFI_SUCESS The return status from the last driver entry point in the list.
33 IN EFI_HANDLE ImageHandle
,
34 IN EFI_SYSTEM_TABLE
*SystemTable
39 if (_gUefiDriverRevision
!= 0) {
41 // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the application.
43 if (SystemTable
->Hdr
.Revision
< _gUefiDriverRevision
) {
44 return EFI_INCOMPATIBLE_VERSION
;
49 // Call constructor for all libraries.
51 ProcessLibraryConstructorList (ImageHandle
, SystemTable
);
54 // Call the module's entry point
56 Status
= ProcessModuleEntryPointList (ImageHandle
, SystemTable
);
59 // Process destructor for all libraries.
61 ProcessLibraryDestructorList (ImageHandle
, SystemTable
);
64 // Return the return status code from the driver entry point
70 Invoke the destuctors of all libraries and call gBS->Exit
71 to return control to firmware core.
73 @param Status Status returned by the application that is exiting.
85 ProcessLibraryDestructorList (gImageHandle
, gST
);
87 gBS
->Exit (gImageHandle
, Status
, 0, NULL
);
91 Enrty point wrapper of UEFI Application.
93 @param ImageHandle ImageHandle of the loaded driver.
94 @param SystemTable Pointer to the EFI System Table.
96 @retval EFI_SUCCESS One or more of the drivers returned a success code.
97 @retval !EFI_SUCESS The return status from the last driver entry point in the list.
103 IN EFI_HANDLE ImageHandle
,
104 IN EFI_SYSTEM_TABLE
*SystemTable
107 return _ModuleEntryPoint (ImageHandle
, SystemTable
);