3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 FaultTolerantWriteLite.h
18 This is a simple fault tolerant write driver, based on PlatformFd library.
19 And it only supports write BufferSize <= SpareAreaLength.
23 #ifndef _FW_FAULT_TOLERANT_WRITE_LITE_PROTOCOL_H_
24 #define _FW_FAULT_TOLERANT_WRITE_LITE_PROTOCOL_H_
26 #define EFI_FTW_LITE_PROTOCOL_GUID \
27 { 0x3f557189, 0x8dae, 0x45ae, {0xa0, 0xb3, 0x2b, 0x99, 0xca, 0x7a, 0xa7, 0xa0 } }
30 // Forward reference for pure ANSI compatability
32 typedef struct _EFI_FTW_LITE_PROTOCOL EFI_FTW_LITE_PROTOCOL
;
35 // Protocol API definitions
40 (EFIAPI
* EFI_FTW_LITE_WRITE
) (
41 IN EFI_FTW_LITE_PROTOCOL
*This
,
42 IN EFI_HANDLE FvbHandle
,
52 Starts a target block update. This records information about the write
53 in fault tolerant storage and will complete the write in a recoverable
54 manner, ensuring at all times that either the original contents or
55 the modified contents are available.
59 This - Calling context
60 FvBlockHandle - The handle of FVB protocol that provides services for
61 reading, writing, and erasing the target block.
62 Lba - The logical block address of the target block.
63 Offset - The offset within the target block to place the data.
64 Length - The number of bytes to write to the target block.
65 Buffer - The data to write.
69 EFI_SUCCESS - The function completed successfully
70 EFI_ABORTED - The function could not complete successfully.
71 EFI_BAD_BUFFER_SIZE - The write would span a block boundary,
72 which is not a valid action.
73 EFI_ACCESS_DENIED - No writes have been allocated.
74 EFI_NOT_READY - The last write has not been completed.
75 Restart () must be called to complete it.
80 // Protocol declaration
82 struct _EFI_FTW_LITE_PROTOCOL
{
83 EFI_FTW_LITE_WRITE Write
;
86 extern EFI_GUID gEfiFaultTolerantWriteLiteProtocolGuid
;