]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/UefiApplicationEntryPoint.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Library / UefiApplicationEntryPoint.h
1 /** @file
2 Module entry point library for UEFI Applications.
3
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __UEFI_APPLICATION_ENTRY_POINT_H__
10 #define __UEFI_APPLICATION_ENTRY_POINT_H__
11
12 ///
13 /// Declare the EFI/UEFI Specification Revision to which this driver is implemented
14 ///
15 extern CONST UINT32 _gUefiDriverRevision;
16
17
18 /**
19 Entry point to UEFI Application.
20
21 This function is the entry point for a UEFI Application. This function must call
22 ProcessLibraryConstructorList(), ProcessModuleEntryPointList(), and ProcessLibraryDestructorList().
23 The return value from ProcessModuleEntryPointList() is returned.
24 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
25 then return EFI_INCOMPATIBLE_VERSION.
26
27 @param ImageHandle The image handle of the UEFI Application.
28 @param SystemTable A pointer to the EFI System Table.
29
30 @retval EFI_SUCCESS The UEFI Application exited normally.
31 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
32 @retval Other Return value from ProcessModuleEntryPointList().
33
34 **/
35 EFI_STATUS
36 EFIAPI
37 _ModuleEntryPoint (
38 IN EFI_HANDLE ImageHandle,
39 IN EFI_SYSTEM_TABLE *SystemTable
40 );
41
42
43 /**
44 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
45
46 @param ImageHandle The image handle of the UEFI Application.
47 @param SystemTable A pointer to the EFI System Table.
48
49 @retval EFI_SUCCESS The UEFI Application exited normally.
50 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
51 @retval Other Return value from ProcessModuleEntryPointList().
52
53 **/
54 EFI_STATUS
55 EFIAPI
56 EfiMain (
57 IN EFI_HANDLE ImageHandle,
58 IN EFI_SYSTEM_TABLE *SystemTable
59 );
60
61
62 /**
63 Invokes the library destructors for all dependent libraries and terminates
64 the UEFI Application.
65
66 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
67 with a status specified by Status.
68
69 @param Status Status returned by the application that is exiting.
70
71 **/
72 VOID
73 EFIAPI
74 Exit (
75 IN EFI_STATUS Status
76 );
77
78
79 /**
80 Autogenerated function that calls the library constructors for all of the module's
81 dependent libraries.
82
83 This function must be called by _ModuleEntryPoint().
84 This function calls the set of library constructors for the set of library instances
85 that a module depends on. This includes library instances that a module depends on
86 directly and library instances that a module depends on indirectly through other libraries.
87 This function is autogenerated by build tools and those build tools are responsible for
88 collecting the set of library instances, determine which ones have constructors, and
89 calling the library constructors in the proper order based upon each of the library
90 instances own dependencies.
91
92 @param ImageHandle The image handle of the UEFI Application.
93 @param SystemTable A pointer to the EFI System Table.
94
95 **/
96 VOID
97 EFIAPI
98 ProcessLibraryConstructorList (
99 IN EFI_HANDLE ImageHandle,
100 IN EFI_SYSTEM_TABLE *SystemTable
101 );
102
103
104 /**
105 Autogenerated function that calls the library descructors for all of the module's
106 dependent libraries.
107
108 This function may be called by _ModuleEntryPoint()or Exit().
109 This function calls the set of library destructors for the set of library instances
110 that a module depends on. This includes library instances that a module depends on
111 directly and library instances that a module depends on indirectly through other libraries.
112 This function is autogenerated by build tools and those build tools are responsible
113 for collecting the set of library instances, determine which ones have destructors,
114 and calling the library destructors in the proper order based upon each of the library
115 instances own dependencies.
116
117 @param ImageHandle The image handle of the UEFI Application.
118 @param SystemTable A pointer to the EFI System Table.
119
120 **/
121 VOID
122 EFIAPI
123 ProcessLibraryDestructorList (
124 IN EFI_HANDLE ImageHandle,
125 IN EFI_SYSTEM_TABLE *SystemTable
126 );
127
128 /**
129 This function calls the set of module entry points. It must be called by _ModuleEntryPoint().
130
131 This function is autogenerated by build tools and those build tools are
132 responsible for collecting the module entry points and calling them in a specified order.
133
134 @param ImageHandle The image handle of the UEFI Application.
135 @param SystemTable A pointer to the EFI System Table.
136
137 @retval EFI_SUCCESS The UEFI Application executed normally.
138 @retval !EFI_SUCCESS The UEFI Application failed to execute normally.
139
140 **/
141 EFI_STATUS
142 EFIAPI
143 ProcessModuleEntryPointList (
144 IN EFI_HANDLE ImageHandle,
145 IN EFI_SYSTEM_TABLE *SystemTable
146 );
147
148 #endif