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