VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiApplicationEntryPoint/ApplicationEntryPoint.c@ 85716

Last change on this file since 85716 was 80721, checked in by vboxsync, 6 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1/** @file
2 Entry point library instance to a UEFI application.
3
4Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#include <Uefi.h>
10#include <Library/UefiApplicationEntryPoint.h>
11#include <Library/BaseLib.h>
12#include <Library/DebugLib.h>
13#include <Library/UefiBootServicesTableLib.h>
14
15
16/**
17 Entry point to UEFI Application.
18
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.
24
25 @param ImageHandle The image handle of the UEFI Application.
26 @param SystemTable A pointer to the EFI System Table.
27
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().
31
32**/
33EFI_STATUS
34EFIAPI
35_ModuleEntryPoint (
36 IN EFI_HANDLE ImageHandle,
37 IN EFI_SYSTEM_TABLE *SystemTable
38 )
39{
40 EFI_STATUS Status;
41
42 if (_gUefiDriverRevision != 0) {
43 //
44 // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the application.
45 //
46 if (SystemTable->Hdr.Revision < _gUefiDriverRevision) {
47 return EFI_INCOMPATIBLE_VERSION;
48 }
49 }
50
51 //
52 // Call constructor for all libraries.
53 //
54 ProcessLibraryConstructorList (ImageHandle, SystemTable);
55
56 //
57 // Call the module's entry point
58 //
59 Status = ProcessModuleEntryPointList (ImageHandle, SystemTable);
60
61 //
62 // Process destructor for all libraries.
63 //
64 ProcessLibraryDestructorList (ImageHandle, SystemTable);
65
66 //
67 // Return the return status code from the driver entry point
68 //
69 return Status;
70}
71
72
73/**
74 Invokes the library destructors for all dependent libraries and terminates
75 the UEFI Application.
76
77 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
78 with a status specified by Status.
79
80 @param Status Status returned by the application that is exiting.
81
82**/
83VOID
84EFIAPI
85Exit (
86 IN EFI_STATUS Status
87 )
88
89{
90 ProcessLibraryDestructorList (gImageHandle, gST);
91
92 gBS->Exit (gImageHandle, Status, 0, NULL);
93}
94
95
96/**
97 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
98
99 @param ImageHandle The image handle of the UEFI Application.
100 @param SystemTable A pointer to the EFI System Table.
101
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().
105
106**/
107EFI_STATUS
108EFIAPI
109EfiMain (
110 IN EFI_HANDLE ImageHandle,
111 IN EFI_SYSTEM_TABLE *SystemTable
112 )
113{
114 return _ModuleEntryPoint (ImageHandle, SystemTable);
115}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette