]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/MmConfiguration.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / MmConfiguration.h
1 /** @file
2 EFI MM Configuration Protocol as defined in the PI 1.5 specification.
3
4 This protocol is used to:
5 1) report the portions of MMRAM regions which cannot be used for the MMRAM heap.
6 2) register the MM Foundation entry point with the processor code. The entry
7 point will be invoked by the MM processor entry code.
8
9 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
10 SPDX-License-Identifier: BSD-2-Clause-Patent
11
12 **/
13
14 #ifndef _MM_CONFIGURATION_H_
15 #define _MM_CONFIGURATION_H_
16
17 #include <Pi/PiMmCis.h>
18
19 #define EFI_MM_CONFIGURATION_PROTOCOL_GUID \
20 { \
21 0x26eeb3de, 0xb689, 0x492e, {0x80, 0xf0, 0xbe, 0x8b, 0xd7, 0xda, 0x4b, 0xa7 } \
22 }
23
24 ///
25 /// Structure describing a MMRAM region which cannot be used for the MMRAM heap.
26 ///
27 typedef struct _EFI_MM_RESERVED_MMRAM_REGION {
28 ///
29 /// Starting address of the reserved MMRAM area, as it appears while MMRAM is open.
30 /// Ignored if MmramReservedSize is 0.
31 ///
32 EFI_PHYSICAL_ADDRESS MmramReservedStart;
33 ///
34 /// Number of bytes occupied by the reserved MMRAM area. A size of zero indicates the
35 /// last MMRAM area.
36 ///
37 UINT64 MmramReservedSize;
38 } EFI_MM_RESERVED_MMRAM_REGION;
39
40 typedef struct _EFI_MM_CONFIGURATION_PROTOCOL EFI_MM_CONFIGURATION_PROTOCOL;
41
42 /**
43 Register the MM Foundation entry point.
44
45 This function registers the MM Foundation entry point with the processor code. This entry point
46 will be invoked by the MM Processor entry code.
47
48 @param[in] This The EFI_MM_CONFIGURATION_PROTOCOL instance.
49 @param[in] MmEntryPoint MM Foundation entry point.
50
51 @retval EFI_SUCCESS Success to register MM Entry Point.
52 @retval EFI_INVALID_PARAMETER MmEntryPoint is NULL.
53 **/
54 typedef
55 EFI_STATUS
56 (EFIAPI *EFI_MM_REGISTER_MM_ENTRY)(
57 IN CONST EFI_MM_CONFIGURATION_PROTOCOL *This,
58 IN EFI_MM_ENTRY_POINT MmEntryPoint
59 );
60
61 ///
62 /// The EFI MM Configuration Protocol is a mandatory protocol published by a DXE CPU driver to
63 /// indicate which areas within MMRAM are reserved for use by the CPU for any purpose,
64 /// such as stack, save state or MM entry point.
65 ///
66 /// The RegistermmEntry() function allows the MM IPL DXE driver to register the MM
67 /// Foundation entry point with the MM entry vector code.
68 ///
69 struct _EFI_MM_CONFIGURATION_PROTOCOL {
70 ///
71 /// A pointer to an array MMRAM ranges used by the initial MM entry code.
72 ///
73 EFI_MM_RESERVED_MMRAM_REGION *MmramReservedRegions;
74 EFI_MM_REGISTER_MM_ENTRY RegisterMmEntry;
75 };
76
77 extern EFI_GUID gEfiMmConfigurationProtocolGuid;
78
79 #endif
80