]>
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 | |
5 | Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>\r | |
6 | \r | |
7 | This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | #ifndef __MODULE_ENTRY_POINT_H__\r | |
18 | #define __MODULE_ENTRY_POINT_H__\r | |
19 | \r | |
20 | ///\r | |
21 | ///Declare the PI Specification Revision that this driver requires to execute correctly.\r | |
22 | ///\r | |
23 | extern CONST UINT32 _gMmRevision;\r | |
24 | \r | |
25 | /**\r | |
26 | The entry point of PE/COFF Image for a Standalone MM Driver.\r | |
27 | \r | |
28 | This function is the entry point for a Standalone MM Driver.\r | |
29 | This function must call ProcessLibraryConstructorList() and\r | |
30 | ProcessModuleEntryPointList().\r | |
31 | If the return status from ProcessModuleEntryPointList()\r | |
32 | is an error status, then ProcessLibraryDestructorList() must be called.\r | |
33 | The return value from ProcessModuleEntryPointList() is returned.\r | |
34 | If _gDriverUnloadImageCount is greater\r | |
35 | than zero, then an unload handler must be registered for this image and\r | |
36 | the unload handler must invoke ProcessModuleUnloadList().\r | |
37 | If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is\r | |
38 | less than _gUefiDriverRevison, then return EFI_INCOMPATIBLE_VERSION.\r | |
39 | \r | |
40 | @param ImageHandle The image handle of the Standalone MM Driver.\r | |
41 | @param SystemTable A pointer to the EFI System Table.\r | |
42 | \r | |
43 | @retval EFI_SUCCESS The Standalone MM Driver exited normally.\r | |
44 | @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than\r | |
45 | SystemTable->Hdr.Revision.\r | |
46 | @retval Other Return value from\r | |
47 | ProcessModuleEntryPointList().\r | |
48 | \r | |
49 | **/\r | |
50 | EFI_STATUS\r | |
51 | EFIAPI\r | |
52 | _ModuleEntryPoint (\r | |
53 | IN EFI_HANDLE ImageHandle,\r | |
54 | IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r | |
55 | );\r | |
56 | \r | |
57 | \r | |
58 | /**\r | |
59 | Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().\r | |
60 | \r | |
61 | This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.\r | |
62 | \r | |
63 | @param ImageHandle The image handle of the Standalone MM Driver.\r | |
64 | @param SystemTable A pointer to the EFI System Table.\r | |
65 | \r | |
66 | @retval EFI_SUCCESS The Standalone MM Driver exited normally.\r | |
67 | @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than\r | |
68 | SystemTable->Hdr.Revision.\r | |
69 | @retval Other Return value from ProcessModuleEntryPointList().\r | |
70 | **/\r | |
71 | EFI_STATUS\r | |
72 | EFIAPI\r | |
73 | EfiMain (\r | |
74 | IN EFI_HANDLE ImageHandle,\r | |
75 | IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r | |
76 | );\r | |
77 | \r | |
78 | /**\r | |
79 | Auto generated function that calls the library constructors for all of the module's\r | |
80 | dependent libraries.\r | |
81 | \r | |
82 | This function must be called by _ModuleEntryPoint().\r | |
83 | This function calls the set of library constructors for the set of library instances\r | |
84 | that a module depends on. This includes library instances that a module depends on\r | |
85 | directly and library instances that a module depends on indirectly through other libraries.\r | |
86 | This function is auto generated by build tools and those build tools are responsible\r | |
87 | for collecting the set of library instances, determine which ones have constructors,\r | |
88 | and calling the library constructors in the proper order based upon each of the library\r | |
89 | instances own dependencies.\r | |
90 | \r | |
91 | @param ImageHandle The image handle of the Standalone MM Driver.\r | |
92 | @param SystemTable A pointer to the EFI System Table.\r | |
93 | \r | |
94 | **/\r | |
95 | VOID\r | |
96 | EFIAPI\r | |
97 | ProcessLibraryConstructorList (\r | |
98 | IN EFI_HANDLE ImageHandle,\r | |
99 | IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r | |
100 | );\r | |
101 | \r | |
102 | \r | |
103 | /**\r | |
104 | Auto generated function that calls the library descructors for all of the module's\r | |
105 | dependent libraries.\r | |
106 | \r | |
107 | This function may be called by _ModuleEntryPoint() or ExitDriver().\r | |
108 | This function calls the set of library destructors for the set of library instances\r | |
109 | that a module depends on. This includes library instances that a module depends on\r | |
110 | directly and library instances that a module depends on indirectly through other libraries.\r | |
111 | This function is auto generated by build tools and those build tools are responsible for\r | |
112 | collecting the set of library instances, determine which ones have destructors, and calling\r | |
113 | the library destructors in the proper order based upon each of the library instances own dependencies.\r | |
114 | \r | |
115 | @param ImageHandle The image handle of the Standalone MM Driver.\r | |
116 | @param SystemTable A pointer to the EFI System Table.\r | |
117 | \r | |
118 | **/\r | |
119 | VOID\r | |
120 | EFIAPI\r | |
121 | ProcessLibraryDestructorList (\r | |
122 | IN EFI_HANDLE ImageHandle,\r | |
123 | IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r | |
124 | );\r | |
125 | \r | |
126 | \r | |
127 | /**\r | |
128 | Auto generated function that calls a set of module entry points.\r | |
129 | \r | |
130 | This function must be called by _ModuleEntryPoint().\r | |
131 | This function calls the set of module entry points.\r | |
132 | This function is auto generated by build tools and those build tools are responsible\r | |
133 | for collecting the module entry points and calling them in a specified order.\r | |
134 | \r | |
135 | @param ImageHandle The image handle of the Standalone MM Driver.\r | |
136 | @param SystemTable A pointer to the EFI System Table.\r | |
137 | \r | |
138 | @retval EFI_SUCCESS The Standalone MMDriver executed normally.\r | |
139 | @retval !EFI_SUCCESS The Standalone MM Driver failed to execute normally.\r | |
140 | **/\r | |
141 | EFI_STATUS\r | |
142 | EFIAPI\r | |
143 | ProcessModuleEntryPointList (\r | |
144 | IN EFI_HANDLE ImageHandle,\r | |
145 | IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r | |
146 | );\r | |
147 | \r | |
148 | #endif\r |