]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add SmmAccess PPI definition
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jul 2011 20:46:24 +0000 (20:46 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jul 2011 20:46:24 +0000 (20:46 +0000)
Signed-off-by: jljusten
Reviewed-by: mdkinney
Reviewed-by: geekboy15a
Reviewed-by: jyao1
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12027 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Ppi/SmmAccess.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec

diff --git a/MdeModulePkg/Include/Ppi/SmmAccess.h b/MdeModulePkg/Include/Ppi/SmmAccess.h
new file mode 100644 (file)
index 0000000..085ad64
--- /dev/null
@@ -0,0 +1,145 @@
+/** @file\r
+  EFI SMM Access PPI definition.\r
+\r
+  This PPI is used to control the visibility of the SMRAM on the platform.\r
+  It abstracts the location and characteristics of SMRAM.  The expectation is\r
+  that the north bridge or memory controller would publish this PPI.\r
+\r
+  The principal functionality found in the memory controller includes the following: \r
+  - Exposing the SMRAM to all non-SMM agents, or the "open" state\r
+  - Shrouding the SMRAM to all but the SMM agents, or the "closed" state\r
+  - Preserving the system integrity, or "locking" the SMRAM, such that the settings cannot be \r
+    perturbed by either boot service or runtime agents \r
+\r
+Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions\r
+of the BSD License which accompanies this distribution.  The\r
+full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _SMM_ACCESS_PPI_H_\r
+#define _SMM_ACCESS_PPI_H_\r
+\r
+#define PEI_SMM_ACCESS_PPI_GUID \\r
+  { 0x268f33a9, 0xcccd, 0x48be, { 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e, 0xd6 }}\r
+\r
+typedef struct _PEI_SMM_ACCESS_PPI  PEI_SMM_ACCESS_PPI;\r
+\r
+/**\r
+  Opens the SMRAM area to be accessible by a PEIM driver.\r
+\r
+  This function "opens" SMRAM so that it is visible while not inside of SMM. The function should \r
+  return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM. The function \r
+  should return EFI_DEVICE_ERROR if the SMRAM configuration is locked.\r
+\r
+  @param  PeiServices            General purpose services available to every PEIM.\r
+  @param  This                   The pointer to the SMM Access Interface.\r
+  @param  DescriptorIndex        The region of SMRAM to Open.\r
+  \r
+  @retval EFI_SUCCESS            The region was successfully opened.\r
+  @retval EFI_DEVICE_ERROR       The region could not be opened because locked by chipset.\r
+  @retval EFI_INVALID_PARAMETER  The descriptor index was out of bounds.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PEI_SMM_OPEN)(\r
+  IN EFI_PEI_SERVICES                **PeiServices,\r
+  IN PEI_SMM_ACCESS_PPI              *This,\r
+  IN UINTN                           DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Inhibits access to the SMRAM.\r
+\r
+  This function "closes" SMRAM so that it is not visible while outside of SMM. The function should \r
+  return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM.\r
+\r
+  @param  PeiServices              General purpose services available to every PEIM.\r
+  @param  This                     The pointer to the SMM Access Interface.\r
+  @param  DescriptorIndex          The region of SMRAM to Close.\r
+  \r
+  @retval EFI_SUCCESS              The region was successfully closed.\r
+  @retval EFI_DEVICE_ERROR         The region could not be closed because locked by chipset.                           \r
+  @retval EFI_INVALID_PARAMETER    The descriptor index was out of bounds.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PEI_SMM_CLOSE)(\r
+  IN EFI_PEI_SERVICES                **PeiServices,\r
+  IN PEI_SMM_ACCESS_PPI              *This,\r
+  IN UINTN                           DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Inhibits access to the SMRAM.\r
+\r
+  This function prohibits access to the SMRAM region.  This function is usually implemented such \r
+  that it is a write-once operation. \r
+\r
+  @param  PeiServices              General purpose services available to every PEIM.\r
+  @param  This                     The pointer to the SMM Access Interface.\r
+  @param  DescriptorIndex          The region of SMRAM to Close.\r
+  \r
+  @retval EFI_SUCCESS            The region was successfully locked.\r
+  @retval EFI_DEVICE_ERROR       The region could not be locked because at least\r
+                                 one range is still open.\r
+  @retval EFI_INVALID_PARAMETER  The descriptor index was out of bounds.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PEI_SMM_LOCK)(\r
+  IN EFI_PEI_SERVICES                **PeiServices,\r
+  IN PEI_SMM_ACCESS_PPI              *This,\r
+  IN UINTN                           DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Queries the memory controller for the possible regions that will support SMRAM.\r
+\r
+  @param  PeiServices           General purpose services available to every PEIM.\r
+  @param This                   The pointer to the SmmAccessPpi Interface.\r
+  @param SmramMapSize           The pointer to the variable containing size of the\r
+                                buffer to contain the description information.\r
+  @param SmramMap               The buffer containing the data describing the Smram\r
+                                region descriptors.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL  The user did not provide a sufficient buffer.\r
+  @retval EFI_SUCCESS           The user provided a sufficiently-sized buffer.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PEI_SMM_CAPABILITIES)(\r
+  IN EFI_PEI_SERVICES                **PeiServices,\r
+  IN PEI_SMM_ACCESS_PPI              *This,\r
+  IN OUT UINTN                       *SmramMapSize,\r
+  IN OUT EFI_SMRAM_DESCRIPTOR        *SmramMap\r
+  );\r
+\r
+///\r
+///  EFI SMM Access PPI is used to control the visibility of the SMRAM on the platform.\r
+///  It abstracts the location and characteristics of SMRAM.  The expectation is\r
+///  that the north bridge or memory controller would publish this PPI.\r
+/// \r
+struct _PEI_SMM_ACCESS_PPI {\r
+  PEI_SMM_OPEN          Open;\r
+  PEI_SMM_CLOSE         Close;\r
+  PEI_SMM_LOCK          Lock;\r
+  PEI_SMM_CAPABILITIES  GetCapabilities;\r
+  BOOLEAN               LockState;\r
+  BOOLEAN               OpenState;\r
+};\r
+\r
+extern EFI_GUID gPeiSmmAccessPpiGuid;\r
+\r
+#endif\r
index a86a0462c4805240e1405bbb1a01399a2d53050f..a983c559726666b83b30890223ba85329da91cd0 100644 (file)
   ## Include/Ppi/Capsule.h\r
   gPeiCapsulePpiGuid             = { 0x3acf33ee, 0xd892, 0x40f4, { 0xa2, 0xfc, 0x38, 0x54, 0xd2, 0xe1, 0x32, 0x3d }}\r
 \r
+  ## Include/Ppi/SmmAccess.h\r
+  gPeiSmmAccessPpiGuid          =  { 0x268f33a9, 0xcccd, 0x48be, { 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e, 0xd6 }}\r
+\r
 [Protocols]\r
   ## Load File protocol provides capability to load and unload EFI image into memory and execute it.\r
   #  Include/Protocol/LoadPe32Image.h\r