--- /dev/null
+/** @file\r
+ This file declares SMM SMRAM Access abstraction protocol\r
+\r
+ Copyright (c) 2006, Intel Corporation \r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The 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
+ Module Name: SmmAccess.h\r
+\r
+ @par Revision Reference:\r
+ This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+ Version 0.9.\r
+**/\r
+\r
+#ifndef _SMM_ACCESS_H_\r
+#define _SMM_ACCESS_H_\r
+\r
+typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;\r
+\r
+#define EFI_SMM_ACCESS_PROTOCOL_GUID \\r
+ { \\r
+ 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r
+ }\r
+\r
+//\r
+// SMM Access specification constant and types\r
+//\r
+// *******************************************************\r
+// EFI_SMRAM_STATE\r
+// *******************************************************\r
+//\r
+#define EFI_SMRAM_OPEN 0x00000001\r
+#define EFI_SMRAM_CLOSED 0x00000002\r
+#define EFI_SMRAM_LOCKED 0x00000004\r
+#define EFI_CACHEABLE 0x00000008\r
+#define EFI_ALLOCATED 0x00000010\r
+\r
+//\r
+// SMM Access specification Member Function\r
+//\r
+/**\r
+ Opens the SMRAM area to be accessible by a boot-service driver.\r
+\r
+ @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
+ @param DescriptorIndex Indicates that the driver wishes to open\r
+ the memory tagged by this index.\r
+\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+ @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_OPEN) (\r
+ IN EFI_SMM_ACCESS_PROTOCOL *This,\r
+ UINTN DescriptorIndex\r
+ );\r
+\r
+/**\r
+ Inhibits access to the SMRAM.\r
+\r
+ @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
+ @param DescriptorIndex Indicates that the driver wishes to open\r
+ the memory tagged by this index.\r
+\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
+ @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+ @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CLOSE) (\r
+ IN EFI_SMM_ACCESS_PROTOCOL *This,\r
+ UINTN DescriptorIndex\r
+ );\r
+\r
+/**\r
+ Inhibits access to the SMRAM.\r
+ @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
+ @param DescriptorIndex Indicates that the driver wishes to open\r
+ the memory tagged by this index.\r
+\r
+ @retval EFI_SUCCESS The operation was successful.\r
+ @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
+ @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+ @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_LOCK) (\r
+ IN EFI_SMM_ACCESS_PROTOCOL *This,\r
+ UINTN DescriptorIndex\r
+ );\r
+\r
+/**\r
+ Queries the memory controller for the possible regions that will support SMRAM.\r
+\r
+ @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
+ @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r
+ @param SmramMap A pointer to the buffer in which firmware places the current memory map.\r
+\r
+ @retval EFI_SUCCESS The chipset supported the given resource.\r
+ @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CAPABILITIES) (\r
+ IN EFI_SMM_ACCESS_PROTOCOL *This,\r
+ IN OUT UINTN *SmramMapSize,\r
+ IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r
+ );\r
+\r
+/**\r
+ @par Protocol Description:\r
+ This protocol is used to control the visibility of the SMRAM on the platform.\r
+\r
+ @param Open\r
+ Opens the SMRAM. \r
+\r
+ @param Close\r
+ Closes the SMRAM.\r
+\r
+ @param Lock\r
+ Locks the SMRAM. \r
+\r
+ @param GetCapabilities\r
+ Gets information on possible SMRAM regions.\r
+\r
+ @param LockState\r
+Indicates the current state of the SMRAM. Set to TRUE if any region is locked. \r
+\r
+ @param OpenState\r
+Indicates the current state of the SMRAM. Set to TRUE if any region is open. \r
+\r
+**/\r
+struct _EFI_SMM_ACCESS_PROTOCOL {\r
+ EFI_SMM_OPEN Open;\r
+ EFI_SMM_CLOSE Close;\r
+ EFI_SMM_LOCK Lock;\r
+ EFI_SMM_CAPABILITIES GetCapabilities;\r
+ BOOLEAN LockState;\r
+ BOOLEAN OpenState;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmAccessProtocolGuid;\r
+\r
+#endif\r