2 Entry point library instance to a UEFI application.
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/UefiApplicationEntryPoint.h>
11 #include <Library/BaseLib.h>
12 #include <Library/DebugLib.h>
13 #include <Library/UefiBootServicesTableLib.h>
16 Entry point to UEFI Application.
18 This function is the entry point for a UEFI Application. This function must call
19 ProcessLibraryConstructorList(), ProcessModuleEntryPointList(), and ProcessLibraryDestructorList().
20 The return value from ProcessModuleEntryPointList() is returned.
21 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
22 then return EFI_INCOMPATIBLE_VERSION.
24 @param ImageHandle The image handle of the UEFI Application.
25 @param SystemTable A pointer to the EFI System Table.
27 @retval EFI_SUCCESS The UEFI Application exited normally.
28 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
29 @retval Other Return value from ProcessModuleEntryPointList().
35 IN EFI_HANDLE ImageHandle
,
36 IN EFI_SYSTEM_TABLE
*SystemTable
41 if (_gUefiDriverRevision
!= 0) {
43 // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the application.
45 if (SystemTable
->Hdr
.Revision
< _gUefiDriverRevision
) {
46 return EFI_INCOMPATIBLE_VERSION
;
51 // Call constructor for all libraries.
53 ProcessLibraryConstructorList (ImageHandle
, SystemTable
);
56 // Call the module's entry point
58 Status
= ProcessModuleEntryPointList (ImageHandle
, SystemTable
);
61 // Process destructor for all libraries.
63 ProcessLibraryDestructorList (ImageHandle
, SystemTable
);
66 // Return the return status code from the driver entry point
72 Invokes the library destructors for all dependent libraries and terminates
75 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
76 with a status specified by Status.
78 @param Status Status returned by the application that is exiting.
88 ProcessLibraryDestructorList (gImageHandle
, gST
);
90 gBS
->Exit (gImageHandle
, Status
, 0, NULL
);
94 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
96 @param ImageHandle The image handle of the UEFI Application.
97 @param SystemTable A pointer to the EFI System Table.
99 @retval EFI_SUCCESS The UEFI Application exited normally.
100 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
101 @retval Other Return value from ProcessModuleEntryPointList().
107 IN EFI_HANDLE ImageHandle
,
108 IN EFI_SYSTEM_TABLE
*SystemTable
111 return _ModuleEntryPoint (ImageHandle
, SystemTable
);