5 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved
7 This program and the accompanying materials are licensed and made available under
8 the terms and conditions of the BSD License that accompanies this distribution.
9 The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
25 This code abstracts the PEI core to provide SmmAccess services.
29 #ifndef _PEI_SMM_ACCESS_PPI_H_
30 #define _PEI_SMM_ACCESS_PPI_H_
33 #include "Guid/SmramMemoryReserve/SmramMemoryReserve.h"
35 #include "Guid/SmramMemoryReserve.h"
38 #define PEI_SMM_ACCESS_PPI_GUID \
40 0x268f33a9, 0xcccd, 0x48be, 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e, 0xd6 \
43 typedef struct _PEI_SMM_ACCESS_PPI PEI_SMM_ACCESS_PPI
;
47 (EFIAPI
*PEI_SMM_OPEN
) (
48 IN EFI_PEI_SERVICES
**PeiServices
,
49 IN PEI_SMM_ACCESS_PPI
*This
,
50 IN UINTN DescriptorIndex
55 This routine accepts a request to "open" a region of SMRAM. The
56 region could be legacy ABSEG, HSEG, or TSEG near top of physical memory.
57 The use of "open" means that the memory is visible from all PEIM
61 PeiServices - General purpose services available to every PEIM.
62 This - Pointer to the SMM Access Interface.
63 DescriptorIndex - Region of SMRAM to Open.
66 EFI_SUCCESS - The region was successfully opened.
67 EFI_DEVICE_ERROR - The region could not be opened because locked by
69 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
75 (EFIAPI
*PEI_SMM_CLOSE
) (
76 IN EFI_PEI_SERVICES
**PeiServices
,
77 IN PEI_SMM_ACCESS_PPI
*This
,
78 IN UINTN DescriptorIndex
83 This routine accepts a request to "close" a region of SMRAM. The
84 region could be legacy AB or TSEG near top of physical memory.
85 The use of "close" means that the memory is only visible from SMM agents,
89 PeiServices - General purpose services available to every PEIM.
90 This - Pointer to the SMM Access Interface.
91 DescriptorIndex - Region of SMRAM to Close.
94 EFI_SUCCESS - The region was successfully closed.
95 EFI_DEVICE_ERROR - The region could not be closed because locked by
97 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
104 (EFIAPI
*PEI_SMM_LOCK
) (
105 IN EFI_PEI_SERVICES
**PeiServices
,
106 IN PEI_SMM_ACCESS_PPI
*This
,
107 IN UINTN DescriptorIndex
112 This routine accepts a request to "lock" SMRAM. The
113 region could be legacy AB or TSEG near top of physical memory.
114 The use of "lock" means that the memory can no longer be opened
118 PeiServices - General purpose services available to every PEIM.
119 This - Pointer to the SMM Access Interface.
120 DescriptorIndex - Region of SMRAM to Lock.
123 EFI_SUCCESS - The region was successfully locked.
124 EFI_DEVICE_ERROR - The region could not be locked because at least
125 one range is still open.
126 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
133 (EFIAPI
*PEI_SMM_CAPABILITIES
) (
134 IN EFI_PEI_SERVICES
**PeiServices
,
135 IN PEI_SMM_ACCESS_PPI
*This
,
136 IN OUT UINTN
*SmramMapSize
,
137 IN OUT EFI_SMRAM_DESCRIPTOR
*SmramMap
142 This routine services a user request to discover the SMRAM
143 capabilities of this platform. This will report the possible
144 ranges that are possible for SMRAM access, based upon the
145 memory controller capabilities.
148 PeiServices - General purpose services available to every PEIM.
149 This - Pointer to the SMRAM Access Interface.
150 SmramMapSize - Pointer to the variable containing size of the
151 buffer to contain the description information.
152 SmramMap - Buffer containing the data describing the Smram
155 EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient buffer.
156 EFI_SUCCESS - The user provided a sufficiently-sized buffer.
160 struct _PEI_SMM_ACCESS_PPI
{
164 PEI_SMM_CAPABILITIES GetCapabilities
;
169 extern EFI_GUID gPeiSmmAccessPpiGuid
;