--- /dev/null
+/** @file\r
+\r
+ The common header file for SMM FVB module and SMM FVB runtime Module.\r
+\r
+Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR>\r
+ \r\r
+ This program and the accompanying materials are licensed and made available under\r\r
+ the terms and conditions of the BSD License that accompanies this distribution. \r\r
+ The full text of the license may be found at \r\r
+ http://opensource.org/licenses/bsd-license.php. \r\r
+ \r\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r\r
+ \r\r
+\r
+**/\r
+\r
+#ifndef _SMM_FVB_COMMON_H_\r
+#define _SMM_FVB_COMMON_H_\r
+\r
+#include <Protocol/SmmFirmwareVolumeBlock.h>\r
+\r
+#define EFI_FUNCTION_GET_ATTRIBUTES 1\r
+#define EFI_FUNCTION_SET_ATTRIBUTES 2\r
+#define EFI_FUNCTION_GET_PHYSICAL_ADDRESS 3\r
+#define EFI_FUNCTION_GET_BLOCK_SIZE 4\r
+#define EFI_FUNCTION_READ 5\r
+#define EFI_FUNCTION_WRITE 6\r
+#define EFI_FUNCTION_ERASE_BLOCKS 7\r
+\r
+typedef struct {\r
+ UINTN Function;\r
+ EFI_STATUS ReturnStatus;\r
+ UINT8 Data[1];\r
+} SMM_FVB_COMMUNICATE_FUNCTION_HEADER;\r
+\r
+\r
+///\r
+/// Size of SMM communicate header, without including the payload.\r
+///\r
+#define SMM_COMMUNICATE_HEADER_SIZE (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))\r
+\r
+///\r
+/// Size of SMM FVB communicate function header, without including the payload.\r
+///\r
+#define SMM_FVB_COMMUNICATE_HEADER_SIZE (OFFSET_OF (SMM_FVB_COMMUNICATE_FUNCTION_HEADER, Data))\r
+\r
+typedef struct {\r
+ EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;\r
+ EFI_FVB_ATTRIBUTES_2 Attributes;\r
+} SMM_FVB_ATTRIBUTES_HEADER;\r
+\r
+typedef struct {\r
+ EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;\r
+ EFI_PHYSICAL_ADDRESS Address;\r
+} SMM_FVB_PHYSICAL_ADDRESS_HEADER;\r
+\r
+typedef struct {\r
+ EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;\r
+ EFI_LBA Lba;\r
+ UINTN BlockSize;\r
+ UINTN NumOfBlocks;\r
+} SMM_FVB_BLOCK_SIZE_HEADER;\r
+\r
+typedef struct {\r
+ EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;\r
+ EFI_LBA Lba;\r
+ UINTN Offset;\r
+ UINTN NumBytes;\r
+} SMM_FVB_READ_WRITE_HEADER;\r
+\r
+typedef struct {\r
+ EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;\r
+ EFI_LBA StartLba;\r
+ UINTN NumOfLba;\r
+} SMM_FVB_BLOCKS_HEADER;\r
+\r
+#endif\r