]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/StandaloneMmDriverEntryPoint.h
MdePkg: Support standalone MM Driver Unload capability
[mirror_edk2.git] / MdePkg / Include / Library / StandaloneMmDriverEntryPoint.h
CommitLineData
7df4764e
AB
1/** @file\r
2 Module entry point library for Standalone MM Drivers.\r
3\r
4Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
5Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>\r
6Copyright (c) 2018, Linaro, Limited. All rights reserved.<BR>\r
7\r
9344f092 8SPDX-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
19extern CONST UINT32 _gMmRevision;\r
20\r
9fd7e88c
JW
21///\r
22/// Declare the number of unload handler in the image.\r
23///\r
24extern CONST UINT8 _gDriverUnloadImageCount;\r
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
48EFI_STATUS\r
49EFIAPI\r
50_ModuleEntryPoint (\r
51 IN EFI_HANDLE ImageHandle,\r
52 IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r
53 );\r
54\r
55\r
56/**\r
57 Auto generated function that calls the library constructors for all of the\r
58 module's dependent libraries.\r
59\r
60 This function must be called by _ModuleEntryPoint().\r
61 This function calls the set of library constructors for the set of library\r
62 instances that a module depends on. This includes library instances that a\r
63 module depends on directly and library instances that a module depends on\r
64 indirectly through other libraries. This function is auto generated by build\r
65 tools and those build tools are responsible for collecting the set of library\r
66 instances, determine which ones have constructors, and calling the library\r
67 constructors in the proper order based upon each of the library instances own\r
68 dependencies.\r
69\r
6c61ec4c
BD
70 @param ImageHandle The image handle of the Standalone MM Driver.\r
71 @param MmSystemTable A pointer to the MM System Table.\r
7df4764e
AB
72\r
73**/\r
74VOID\r
75EFIAPI\r
76ProcessLibraryConstructorList (\r
77 IN EFI_HANDLE ImageHandle,\r
78 IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r
79 );\r
80\r
81\r
82/**\r
83 Auto generated function that calls the library descructors for all of the\r
84 module's dependent libraries.\r
85\r
86 This function may be called by _ModuleEntryPoint().\r
87 This function calls the set of library destructors for the set of library\r
88 instances that a module depends on. This includes library instances that a\r
89 module depends on directly and library instances that a module depends on\r
90 indirectly through other libraries.\r
91 This function is auto generated by build tools and those build tools are\r
92 responsible for collecting the set of library instances, determine which ones\r
93 have destructors, and calling the library destructors in the proper order\r
94 based upon each of the library instances own dependencies.\r
95\r
6c61ec4c
BD
96 @param ImageHandle The image handle of the Standalone MM Driver.\r
97 @param MmSystemTable A pointer to the MM System Table.\r
7df4764e
AB
98\r
99**/\r
100VOID\r
101EFIAPI\r
102ProcessLibraryDestructorList (\r
103 IN EFI_HANDLE ImageHandle,\r
104 IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r
105 );\r
106\r
107\r
108/**\r
109 Auto generated function that calls a set of module entry points.\r
110\r
111 This function must be called by _ModuleEntryPoint().\r
112 This function calls the set of module entry points.\r
113 This function is auto generated by build tools and those build tools are\r
114 responsible for collecting the module entry points and calling them in a\r
115 specified order.\r
116\r
6c61ec4c
BD
117 @param ImageHandle The image handle of the Standalone MM Driver.\r
118 @param MmSystemTable A pointer to the MM System Table.\r
7df4764e
AB
119\r
120 @retval EFI_SUCCESS The Standalone MM Driver executed normally.\r
121 @retval !EFI_SUCCESS The Standalone MM Driver failed to execute normally.\r
122**/\r
123EFI_STATUS\r
124EFIAPI\r
125ProcessModuleEntryPointList (\r
126 IN EFI_HANDLE ImageHandle,\r
127 IN EFI_MM_SYSTEM_TABLE *MmSystemTable\r
128 );\r
129\r
9fd7e88c
JW
130/**\r
131 Autogenerated function that calls a set of module unload handlers.\r
132\r
133 This function must be called from the unload handler registered by _ModuleEntryPoint().\r
134 This function calls the set of module unload handlers.\r
135 This function is autogenerated by build tools and those build tools are responsible\r
136 for collecting the module unload handlers and calling them in a specified order.\r
137\r
138 @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.\r
139\r
140 @retval EFI_SUCCESS The unload handlers executed normally.\r
141 @retval !EFI_SUCCESS The unload handlers failed to execute normally.\r
142\r
143**/\r
144EFI_STATUS\r
145EFIAPI\r
146ProcessModuleUnloadList (\r
147 IN EFI_HANDLE ImageHandle\r
148 );\r
149\r
7df4764e 150#endif\r