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