]> 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 Entry point to UEFI Application.
19
20 This function is the entry point for a UEFI Application. This function must call
21 ProcessLibraryConstructorList(), ProcessModuleEntryPointList(), and ProcessLibraryDestructorList().
22 The return value from ProcessModuleEntryPointList() is returned.
23 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
24 then return EFI_INCOMPATIBLE_VERSION.
25
26 @param ImageHandle The image handle of the UEFI Application.
27 @param SystemTable A pointer to the EFI System Table.
28
29 @retval EFI_SUCCESS The UEFI Application exited normally.
30 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
31 @retval Other Return value from ProcessModuleEntryPointList().
32
33 **/
34 EFI_STATUS
35 EFIAPI
36 _ModuleEntryPoint (
37 IN EFI_HANDLE ImageHandle,
38 IN EFI_SYSTEM_TABLE *SystemTable
39 );
40
41 /**
42 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
43
44 @param ImageHandle The image handle of the UEFI Application.
45 @param SystemTable A pointer to the EFI System Table.
46
47 @retval EFI_SUCCESS The UEFI Application exited normally.
48 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
49 @retval Other Return value from ProcessModuleEntryPointList().
50
51 **/
52 EFI_STATUS
53 EFIAPI
54 EfiMain (
55 IN EFI_HANDLE ImageHandle,
56 IN EFI_SYSTEM_TABLE *SystemTable
57 );
58
59 /**
60 Invokes the library destructors for all dependent libraries and terminates
61 the UEFI Application.
62
63 This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
64 with a status specified by Status.
65
66 @param Status Status returned by the application that is exiting.
67
68 **/
69 VOID
70 EFIAPI
71 Exit (
72 IN EFI_STATUS Status
73 );
74
75 /**
76 Autogenerated function that calls the library constructors for all of the module's
77 dependent libraries.
78
79 This function must be called by _ModuleEntryPoint().
80 This function calls the set of library constructors for the set of library instances
81 that a module depends on. This includes library instances that a module depends on
82 directly and library instances that a module depends on indirectly through other libraries.
83 This function is autogenerated by build tools and those build tools are responsible for
84 collecting the set of library instances, determine which ones have constructors, and
85 calling the library constructors in the proper order based upon each of the library
86 instances own dependencies.
87
88 @param ImageHandle The image handle of the UEFI Application.
89 @param SystemTable A pointer to the EFI System Table.
90
91 **/
92 VOID
93 EFIAPI
94 ProcessLibraryConstructorList (
95 IN EFI_HANDLE ImageHandle,
96 IN EFI_SYSTEM_TABLE *SystemTable
97 );
98
99 /**
100 Autogenerated function that calls the library descructors for all of the module's
101 dependent libraries.
102
103 This function may be called by _ModuleEntryPoint()or Exit().
104 This function calls the set of library destructors for the set of library instances
105 that a module depends on. This includes library instances that a module depends on
106 directly and library instances that a module depends on indirectly through other libraries.
107 This function is autogenerated by build tools and those build tools are responsible
108 for collecting the set of library instances, determine which ones have destructors,
109 and calling the library destructors in the proper order based upon each of the library
110 instances own dependencies.
111
112 @param ImageHandle The image handle of the UEFI Application.
113 @param SystemTable A pointer to the EFI System Table.
114
115 **/
116 VOID
117 EFIAPI
118 ProcessLibraryDestructorList (
119 IN EFI_HANDLE ImageHandle,
120 IN EFI_SYSTEM_TABLE *SystemTable
121 );
122
123 /**
124 This function calls the set of module entry points. It must be called by _ModuleEntryPoint().
125
126 This function is autogenerated by build tools and those build tools are
127 responsible for collecting the module entry points and calling them in a specified order.
128
129 @param ImageHandle The image handle of the UEFI Application.
130 @param SystemTable A pointer to the EFI System Table.
131
132 @retval EFI_SUCCESS The UEFI Application executed normally.
133 @retval !EFI_SUCCESS The UEFI Application failed to execute normally.
134
135 **/
136 EFI_STATUS
137 EFIAPI
138 ProcessModuleEntryPointList (
139 IN EFI_HANDLE ImageHandle,
140 IN EFI_SYSTEM_TABLE *SystemTable
141 );
142
143 #endif