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