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