]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/SmmConfiguration.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmConfiguration.h
1 /** @file
2 EFI SMM Configuration Protocol as defined in the PI 1.2 specification.
3
4 This protocol is used to:
5 1) report the portions of SMRAM regions which cannot be used for the SMRAM heap.
6 2) register the SMM Foundation entry point with the processor code. The entry
7 point will be invoked by the SMM processor entry code.
8
9 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
10 This program and the accompanying materials
11 are licensed and made available under the terms and conditions of the BSD License
12 which accompanies this distribution. The full text of the license may be found at
13 http://opensource.org/licenses/bsd-license.php
14
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17
18 **/
19
20 #ifndef _SMM_CONFIGURATION_H_
21 #define _SMM_CONFIGURATION_H_
22
23 #include <Protocol/MmConfiguration.h>
24 #include <Pi/PiSmmCis.h>
25
26 #define EFI_SMM_CONFIGURATION_PROTOCOL_GUID EFI_MM_CONFIGURATION_PROTOCOL_GUID
27
28 ///
29 /// Structure describing a SMRAM region which cannot be used for the SMRAM heap.
30 ///
31 typedef struct _EFI_SMM_RESERVED_SMRAM_REGION {
32 ///
33 /// Starting address of the reserved SMRAM area, as it appears while SMRAM is open.
34 /// Ignored if SmramReservedSize is 0.
35 ///
36 EFI_PHYSICAL_ADDRESS SmramReservedStart;
37 ///
38 /// Number of bytes occupied by the reserved SMRAM area. A size of zero indicates the
39 /// last SMRAM area.
40 ///
41 UINT64 SmramReservedSize;
42 } EFI_SMM_RESERVED_SMRAM_REGION;
43
44 typedef struct _EFI_SMM_CONFIGURATION_PROTOCOL EFI_SMM_CONFIGURATION_PROTOCOL;
45
46 /**
47 Register the SMM Foundation entry point.
48
49 This function registers the SMM Foundation entry point with the processor code. This entry point
50 will be invoked by the SMM Processor entry code.
51
52 @param[in] This The EFI_SMM_CONFIGURATION_PROTOCOL instance.
53 @param[in] SmmEntryPoint SMM Foundation entry point.
54
55 @retval EFI_SUCCESS Success to register SMM Entry Point.
56 @retval EFI_INVALID_PARAMETER SmmEntryPoint is NULL.
57 **/
58 typedef
59 EFI_STATUS
60 (EFIAPI *EFI_SMM_REGISTER_SMM_ENTRY)(
61 IN CONST EFI_SMM_CONFIGURATION_PROTOCOL *This,
62 IN EFI_SMM_ENTRY_POINT SmmEntryPoint
63 );
64
65 ///
66 /// The EFI SMM Configuration Protocol is a mandatory protocol published by a DXE CPU driver to
67 /// indicate which areas within SMRAM are reserved for use by the CPU for any purpose,
68 /// such as stack, save state or SMM entry point.
69 ///
70 /// The RegisterSmmEntry() function allows the SMM IPL DXE driver to register the SMM
71 /// Foundation entry point with the SMM entry vector code.
72 ///
73 struct _EFI_SMM_CONFIGURATION_PROTOCOL {
74 ///
75 /// A pointer to an array SMRAM ranges used by the initial SMM entry code.
76 ///
77 EFI_SMM_RESERVED_SMRAM_REGION *SmramReservedRegions;
78 EFI_SMM_REGISTER_SMM_ENTRY RegisterSmmEntry;
79 };
80
81 extern EFI_GUID gEfiSmmConfigurationProtocolGuid;
82
83 #endif
84