]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbSmmCommon.h
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2TbltDevicePkg / FvbRuntimeDxe / FvbSmmCommon.h
1 /** @file
2
3 The common header file for SMM FVB module and SMM FVB runtime Module.
4
5 Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR>
6
7 This program and the accompanying materials are licensed and made available under
8 the terms and conditions of the BSD License that accompanies this distribution.
9 The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15
16 **/
17
18 #ifndef _SMM_FVB_COMMON_H_
19 #define _SMM_FVB_COMMON_H_
20
21 #include <Protocol/SmmFirmwareVolumeBlock.h>
22
23 #define EFI_FUNCTION_GET_ATTRIBUTES 1
24 #define EFI_FUNCTION_SET_ATTRIBUTES 2
25 #define EFI_FUNCTION_GET_PHYSICAL_ADDRESS 3
26 #define EFI_FUNCTION_GET_BLOCK_SIZE 4
27 #define EFI_FUNCTION_READ 5
28 #define EFI_FUNCTION_WRITE 6
29 #define EFI_FUNCTION_ERASE_BLOCKS 7
30
31 typedef struct {
32 UINTN Function;
33 EFI_STATUS ReturnStatus;
34 UINT8 Data[1];
35 } SMM_FVB_COMMUNICATE_FUNCTION_HEADER;
36
37
38 ///
39 /// Size of SMM communicate header, without including the payload.
40 ///
41 #define SMM_COMMUNICATE_HEADER_SIZE (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))
42
43 ///
44 /// Size of SMM FVB communicate function header, without including the payload.
45 ///
46 #define SMM_FVB_COMMUNICATE_HEADER_SIZE (OFFSET_OF (SMM_FVB_COMMUNICATE_FUNCTION_HEADER, Data))
47
48 typedef struct {
49 EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;
50 EFI_FVB_ATTRIBUTES_2 Attributes;
51 } SMM_FVB_ATTRIBUTES_HEADER;
52
53 typedef struct {
54 EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;
55 EFI_PHYSICAL_ADDRESS Address;
56 } SMM_FVB_PHYSICAL_ADDRESS_HEADER;
57
58 typedef struct {
59 EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;
60 EFI_LBA Lba;
61 UINTN BlockSize;
62 UINTN NumOfBlocks;
63 } SMM_FVB_BLOCK_SIZE_HEADER;
64
65 typedef struct {
66 EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;
67 EFI_LBA Lba;
68 UINTN Offset;
69 UINTN NumBytes;
70 } SMM_FVB_READ_WRITE_HEADER;
71
72 typedef struct {
73 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *SmmFvb;
74 EFI_LBA StartLba;
75 UINTN NumOfLba;
76 } SMM_FVB_BLOCKS_HEADER;
77
78 #endif