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