VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h@ 108794

Last change on this file since 108794 was 108794, checked in by vboxsync, 3 weeks ago

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1/** @file
2
3 The common header file for SMM FTW module and SMM FTW DXE Module.
4
5Copyright (c) 2011 - 2024, Intel Corporation. All rights reserved. <BR>
6SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#ifndef __SMM_FTW_COMMON_H__
11#define __SMM_FTW_COMMON_H__
12
13#include <Protocol/SmmFirmwareVolumeBlock.h>
14#include <Protocol/SmmFaultTolerantWrite.h>
15
16#define FTW_FUNCTION_GET_MAX_BLOCK_SIZE 1
17#define FTW_FUNCTION_ALLOCATE 2
18#define FTW_FUNCTION_WRITE 3
19#define FTW_FUNCTION_RESTART 4
20#define FTW_FUNCTION_ABORT 5
21#define FTW_FUNCTION_GET_LAST_WRITE 6
22
23typedef struct {
24 UINTN Function;
25 EFI_STATUS ReturnStatus;
26 UINT8 Data[1];
27} SMM_FTW_COMMUNICATE_FUNCTION_HEADER;
28
29///
30/// Size of SMM communicate header, without including the payload.
31///
32#define SMM_COMMUNICATE_HEADER_SIZE (OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data))
33
34///
35/// Size of SMM FTW communicate function header, without including the payload.
36///
37#define SMM_FTW_COMMUNICATE_HEADER_SIZE (OFFSET_OF (SMM_FTW_COMMUNICATE_FUNCTION_HEADER, Data))
38
39typedef struct {
40 UINTN BlockSize;
41} SMM_FTW_GET_MAX_BLOCK_SIZE_HEADER;
42
43typedef struct {
44 EFI_GUID CallerId;
45 UINTN PrivateDataSize;
46 UINTN NumberOfWrites;
47} SMM_FTW_ALLOCATE_HEADER;
48
49typedef struct {
50 EFI_LBA Lba;
51 UINTN Offset;
52 UINTN PrivateDataSize;
53 EFI_PHYSICAL_ADDRESS FvbBaseAddress;
54 EFI_FVB_ATTRIBUTES_2 FvbAttributes;
55 UINTN Length;
56 UINT8 Data[1];
57} SMM_FTW_WRITE_HEADER;
58
59typedef struct {
60 EFI_PHYSICAL_ADDRESS FvbBaseAddress;
61 EFI_FVB_ATTRIBUTES_2 FvbAttributes;
62} SMM_FTW_RESTART_HEADER;
63
64typedef struct {
65 EFI_GUID CallerId;
66 EFI_LBA Lba;
67 UINTN Offset;
68 UINTN Length;
69 UINTN PrivateDataSize;
70 BOOLEAN Complete;
71 UINT8 Data[1];
72} SMM_FTW_GET_LAST_WRITE_HEADER;
73
74/**
75 Shared entry point of the module.
76
77 @retval EFI_SUCCESS The initialization finished successfully.
78 @retval EFI_OUT_OF_RESOURCES Allocate memory error
79 @retval EFI_INVALID_PARAMETER Workspace or Spare block does not exist
80
81**/
82EFI_STATUS
83MmFaultTolerantWriteInitialize (
84 VOID
85 );
86
87/**
88 This function checks if the Primary Buffer is valid.
89
90 @param Buffer The buffer start address to be checked.
91 @param Length The buffer length to be checked.
92
93 @retval TRUE This buffer is valid.
94 @retval FALSE This buffer is not valid.
95**/
96BOOLEAN
97FtwSmmIsPrimaryBufferValid (
98 IN EFI_PHYSICAL_ADDRESS Buffer,
99 IN UINT64 Length
100 );
101
102/**
103 Notify the system that the SMM FTW driver is ready.
104**/
105VOID
106FtwNotifySmmReady (
107 VOID
108 );
109
110#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette