878ddf1f |
1 | /*++\r |
2 | \r |
3 | Copyright (c) 2006, Intel Corporation \r |
4 | All rights reserved. This program and the accompanying materials \r |
5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r |
7 | http://opensource.org/licenses/bsd-license.php \r |
8 | \r |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r |
11 | \r |
12 | Module Name:\r |
13 | \r |
14 | FaultTolerantWriteLite.h\r |
15 | \r |
16 | Abstract:\r |
17 | \r |
18 | This is a simple fault tolerant write driver, based on PlatformFd library.\r |
19 | And it only supports write BufferSize <= SpareAreaLength.\r |
20 | \r |
21 | --*/\r |
22 | \r |
23 | #ifndef _FW_FAULT_TOLERANT_WRITE_LITE_PROTOCOL_H_\r |
24 | #define _FW_FAULT_TOLERANT_WRITE_LITE_PROTOCOL_H_\r |
25 | \r |
26 | #define EFI_FTW_LITE_PROTOCOL_GUID \\r |
27 | { 0x3f557189, 0x8dae, 0x45ae, {0xa0, 0xb3, 0x2b, 0x99, 0xca, 0x7a, 0xa7, 0xa0 } }\r |
28 | \r |
29 | //\r |
30 | // Forward reference for pure ANSI compatability\r |
31 | //\r |
32 | typedef struct _EFI_FTW_LITE_PROTOCOL EFI_FTW_LITE_PROTOCOL;\r |
33 | \r |
34 | //\r |
35 | // Protocol API definitions\r |
36 | //\r |
37 | \r |
38 | typedef\r |
39 | EFI_STATUS\r |
40 | (EFIAPI * EFI_FTW_LITE_WRITE) (\r |
41 | IN EFI_FTW_LITE_PROTOCOL *This,\r |
42 | IN EFI_HANDLE FvbHandle,\r |
43 | IN EFI_LBA Lba,\r |
44 | IN UINTN Offset,\r |
45 | IN UINTN *NumBytes,\r |
46 | IN VOID *Buffer\r |
47 | );\r |
48 | /*++\r |
49 | \r |
50 | Routine Description:\r |
51 | \r |
52 | Starts a target block update. This records information about the write \r |
53 | in fault tolerant storage and will complete the write in a recoverable \r |
54 | manner, ensuring at all times that either the original contents or \r |
55 | the modified contents are available.\r |
56 | \r |
57 | Arguments:\r |
58 | \r |
59 | This - Calling context\r |
60 | FvBlockHandle - The handle of FVB protocol that provides services for \r |
61 | reading, writing, and erasing the target block.\r |
62 | Lba - The logical block address of the target block. \r |
63 | Offset - The offset within the target block to place the data.\r |
64 | Length - The number of bytes to write to the target block.\r |
65 | Buffer - The data to write.\r |
66 | \r |
67 | Returns:\r |
68 | \r |
69 | EFI_SUCCESS - The function completed successfully\r |
70 | EFI_ABORTED - The function could not complete successfully.\r |
71 | EFI_BAD_BUFFER_SIZE - The write would span a block boundary, \r |
72 | which is not a valid action.\r |
73 | EFI_ACCESS_DENIED - No writes have been allocated.\r |
74 | EFI_NOT_READY - The last write has not been completed. \r |
75 | Restart () must be called to complete it.\r |
76 | \r |
77 | --*/\r |
78 | \r |
79 | //\r |
80 | // Protocol declaration\r |
81 | //\r |
82 | struct _EFI_FTW_LITE_PROTOCOL {\r |
83 | EFI_FTW_LITE_WRITE Write;\r |
84 | };\r |
85 | \r |
86 | extern EFI_GUID gEfiFaultTolerantWriteLiteProtocolGuid;\r |
87 | \r |
88 | #endif\r |