3 The common header file for SMM FTW module and SMM FTW DXE Module.
5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. <BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __SMM_FTW_COMMON_H__
17 #define __SMM_FTW_COMMON_H__
19 #include <Protocol/SmmFirmwareVolumeBlock.h>
20 #include <Protocol/SmmFaultTolerantWrite.h>
22 #define FTW_FUNCTION_GET_MAX_BLOCK_SIZE 1
23 #define FTW_FUNCTION_ALLOCATE 2
24 #define FTW_FUNCTION_WRITE 3
25 #define FTW_FUNCTION_RESTART 4
26 #define FTW_FUNCTION_ABORT 5
27 #define FTW_FUNCTION_GET_LAST_WRITE 6
31 EFI_STATUS ReturnStatus
;
33 } SMM_FTW_COMMUNICATE_FUNCTION_HEADER
;
36 /// Size of SMM communicate header, without including the payload.
38 #define SMM_COMMUNICATE_HEADER_SIZE (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))
41 /// Size of SMM FTW communicate function header, without including the payload.
43 #define SMM_FTW_COMMUNICATE_HEADER_SIZE (OFFSET_OF (SMM_FTW_COMMUNICATE_FUNCTION_HEADER, Data))
47 } SMM_FTW_GET_MAX_BLOCK_SIZE_HEADER
;
51 UINTN PrivateDataSize
;
53 } SMM_FTW_ALLOCATE_HEADER
;
58 UINTN PrivateDataSize
;
59 EFI_PHYSICAL_ADDRESS FvbBaseAddress
;
60 EFI_FVB_ATTRIBUTES_2 FvbAttributes
;
63 } SMM_FTW_WRITE_HEADER
;
66 EFI_PHYSICAL_ADDRESS FvbBaseAddress
;
67 EFI_FVB_ATTRIBUTES_2 FvbAttributes
;
68 } SMM_FTW_RESTART_HEADER
;
75 UINTN PrivateDataSize
;
78 } SMM_FTW_GET_LAST_WRITE_HEADER
;
81 Shared entry point of the module
83 @retval EFI_SUCCESS The initialization finished successfully.
84 @retval EFI_OUT_OF_RESOURCES Allocate memory error
85 @retval EFI_INVALID_PARAMETER Workspace or Spare block does not exist
89 MmFaultTolerantWriteInitialize (
94 This function checks if the buffer is valid per processor architecture and
95 does not overlap with SMRAM.
97 @param Buffer The buffer start address to be checked.
98 @param Length The buffer length to be checked.
100 @retval TRUE This buffer is valid per processor architecture and does not
102 @retval FALSE This buffer is not valid per processor architecture or overlaps
106 FtwSmmIsBufferOutsideSmmValid (
107 IN EFI_PHYSICAL_ADDRESS Buffer
,
112 Notify the system that the SMM FTW driver is ready