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