3
The internal header file includes the common header files, defines
4
internal structure and functions used by FTW module.
6
Copyright (c) 2011, Intel Corporation. All rights reserved. <BR>
7
This program and the accompanying materials
8
are licensed and made available under the terms and conditions of the BSD License
9
which accompanies this distribution. The full text of the license may be found at
10
http://opensource.org/licenses/bsd-license.php
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.
17
#ifndef __SMM_FTW_DXE_H__
18
#define __SMM_FTW_DXE_H__
22
#include <Protocol/SmmCommunication.h>
24
#include <Library/UefiBootServicesTableLib.h>
25
#include <Library/UefiDriverEntryPoint.h>
26
#include <Library/DebugLib.h>
27
#include <Library/BaseMemoryLib.h>
28
#include <Library/UefiLib.h>
29
#include <Library/BaseLib.h>
30
#include <Library/MemoryAllocationLib.h>
32
#include <Guid/EventGroup.h>
34
#include "FaultTolerantWriteSmmCommon.h"
37
Get the size of the largest block that can be updated in a fault-tolerant manner.
39
@param[in] This Indicates a pointer to the calling context.
40
@param[out] BlockSize A pointer to a caller-allocated UINTN that is
41
updated to indicate the size of the largest block
44
@retval EFI_SUCCESS The function completed successfully.
45
@retval EFI_ABORTED The function could not complete successfully.
51
IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL *This,
57
Allocates space for the protocol to maintain information about writes.
58
Since writes must be completed in a fault-tolerant manner and multiple
59
writes require more resources to be successful, this function
60
enables the protocol to ensure that enough space exists to track
61
information about upcoming writes.
63
@param[in] This A pointer to the calling context.
64
@param[in] CallerId The GUID identifying the write.
65
@param[in] PrivateDataSize The size of the caller's private data that must be
66
recorded for each write.
67
@param[in] NumberOfWrites The number of fault tolerant block writes that will
70
@retval EFI_SUCCESS The function completed successfully
71
@retval EFI_ABORTED The function could not complete successfully.
72
@retval EFI_ACCESS_DENIED Not all allocated writes have been completed. All
73
writes must be completed or aborted before another
74
fault tolerant write can occur.
80
IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL *This,
81
IN EFI_GUID *CallerId,
82
IN UINTN PrivateDataSize,
83
IN UINTN NumberOfWrites
88
Starts a target block update. This records information about the write
89
in fault tolerant storage, and will complete the write in a recoverable
90
manner, ensuring at all times that either the original contents or
91
the modified contents are available.
93
@param[in] This The calling context.
94
@param[in] Lba The logical block address of the target block.
95
@param[in] Offset The offset within the target block to place the
97
@param[in] Length The number of bytes to write to the target block.
98
@param[in] PrivateData A pointer to private data that the caller requires
99
to complete any pending writes in the event of a
101
@param[in] FvBlockHandle The handle of FVB protocol that provides services
102
for reading, writing, and erasing the target block.
103
@param[in] Buffer The data to write.
105
@retval EFI_SUCCESS The function completed successfully.
106
@retval EFI_ABORTED The function could not complete successfully.
107
@retval EFI_BAD_BUFFER_SIZE The write would span a block boundary, which is not
109
@retval EFI_ACCESS_DENIED No writes have been allocated.
110
@retval EFI_NOT_READY The last write has not been completed. Restart()
111
must be called to complete it.
117
IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL *This,
121
IN VOID *PrivateData,
122
IN EFI_HANDLE FvBlockHandle,
128
Restarts a previously interrupted write. The caller must provide the
129
block protocol needed to complete the interrupted write.
131
@param[in] This The calling context.
132
@param[in] FvBlockHandle The handle of FVB protocol that provides services.
134
@retval EFI_SUCCESS The function completed successfully.
135
@retval EFI_ABORTED The function could not complete successfully.
136
@retval EFI_ACCESS_DENIED No pending writes exist.
142
IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL *This,
143
IN EFI_HANDLE FvBlockHandle
148
Aborts all previously allocated writes.
150
@param This The calling context.
152
@retval EFI_SUCCESS The function completed successfully.
153
@retval EFI_ABORTED The function could not complete successfully.
154
@retval EFI_NOT_FOUND No allocated writes exist.
160
IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL *This
165
Starts a target block update. This function records information about the write
166
in fault-tolerant storage and completes the write in a recoverable
167
manner, ensuring at all times that either the original contents or
168
the modified contents are available.
170
@param[in] This Indicates a pointer to the calling context.
171
@param[out] CallerId The GUID identifying the last write.
172
@param[out] Lba The logical block address of the last write.
173
@param[out] Offset The offset within the block of the last write.
174
@param[out] Length The length of the last write.
175
@param[in, out] PrivateDataSize On input, the size of the PrivateData buffer. On
176
output, the size of the private data stored for
178
@param[out] PrivateData A pointer to a buffer. The function will copy
179
PrivateDataSize bytes from the private data stored
181
@param[out] Complete A Boolean value with TRUE indicating that the write
184
@retval EFI_SUCCESS The function completed successfully.
185
@retval EFI_ABORTED The function could not complete successfully.
186
@retval EFI_NOT_FOUND No allocated writes exist.
192
IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL *This,
193
OUT EFI_GUID *CallerId,
197
IN OUT UINTN *PrivateDataSize,
198
OUT VOID *PrivateData,
199
OUT BOOLEAN *Complete