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 Enrty point to UEFI application.
18 @param ImageHandle ImageHandle of the loaded driver.
19 @param SystemTable Pointer to the EFI System Table.
21 @retval EFI_SUCCESS One or more of the drivers returned a success code.
22 @retval !EFI_SUCESS The return status from the last driver entry point in the list.
28 IN EFI_HANDLE ImageHandle
,
29 IN EFI_SYSTEM_TABLE
*SystemTable
34 if (_gUefiDriverRevision
!= 0) {
36 // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the application.
38 if (SystemTable
->Hdr
.Revision
< _gUefiDriverRevision
) {
39 return EFI_INCOMPATIBLE_VERSION
;
44 // Call constructor for all libraries.
46 ProcessLibraryConstructorList (ImageHandle
, SystemTable
);
49 // Call the module's entry point
51 Status
= ProcessModuleEntryPointList (ImageHandle
, SystemTable
);
54 // Process destructor for all libraries.
56 ProcessLibraryDestructorList (ImageHandle
, SystemTable
);
59 // Return the return status code from the driver entry point
65 Invoke the destuctors of all libraries and call gBS->Exit
66 to return control to firmware core.
68 @param Status Status returned by the application that is exiting.
80 ProcessLibraryDestructorList (gImageHandle
, gST
);
82 gBS
->Exit (gImageHandle
, Status
, 0, NULL
);
86 Enrty point wrapper of UEFI Application.
88 @param ImageHandle ImageHandle of the loaded driver.
89 @param SystemTable Pointer to the EFI System Table.
91 @retval EFI_SUCCESS One or more of the drivers returned a success code.
92 @retval !EFI_SUCESS The return status from the last driver entry point in the list.
98 IN EFI_HANDLE ImageHandle
,
99 IN EFI_SYSTEM_TABLE
*SystemTable
102 return _ModuleEntryPoint (ImageHandle
, SystemTable
);