2 Module entry point library for Standalone MM Drivers.
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef __MODULE_ENTRY_POINT_H__
12 #define __MODULE_ENTRY_POINT_H__
15 ///Declare the PI Specification Revision that this driver requires to execute correctly.
17 extern CONST UINT32 _gMmRevision
;
20 The entry point of PE/COFF Image for a Standalone MM Driver.
22 This function is the entry point for a Standalone MM Driver.
23 This function must call ProcessLibraryConstructorList() and
24 ProcessModuleEntryPointList().
25 If the return status from ProcessModuleEntryPointList()
26 is an error status, then ProcessLibraryDestructorList() must be called.
27 The return value from ProcessModuleEntryPointList() is returned.
28 If _gDriverUnloadImageCount is greater
29 than zero, then an unload handler must be registered for this image and
30 the unload handler must invoke ProcessModuleUnloadList().
31 If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is
32 less than _gUefiDriverRevison, then return EFI_INCOMPATIBLE_VERSION.
34 @param ImageHandle The image handle of the Standalone MM Driver.
35 @param SystemTable A pointer to the EFI System Table.
37 @retval EFI_SUCCESS The Standalone MM Driver exited normally.
38 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than
39 SystemTable->Hdr.Revision.
40 @retval Other Return value from
41 ProcessModuleEntryPointList().
47 IN EFI_HANDLE ImageHandle
,
48 IN EFI_MM_SYSTEM_TABLE
*MmSystemTable
53 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
55 This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.
57 @param ImageHandle The image handle of the Standalone MM Driver.
58 @param SystemTable A pointer to the EFI System Table.
60 @retval EFI_SUCCESS The Standalone MM Driver exited normally.
61 @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than
62 SystemTable->Hdr.Revision.
63 @retval Other Return value from ProcessModuleEntryPointList().
68 IN EFI_HANDLE ImageHandle
,
69 IN EFI_MM_SYSTEM_TABLE
*MmSystemTable
73 Auto generated function that calls the library constructors for all of the module's
76 This function must be called by _ModuleEntryPoint().
77 This function calls the set of library constructors for the set of library instances
78 that a module depends on. This includes library instances that a module depends on
79 directly and library instances that a module depends on indirectly through other libraries.
80 This function is auto generated by build tools and those build tools are responsible
81 for collecting the set of library instances, determine which ones have constructors,
82 and calling the library constructors in the proper order based upon each of the library
83 instances own dependencies.
85 @param ImageHandle The image handle of the Standalone MM Driver.
86 @param SystemTable A pointer to the EFI System Table.
91 ProcessLibraryConstructorList (
92 IN EFI_HANDLE ImageHandle
,
93 IN EFI_MM_SYSTEM_TABLE
*MmSystemTable
98 Auto generated function that calls the library descructors for all of the module's
101 This function may be called by _ModuleEntryPoint() or ExitDriver().
102 This function calls the set of library destructors for the set of library instances
103 that a module depends on. This includes library instances that a module depends on
104 directly and library instances that a module depends on indirectly through other libraries.
105 This function is auto generated by build tools and those build tools are responsible for
106 collecting the set of library instances, determine which ones have destructors, and calling
107 the library destructors in the proper order based upon each of the library instances own dependencies.
109 @param ImageHandle The image handle of the Standalone MM Driver.
110 @param SystemTable A pointer to the EFI System Table.
115 ProcessLibraryDestructorList (
116 IN EFI_HANDLE ImageHandle
,
117 IN EFI_MM_SYSTEM_TABLE
*MmSystemTable
122 Auto generated function that calls a set of module entry points.
124 This function must be called by _ModuleEntryPoint().
125 This function calls the set of module entry points.
126 This function is auto generated by build tools and those build tools are responsible
127 for collecting the module entry points and calling them in a specified order.
129 @param ImageHandle The image handle of the Standalone MM Driver.
130 @param SystemTable A pointer to the EFI System Table.
132 @retval EFI_SUCCESS The Standalone MMDriver executed normally.
133 @retval !EFI_SUCCESS The Standalone MM Driver failed to execute normally.
137 ProcessModuleEntryPointList (
138 IN EFI_HANDLE ImageHandle
,
139 IN EFI_MM_SYSTEM_TABLE
*MmSystemTable