]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/ValleyView2Soc/NorthCluster/Include/Ppi/SmmAccess.h
Vlv2DeviceRefCodePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / ValleyView2Soc / NorthCluster / Include / Ppi / SmmAccess.h
1 //
2 //
3 /*++
4
5 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9
10
11 Module Name:
12
13 SmmAccess.h
14
15 Abstract:
16
17 SmmAccess PPI
18
19 This code abstracts the PEI core to provide SmmAccess services.
20
21 --*/
22
23 #ifndef _PEI_SMM_ACCESS_PPI_H_
24 #define _PEI_SMM_ACCESS_PPI_H_
25
26 #ifdef ECP_FLAG
27 #include "Guid/SmramMemoryReserve/SmramMemoryReserve.h"
28 #else
29 #include "Guid/SmramMemoryReserve.h"
30 #endif
31
32 #define PEI_SMM_ACCESS_PPI_GUID \
33 { \
34 0x268f33a9, 0xcccd, 0x48be, 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e, 0xd6 \
35 }
36
37 typedef struct _PEI_SMM_ACCESS_PPI PEI_SMM_ACCESS_PPI;
38
39 typedef
40 EFI_STATUS
41 (EFIAPI *PEI_SMM_OPEN) (
42 IN EFI_PEI_SERVICES **PeiServices,
43 IN PEI_SMM_ACCESS_PPI *This,
44 IN UINTN DescriptorIndex
45 )
46 /*++
47
48 Routine Description:
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
52 and SMM agents.
53
54 Arguments:
55 PeiServices - General purpose services available to every PEIM.
56 This - Pointer to the SMM Access Interface.
57 DescriptorIndex - Region of SMRAM to Open.
58
59 Returns:
60 EFI_SUCCESS - The region was successfully opened.
61 EFI_DEVICE_ERROR - The region could not be opened because locked by
62 chipset.
63 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
64 --*/
65 ;
66
67 typedef
68 EFI_STATUS
69 (EFIAPI *PEI_SMM_CLOSE) (
70 IN EFI_PEI_SERVICES **PeiServices,
71 IN PEI_SMM_ACCESS_PPI *This,
72 IN UINTN DescriptorIndex
73 )
74 /*++
75
76 Routine Description:
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,
80 not from PEIM.
81
82 Arguments:
83 PeiServices - General purpose services available to every PEIM.
84 This - Pointer to the SMM Access Interface.
85 DescriptorIndex - Region of SMRAM to Close.
86
87 Returns:
88 EFI_SUCCESS - The region was successfully closed.
89 EFI_DEVICE_ERROR - The region could not be closed because locked by
90 chipset.
91 EFI_INVALID_PARAMETER - The descriptor index was out of bounds.
92
93 --*/
94 ;
95
96 typedef
97 EFI_STATUS
98 (EFIAPI *PEI_SMM_LOCK) (
99 IN EFI_PEI_SERVICES **PeiServices,
100 IN PEI_SMM_ACCESS_PPI *This,
101 IN UINTN DescriptorIndex
102 )
103 /*++
104
105 Routine Description:
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
109 to PEIM.
110
111 Arguments:
112 PeiServices - General purpose services available to every PEIM.
113 This - Pointer to the SMM Access Interface.
114 DescriptorIndex - Region of SMRAM to Lock.
115
116 Returns:
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.
121
122 --*/
123 ;
124
125 typedef
126 EFI_STATUS
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
132 )
133 /*++
134
135 Routine Description:
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.
140
141 Arguments:
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
147 region descriptors.
148 Returns:
149 EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient buffer.
150 EFI_SUCCESS - The user provided a sufficiently-sized buffer.
151 --*/
152 ;
153
154 struct _PEI_SMM_ACCESS_PPI {
155 PEI_SMM_OPEN Open;
156 PEI_SMM_CLOSE Close;
157 PEI_SMM_LOCK Lock;
158 PEI_SMM_CAPABILITIES GetCapabilities;
159 BOOLEAN LockState;
160 BOOLEAN OpenState;
161 };
162
163 extern EFI_GUID gPeiSmmAccessPpiGuid;
164
165 #endif