Commit | Line | Data |
---|---|---|
3cbfba02 DW |
1 | //\r |
2 | //\r | |
3 | /*++\r | |
4 | \r | |
5 | Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved\r | |
6 | \r | |
7 | This program and the accompanying materials are licensed and made available under\r | |
8 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
9 | The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php.\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | \r | |
16 | \r | |
17 | Module Name:\r | |
18 | \r | |
19 | SmmAccess.h\r | |
20 | \r | |
21 | Abstract:\r | |
22 | \r | |
23 | SmmAccess PPI\r | |
24 | \r | |
25 | This code abstracts the PEI core to provide SmmAccess services.\r | |
26 | \r | |
27 | --*/\r | |
28 | \r | |
29 | #ifndef _PEI_SMM_ACCESS_PPI_H_\r | |
30 | #define _PEI_SMM_ACCESS_PPI_H_\r | |
31 | \r | |
32 | #ifdef ECP_FLAG\r | |
33 | #include "Guid/SmramMemoryReserve/SmramMemoryReserve.h"\r | |
34 | #else\r | |
35 | #include "Guid/SmramMemoryReserve.h"\r | |
36 | #endif\r | |
37 | \r | |
38 | #define PEI_SMM_ACCESS_PPI_GUID \\r | |
39 | { \\r | |
40 | 0x268f33a9, 0xcccd, 0x48be, 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e, 0xd6 \\r | |
41 | }\r | |
42 | \r | |
43 | typedef struct _PEI_SMM_ACCESS_PPI PEI_SMM_ACCESS_PPI;\r | |
44 | \r | |
45 | typedef\r | |
46 | EFI_STATUS\r | |
47 | (EFIAPI *PEI_SMM_OPEN) (\r | |
48 | IN EFI_PEI_SERVICES **PeiServices,\r | |
49 | IN PEI_SMM_ACCESS_PPI *This,\r | |
50 | IN UINTN DescriptorIndex\r | |
51 | )\r | |
52 | /*++\r | |
53 | \r | |
54 | Routine Description:\r | |
55 | This routine accepts a request to "open" a region of SMRAM. The\r | |
56 | region could be legacy ABSEG, HSEG, or TSEG near top of physical memory.\r | |
57 | The use of "open" means that the memory is visible from all PEIM\r | |
58 | and SMM agents.\r | |
59 | \r | |
60 | Arguments:\r | |
61 | PeiServices - General purpose services available to every PEIM.\r | |
62 | This - Pointer to the SMM Access Interface.\r | |
63 | DescriptorIndex - Region of SMRAM to Open.\r | |
64 | \r | |
65 | Returns:\r | |
66 | EFI_SUCCESS - The region was successfully opened.\r | |
67 | EFI_DEVICE_ERROR - The region could not be opened because locked by\r | |
68 | chipset.\r | |
69 | EFI_INVALID_PARAMETER - The descriptor index was out of bounds.\r | |
70 | --*/\r | |
71 | ;\r | |
72 | \r | |
73 | typedef\r | |
74 | EFI_STATUS\r | |
75 | (EFIAPI *PEI_SMM_CLOSE) (\r | |
76 | IN EFI_PEI_SERVICES **PeiServices,\r | |
77 | IN PEI_SMM_ACCESS_PPI *This,\r | |
78 | IN UINTN DescriptorIndex\r | |
79 | )\r | |
80 | /*++\r | |
81 | \r | |
82 | Routine Description:\r | |
83 | This routine accepts a request to "close" a region of SMRAM. The\r | |
84 | region could be legacy AB or TSEG near top of physical memory.\r | |
85 | The use of "close" means that the memory is only visible from SMM agents,\r | |
86 | not from PEIM.\r | |
87 | \r | |
88 | Arguments:\r | |
89 | PeiServices - General purpose services available to every PEIM.\r | |
90 | This - Pointer to the SMM Access Interface.\r | |
91 | DescriptorIndex - Region of SMRAM to Close.\r | |
92 | \r | |
93 | Returns:\r | |
94 | EFI_SUCCESS - The region was successfully closed.\r | |
95 | EFI_DEVICE_ERROR - The region could not be closed because locked by\r | |
96 | chipset.\r | |
97 | EFI_INVALID_PARAMETER - The descriptor index was out of bounds.\r | |
98 | \r | |
99 | --*/\r | |
100 | ;\r | |
101 | \r | |
102 | typedef\r | |
103 | EFI_STATUS\r | |
104 | (EFIAPI *PEI_SMM_LOCK) (\r | |
105 | IN EFI_PEI_SERVICES **PeiServices,\r | |
106 | IN PEI_SMM_ACCESS_PPI *This,\r | |
107 | IN UINTN DescriptorIndex\r | |
108 | )\r | |
109 | /*++\r | |
110 | \r | |
111 | Routine Description:\r | |
112 | This routine accepts a request to "lock" SMRAM. The\r | |
113 | region could be legacy AB or TSEG near top of physical memory.\r | |
114 | The use of "lock" means that the memory can no longer be opened\r | |
115 | to PEIM.\r | |
116 | \r | |
117 | Arguments:\r | |
118 | PeiServices - General purpose services available to every PEIM.\r | |
119 | This - Pointer to the SMM Access Interface.\r | |
120 | DescriptorIndex - Region of SMRAM to Lock.\r | |
121 | \r | |
122 | Returns:\r | |
123 | EFI_SUCCESS - The region was successfully locked.\r | |
124 | EFI_DEVICE_ERROR - The region could not be locked because at least\r | |
125 | one range is still open.\r | |
126 | EFI_INVALID_PARAMETER - The descriptor index was out of bounds.\r | |
127 | \r | |
128 | --*/\r | |
129 | ;\r | |
130 | \r | |
131 | typedef\r | |
132 | EFI_STATUS\r | |
133 | (EFIAPI *PEI_SMM_CAPABILITIES) (\r | |
134 | IN EFI_PEI_SERVICES **PeiServices,\r | |
135 | IN PEI_SMM_ACCESS_PPI *This,\r | |
136 | IN OUT UINTN *SmramMapSize,\r | |
137 | IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r | |
138 | )\r | |
139 | /*++\r | |
140 | \r | |
141 | Routine Description:\r | |
142 | This routine services a user request to discover the SMRAM\r | |
143 | capabilities of this platform. This will report the possible\r | |
144 | ranges that are possible for SMRAM access, based upon the\r | |
145 | memory controller capabilities.\r | |
146 | \r | |
147 | Arguments:\r | |
148 | PeiServices - General purpose services available to every PEIM.\r | |
149 | This - Pointer to the SMRAM Access Interface.\r | |
150 | SmramMapSize - Pointer to the variable containing size of the\r | |
151 | buffer to contain the description information.\r | |
152 | SmramMap - Buffer containing the data describing the Smram\r | |
153 | region descriptors.\r | |
154 | Returns:\r | |
155 | EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient buffer.\r | |
156 | EFI_SUCCESS - The user provided a sufficiently-sized buffer.\r | |
157 | --*/\r | |
158 | ;\r | |
159 | \r | |
160 | struct _PEI_SMM_ACCESS_PPI {\r | |
161 | PEI_SMM_OPEN Open;\r | |
162 | PEI_SMM_CLOSE Close;\r | |
163 | PEI_SMM_LOCK Lock;\r | |
164 | PEI_SMM_CAPABILITIES GetCapabilities;\r | |
165 | BOOLEAN LockState;\r | |
166 | BOOLEAN OpenState;\r | |
167 | };\r | |
168 | \r | |
169 | extern EFI_GUID gPeiSmmAccessPpiGuid;\r | |
170 | \r | |
171 | #endif\r |