5 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved
7 SPDX-License-Identifier: BSD-2-Clause-Patent
19 This code abstracts the PEI core to provide SmmAccess services.
23 #ifndef _PEI_SMM_ACCESS_PPI_H_
24 #define _PEI_SMM_ACCESS_PPI_H_
27 #include "Guid/SmramMemoryReserve/SmramMemoryReserve.h"
29 #include "Guid/SmramMemoryReserve.h"
32 #define PEI_SMM_ACCESS_PPI_GUID \
34 0x268f33a9, 0xcccd, 0x48be, 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e, 0xd6 \
37 typedef struct _PEI_SMM_ACCESS_PPI PEI_SMM_ACCESS_PPI
;
41 (EFIAPI
*PEI_SMM_OPEN
) (
42 IN EFI_PEI_SERVICES
**PeiServices
,
43 IN PEI_SMM_ACCESS_PPI
*This
,
44 IN UINTN DescriptorIndex
49 This routine accepts a request to "open" a region of SMRAM. The
50 region could be legacy ABSEG, HSEG, or TSEG near top of physical memory.
51 The use of "open" means that the memory is visible from all PEIM
55 PeiServices - General purpose services available to every PEIM.
56 This - Pointer to the SMM Access Interface.
57 DescriptorIndex - Region of SMRAM to Open.
60 EFI_SUCCESS - The region was successfully opened.
61 EFI_DEVICE_ERROR - The region could not be opened because locked by
63 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
69 (EFIAPI
*PEI_SMM_CLOSE
) (
70 IN EFI_PEI_SERVICES
**PeiServices
,
71 IN PEI_SMM_ACCESS_PPI
*This
,
72 IN UINTN DescriptorIndex
77 This routine accepts a request to "close" a region of SMRAM. The
78 region could be legacy AB or TSEG near top of physical memory.
79 The use of "close" means that the memory is only visible from SMM agents,
83 PeiServices - General purpose services available to every PEIM.
84 This - Pointer to the SMM Access Interface.
85 DescriptorIndex - Region of SMRAM to Close.
88 EFI_SUCCESS - The region was successfully closed.
89 EFI_DEVICE_ERROR - The region could not be closed because locked by
91 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
98 (EFIAPI
*PEI_SMM_LOCK
) (
99 IN EFI_PEI_SERVICES
**PeiServices
,
100 IN PEI_SMM_ACCESS_PPI
*This
,
101 IN UINTN DescriptorIndex
106 This routine accepts a request to "lock" SMRAM. The
107 region could be legacy AB or TSEG near top of physical memory.
108 The use of "lock" means that the memory can no longer be opened
112 PeiServices - General purpose services available to every PEIM.
113 This - Pointer to the SMM Access Interface.
114 DescriptorIndex - Region of SMRAM to Lock.
117 EFI_SUCCESS - The region was successfully locked.
118 EFI_DEVICE_ERROR - The region could not be locked because at least
119 one range is still open.
120 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
127 (EFIAPI
*PEI_SMM_CAPABILITIES
) (
128 IN EFI_PEI_SERVICES
**PeiServices
,
129 IN PEI_SMM_ACCESS_PPI
*This
,
130 IN OUT UINTN
*SmramMapSize
,
131 IN OUT EFI_SMRAM_DESCRIPTOR
*SmramMap
136 This routine services a user request to discover the SMRAM
137 capabilities of this platform. This will report the possible
138 ranges that are possible for SMRAM access, based upon the
139 memory controller capabilities.
142 PeiServices - General purpose services available to every PEIM.
143 This - Pointer to the SMRAM Access Interface.
144 SmramMapSize - Pointer to the variable containing size of the
145 buffer to contain the description information.
146 SmramMap - Buffer containing the data describing the Smram
149 EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient buffer.
150 EFI_SUCCESS - The user provided a sufficiently-sized buffer.
154 struct _PEI_SMM_ACCESS_PPI
{
158 PEI_SMM_CAPABILITIES GetCapabilities
;
163 extern EFI_GUID gPeiSmmAccessPpiGuid
;