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>
17 Entry point to UEFI Application.
19 This function is the entry point for a UEFI Application. This function must call
20 ProcessLibraryConstructorList(), ProcessModuleEntryPointList(), and ProcessLibraryDestructorList().
21 The return value from ProcessModuleEntryPointList() is returned.
22 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
23 then return EFI_INCOMPATIBLE_VERSION.
25 @param ImageHandle The image handle of the UEFI Application.
26 @param SystemTable A pointer to the EFI System Table.
28 @retval EFI_SUCCESS The UEFI Application exited normally.
29 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
30 @retval Other Return value from ProcessModuleEntryPointList().
36 IN EFI_HANDLE ImageHandle
,
37 IN EFI_SYSTEM_TABLE
*SystemTable
42 if (_gUefiDriverRevision
!= 0) {
44 // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the application.
46 if (SystemTable
->Hdr
.Revision
< _gUefiDriverRevision
) {
47 return EFI_INCOMPATIBLE_VERSION
;
52 // Call constructor for all libraries.
54 ProcessLibraryConstructorList (ImageHandle
, SystemTable
);
57 // Call the module's entry point
59 Status
= ProcessModuleEntryPointList (ImageHandle
, SystemTable
);
62 // Process destructor for all libraries.
64 ProcessLibraryDestructorList (ImageHandle
, SystemTable
);
67 // Return the return status code from the driver entry point
74 Invokes the library destructors for all dependent libraries and terminates
77 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
78 with a status specified by Status.
80 @param Status Status returned by the application that is exiting.
90 ProcessLibraryDestructorList (gImageHandle
, gST
);
92 gBS
->Exit (gImageHandle
, Status
, 0, NULL
);
97 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
99 @param ImageHandle The image handle of the UEFI Application.
100 @param SystemTable A pointer to the EFI System Table.
102 @retval EFI_SUCCESS The UEFI Application exited normally.
103 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
104 @retval Other Return value from ProcessModuleEntryPointList().
110 IN EFI_HANDLE ImageHandle
,
111 IN EFI_SYSTEM_TABLE
*SystemTable
114 return _ModuleEntryPoint (ImageHandle
, SystemTable
);