]>
Commit | Line | Data |
---|---|---|
6cc9ca32 | 1 | /** @file\r |
d7dec593 | 2 | \r |
6cc9ca32 LG |
3 | The internal header file includes the common header files, defines\r |
4 | internal structure and functions used by FtwLite module.\r | |
5 | \r | |
6 | Copyright (c) 2006 - 2008, Intel Corporation \r | |
d7dec593 | 7 | All rights reserved. This program and the accompanying materials \r |
8 | are licensed and made available under the terms and conditions of the BSD License \r | |
9 | which accompanies this distribution. The full text of the license may be found at \r | |
10 | http://opensource.org/licenses/bsd-license.php \r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
14 | \r | |
6cc9ca32 | 15 | **/\r |
d7dec593 | 16 | \r |
17 | #ifndef _EFI_FAULT_TOLERANT_WRITE_LITE_H_\r | |
18 | #define _EFI_FAULT_TOLERANT_WRITE_LITE_H_\r | |
19 | \r | |
ed7748fe | 20 | \r |
d7dec593 | 21 | #include <PiDxe.h>\r |
ed7748fe | 22 | \r |
d7dec593 | 23 | #include <Guid/SystemNvDataGuid.h>\r |
24 | #include <Protocol/FaultTolerantWriteLite.h>\r | |
25 | #include <Protocol/FirmwareVolumeBlock.h>\r | |
ed7748fe | 26 | \r |
d7dec593 | 27 | #include <Library/PcdLib.h>\r |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/UefiDriverEntryPoint.h>\r | |
30 | #include <Library/BaseMemoryLib.h>\r | |
31 | #include <Library/MemoryAllocationLib.h>\r | |
32 | #include <Library/UefiBootServicesTableLib.h>\r | |
1232b214 | 33 | #include <Library/DevicePathLib.h>\r |
d7dec593 | 34 | \r |
3cfb790c | 35 | #include <WorkingBlockHeader.h>\r |
d7dec593 | 36 | \r |
d7dec593 | 37 | //\r |
38 | // Flash erase polarity is 1\r | |
39 | //\r | |
40 | #define FTW_ERASE_POLARITY 1\r | |
41 | \r | |
42 | #define FTW_VALID_STATE 0\r | |
43 | #define FTW_INVALID_STATE 1\r | |
44 | \r | |
45 | #define FTW_ERASED_BYTE ((UINT8) (255))\r | |
46 | #define FTW_POLARITY_REVERT ((UINT8) (255))\r | |
47 | \r | |
48 | typedef struct {\r | |
49 | UINT8 WriteAllocated : 1;\r | |
50 | UINT8 SpareCompleted : 1;\r | |
51 | UINT8 WriteCompleted : 1;\r | |
52 | UINT8 Reserved : 5;\r | |
53 | #define WRITE_ALLOCATED 0x1\r | |
54 | #define SPARE_COMPLETED 0x2\r | |
55 | #define WRITE_COMPLETED 0x4\r | |
56 | \r | |
57 | EFI_DEV_PATH DevPath;\r | |
58 | EFI_LBA Lba;\r | |
59 | UINTN Offset;\r | |
60 | UINTN NumBytes;\r | |
61 | //\r | |
62 | // UINTN SpareAreaOffset;\r | |
63 | //\r | |
64 | } EFI_FTW_LITE_RECORD;\r | |
65 | \r | |
f3f2e05d | 66 | #define FTW_LITE_DEVICE_SIGNATURE SIGNATURE_32 ('F', 'T', 'W', 'L')\r |
d7dec593 | 67 | \r |
d7dec593 | 68 | //\r |
69 | // MACRO for FTW header and record\r | |
70 | //\r | |
d7dec593 | 71 | #define FTW_LITE_RECORD_SIZE (sizeof (EFI_FTW_LITE_RECORD))\r |
d7dec593 | 72 | \r |
73 | //\r | |
74 | // EFI Fault tolerant protocol private data structure\r | |
75 | //\r | |
76 | typedef struct {\r | |
77 | UINTN Signature;\r | |
78 | EFI_HANDLE Handle;\r | |
79 | EFI_FTW_LITE_PROTOCOL FtwLiteInstance;\r | |
276a49b6 LG |
80 | EFI_PHYSICAL_ADDRESS WorkSpaceAddress; // Base address of working space range in flash.\r |
81 | UINTN WorkSpaceLength; // Size of working space range in flash.\r | |
82 | EFI_PHYSICAL_ADDRESS SpareAreaAddress; // Base address of spare range in flash.\r | |
83 | UINTN SpareAreaLength; // Size of spare range in flash.\r | |
84 | UINTN NumberOfSpareBlock; // Number of the blocks in spare block.\r | |
85 | UINTN BlockSize; // Block size in bytes of the blocks in flash\r | |
86 | EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *FtwWorkSpaceHeader;// Pointer to Working Space Header in memory buffer\r | |
87 | EFI_FTW_LITE_RECORD *FtwLastRecord; // Pointer to last record in memory buffer\r | |
d7dec593 | 88 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FtwFvBlock; // FVB of working block\r |
89 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FtwBackupFvb; // FVB of spare block\r | |
276a49b6 LG |
90 | EFI_LBA FtwSpareLba; // Start LBA of spare block\r |
91 | EFI_LBA FtwWorkBlockLba; // Start LBA of working block that contains working space in its last block.\r | |
d7dec593 | 92 | EFI_LBA FtwWorkSpaceLba; // Start LBA of working space\r |
276a49b6 LG |
93 | UINTN FtwWorkSpaceBase; // Offset into the FtwWorkSpaceLba block.\r |
94 | UINTN FtwWorkSpaceSize; // Size of working space range that stores write record.\r | |
95 | UINT8 *FtwWorkSpace; // Point to Work Space in memory buffer \r | |
d7dec593 | 96 | //\r |
97 | // Following a buffer of FtwWorkSpace[FTW_WORK_SPACE_SIZE],\r | |
98 | // Allocated with EFI_FTW_LITE_DEVICE.\r | |
99 | //\r | |
100 | } EFI_FTW_LITE_DEVICE;\r | |
101 | \r | |
102 | #define FTW_LITE_CONTEXT_FROM_THIS(a) CR (a, EFI_FTW_LITE_DEVICE, FtwLiteInstance, FTW_LITE_DEVICE_SIGNATURE)\r | |
103 | \r | |
104 | //\r | |
105 | // Driver entry point\r | |
106 | //\r | |
6aab8214 | 107 | /**\r |
108 | This function is the entry point of the Fault Tolerant Write driver.\r | |
109 | \r | |
110 | \r | |
5944a83b | 111 | @param ImageHandle A handle for the image that is initializing\r |
6aab8214 | 112 | this driver\r |
5944a83b | 113 | @param SystemTable A pointer to the EFI system table\r |
6aab8214 | 114 | \r |
115 | @retval EFI_SUCCESS FTW has finished the initialization\r | |
116 | @retval EFI_ABORTED FTW initialization error\r | |
117 | \r | |
118 | **/\r | |
d7dec593 | 119 | EFI_STATUS\r |
120 | EFIAPI\r | |
121 | InitializeFtwLite (\r | |
122 | IN EFI_HANDLE ImageHandle,\r | |
123 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
ed66e1bc | 124 | );\r |
d7dec593 | 125 | \r |
126 | //\r | |
127 | // Fault Tolerant Write Protocol API\r | |
128 | //\r | |
6aab8214 | 129 | /**\r |
130 | Starts a target block update. This function will record data about write\r | |
131 | in fault tolerant storage and will complete the write in a recoverable\r | |
132 | manner, ensuring at all times that either the original contents or\r | |
133 | the modified contents are available.\r | |
134 | \r | |
135 | \r | |
136 | @param This Calling context\r | |
137 | @param FvbHandle The handle of FVB protocol that provides services for\r | |
138 | reading, writing, and erasing the target block.\r | |
139 | @param Lba The logical block address of the target block.\r | |
140 | @param Offset The offset within the target block to place the data.\r | |
141 | @param NumBytes The number of bytes to write to the target block.\r | |
142 | @param Buffer The data to write.\r | |
143 | \r | |
144 | @retval EFI_SUCCESS The function completed successfully\r | |
145 | @retval EFI_BAD_BUFFER_SIZE The write would span a target block, which is not\r | |
146 | a valid action.\r | |
147 | @retval EFI_ACCESS_DENIED No writes have been allocated.\r | |
148 | @retval EFI_NOT_FOUND Cannot find FVB by handle.\r | |
149 | @retval EFI_OUT_OF_RESOURCES Cannot allocate memory.\r | |
150 | @retval EFI_ABORTED The function could not complete successfully.\r | |
151 | \r | |
152 | **/\r | |
d7dec593 | 153 | EFI_STATUS\r |
154 | EFIAPI\r | |
155 | FtwLiteWrite (\r | |
6aab8214 | 156 | IN EFI_FTW_LITE_PROTOCOL *This,\r |
157 | IN EFI_HANDLE FvbHandle,\r | |
158 | IN EFI_LBA Lba,\r | |
159 | IN UINTN Offset,\r | |
160 | IN OUT UINTN *NumBytes,\r | |
161 | IN VOID *Buffer\r | |
ed66e1bc | 162 | );\r |
d7dec593 | 163 | \r |
164 | //\r | |
165 | // Internal functions\r | |
166 | //\r | |
6aab8214 | 167 | /**\r |
168 | Restarts a previously interrupted write. The caller must provide the\r | |
169 | block protocol needed to complete the interrupted write.\r | |
170 | \r | |
171 | \r | |
172 | @param FtwLiteDevice The private data of FTW_LITE driver\r | |
173 | FvbHandle - The handle of FVB protocol that provides services for\r | |
174 | reading, writing, and erasing the target block.\r | |
175 | \r | |
176 | @retval EFI_SUCCESS The function completed successfully\r | |
177 | @retval EFI_ACCESS_DENIED No pending writes exist\r | |
178 | @retval EFI_NOT_FOUND FVB protocol not found by the handle\r | |
179 | @retval EFI_ABORTED The function could not complete successfully\r | |
180 | \r | |
181 | **/\r | |
d7dec593 | 182 | EFI_STATUS\r |
183 | FtwRestart (\r | |
184 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r | |
ed66e1bc | 185 | );\r |
d7dec593 | 186 | \r |
6aab8214 | 187 | /**\r |
188 | Aborts all previous allocated writes.\r | |
d7dec593 | 189 | \r |
d7dec593 | 190 | \r |
6aab8214 | 191 | @param FtwLiteDevice The private data of FTW_LITE driver\r |
d7dec593 | 192 | \r |
6aab8214 | 193 | @retval EFI_SUCCESS The function completed successfully\r |
194 | @retval EFI_ABORTED The function could not complete successfully.\r | |
195 | @retval EFI_NOT_FOUND No allocated writes exist.\r | |
d7dec593 | 196 | \r |
6aab8214 | 197 | **/\r |
d7dec593 | 198 | EFI_STATUS\r |
199 | FtwAbort (\r | |
200 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r | |
ed66e1bc | 201 | );\r |
d7dec593 | 202 | \r |
d7dec593 | 203 | \r |
6aab8214 | 204 | /**\r |
205 | Write a record with fault tolerant mannaer.\r | |
206 | Since the content has already backuped in spare block, the write is\r | |
207 | guaranteed to be completed with fault tolerant manner.\r | |
d7dec593 | 208 | \r |
d7dec593 | 209 | \r |
6aab8214 | 210 | @param FtwLiteDevice The private data of FTW_LITE driver\r |
211 | @param Fvb The FVB protocol that provides services for\r | |
212 | reading, writing, and erasing the target block.\r | |
d7dec593 | 213 | \r |
6aab8214 | 214 | @retval EFI_SUCCESS The function completed successfully\r |
215 | @retval EFI_ABORTED The function could not complete successfully\r | |
d7dec593 | 216 | \r |
6aab8214 | 217 | **/\r |
d7dec593 | 218 | EFI_STATUS\r |
219 | FtwWriteRecord (\r | |
220 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r | |
221 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb\r | |
ed66e1bc | 222 | );\r |
d7dec593 | 223 | \r |
6aab8214 | 224 | /**\r |
8986b8cd | 225 | To erase the block with the spare block size.\r |
d7dec593 | 226 | \r |
d7dec593 | 227 | \r |
6aab8214 | 228 | @param FtwLiteDevice Calling context\r |
229 | @param FvBlock FVB Protocol interface\r | |
230 | @param Lba Lba of the firmware block\r | |
d7dec593 | 231 | \r |
6aab8214 | 232 | @retval EFI_SUCCESS Block LBA is Erased successfully\r |
233 | @retval Others Error occurs\r | |
d7dec593 | 234 | \r |
6aab8214 | 235 | **/\r |
d7dec593 | 236 | EFI_STATUS\r |
237 | FtwEraseBlock (\r | |
238 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r | |
239 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r | |
240 | EFI_LBA Lba\r | |
ed66e1bc | 241 | );\r |
d7dec593 | 242 | \r |
6aab8214 | 243 | /**\r |
d7dec593 | 244 | \r |
6aab8214 | 245 | Erase spare block.\r |
d7dec593 | 246 | \r |
d7dec593 | 247 | \r |
6aab8214 | 248 | @param FtwLiteDevice Calling context\r |
d7dec593 | 249 | \r |
6aab8214 | 250 | @retval EFI_SUCCESS The erase request was successfully\r |
251 | completed.\r | |
252 | \r | |
253 | @retval EFI_ACCESS_DENIED The firmware volume is in the\r | |
254 | WriteDisabled state.\r | |
255 | @retval EFI_DEVICE_ERROR The block device is not functioning\r | |
256 | correctly and could not be written.\r | |
257 | The firmware device may have been\r | |
258 | partially erased.\r | |
259 | @retval EFI_INVALID_PARAMETER One or more of the LBAs listed\r | |
260 | in the variable argument list do\r | |
261 | not exist in the firmware volume. \r | |
262 | \r | |
263 | **/\r | |
d7dec593 | 264 | EFI_STATUS\r |
265 | FtwEraseSpareBlock (\r | |
266 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r | |
ed66e1bc | 267 | );\r |
d7dec593 | 268 | \r |
6aab8214 | 269 | /**\r |
270 | Retrive the proper FVB protocol interface by HANDLE.\r | |
d7dec593 | 271 | \r |
d7dec593 | 272 | \r |
6aab8214 | 273 | @param FvBlockHandle The handle of FVB protocol that provides services for\r |
274 | reading, writing, and erasing the target block.\r | |
275 | @param FvBlock The interface of FVB protocol\r | |
d7dec593 | 276 | \r |
6aab8214 | 277 | @retval EFI_SUCCESS The function completed successfully\r |
278 | @retval EFI_ABORTED The function could not complete successfully\r | |
d7dec593 | 279 | \r |
6aab8214 | 280 | **/\r |
d7dec593 | 281 | EFI_STATUS\r |
282 | FtwGetFvbByHandle (\r | |
283 | IN EFI_HANDLE FvBlockHandle,\r | |
284 | OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r | |
ed66e1bc | 285 | );\r |
d7dec593 | 286 | \r |
6aab8214 | 287 | /**\r |
d7dec593 | 288 | \r |
6aab8214 | 289 | Get firmware block by address.\r |
d7dec593 | 290 | \r |
d7dec593 | 291 | \r |
6aab8214 | 292 | @param Address Address specified the block\r |
293 | @param FvBlock The block caller wanted\r | |
294 | \r | |
295 | @retval EFI_SUCCESS The protocol instance if found.\r | |
296 | @retval EFI_NOT_FOUND Block not found\r | |
297 | \r | |
298 | **/\r | |
d7dec593 | 299 | EFI_STATUS\r |
300 | GetFvbByAddress (\r | |
301 | IN EFI_PHYSICAL_ADDRESS Address,\r | |
302 | OUT EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL **FvBlock\r | |
ed66e1bc | 303 | );\r |
d7dec593 | 304 | \r |
6aab8214 | 305 | /**\r |
d7dec593 | 306 | \r |
6aab8214 | 307 | Is it in working block?\r |
d7dec593 | 308 | \r |
d7dec593 | 309 | \r |
6aab8214 | 310 | @param FtwLiteDevice Calling context\r |
311 | @param FvBlock Fvb protocol instance\r | |
312 | @param Lba The block specified\r | |
d7dec593 | 313 | \r |
6aab8214 | 314 | @return A BOOLEAN value indicating in working block or not.\r |
d7dec593 | 315 | \r |
6aab8214 | 316 | **/\r |
d7dec593 | 317 | BOOLEAN\r |
318 | IsInWorkingBlock (\r | |
319 | EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r | |
320 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r | |
321 | EFI_LBA Lba\r | |
ed66e1bc | 322 | );\r |
d7dec593 | 323 | \r |
6aab8214 | 324 | /**\r |
325 | Copy the content of spare block to a target block. Size is FTW_BLOCK_SIZE.\r | |
326 | Spare block is accessed by FTW backup FVB protocol interface. LBA is\r | |
327 | FtwLiteDevice->FtwSpareLba.\r | |
328 | Target block is accessed by FvBlock protocol interface. LBA is Lba.\r | |
d7dec593 | 329 | \r |
d7dec593 | 330 | \r |
6aab8214 | 331 | @param FtwLiteDevice The private data of FTW_LITE driver\r |
332 | @param FvBlock FVB Protocol interface to access target block\r | |
333 | @param Lba Lba of the target block\r | |
d7dec593 | 334 | \r |
6aab8214 | 335 | @retval EFI_SUCCESS Spare block content is copied to target block\r |
336 | @retval EFI_INVALID_PARAMETER Input parameter error\r | |
337 | @retval EFI_OUT_OF_RESOURCES Allocate memory error\r | |
338 | @retval EFI_ABORTED The function could not complete successfully\r | |
d7dec593 | 339 | \r |
6aab8214 | 340 | **/\r |
d7dec593 | 341 | EFI_STATUS\r |
342 | FlushSpareBlockToTargetBlock (\r | |
343 | EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r | |
344 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r | |
345 | EFI_LBA Lba\r | |
ed66e1bc | 346 | );\r |
d7dec593 | 347 | \r |
6aab8214 | 348 | /**\r |
349 | Copy the content of spare block to working block. Size is FTW_BLOCK_SIZE.\r | |
350 | Spare block is accessed by FTW backup FVB protocol interface. LBA is\r | |
351 | FtwLiteDevice->FtwSpareLba.\r | |
352 | Working block is accessed by FTW working FVB protocol interface. LBA is\r | |
353 | FtwLiteDevice->FtwWorkBlockLba.\r | |
354 | \r | |
355 | \r | |
356 | @param FtwLiteDevice The private data of FTW_LITE driver\r | |
357 | \r | |
358 | @retval EFI_SUCCESS Spare block content is copied to target block\r | |
359 | @retval EFI_OUT_OF_RESOURCES Allocate memory error\r | |
360 | @retval EFI_ABORTED The function could not complete successfully\r | |
361 | Notes:\r | |
362 | Since the working block header is important when FTW initializes, the\r | |
363 | state of the operation should be handled carefully. The Crc value is\r | |
364 | calculated without STATE element.\r | |
365 | \r | |
366 | **/\r | |
d7dec593 | 367 | EFI_STATUS\r |
368 | FlushSpareBlockToWorkingBlock (\r | |
369 | EFI_FTW_LITE_DEVICE *FtwLiteDevice\r | |
ed66e1bc | 370 | );\r |
d7dec593 | 371 | \r |
6aab8214 | 372 | /**\r |
373 | Update a bit of state on a block device. The location of the bit is\r | |
374 | calculated by the (Lba, Offset, bit). Here bit is determined by the\r | |
375 | the name of a certain bit.\r | |
d7dec593 | 376 | \r |
d7dec593 | 377 | \r |
6aab8214 | 378 | @param FvBlock FVB Protocol interface to access SrcBlock and DestBlock\r |
379 | @param Lba Lba of a block\r | |
380 | @param Offset Offset on the Lba\r | |
381 | @param NewBit New value that will override the old value if it can be change\r | |
d7dec593 | 382 | \r |
6aab8214 | 383 | @retval EFI_SUCCESS A state bit has been updated successfully\r |
384 | @retval Others Access block device error.\r | |
385 | Notes:\r | |
386 | Assume all bits of State are inside the same BYTE.\r | |
387 | @retval EFI_ABORTED Read block fail\r | |
d7dec593 | 388 | \r |
6aab8214 | 389 | **/\r |
d7dec593 | 390 | EFI_STATUS\r |
391 | FtwUpdateFvState (\r | |
392 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r | |
393 | IN EFI_LBA Lba,\r | |
394 | IN UINTN Offset,\r | |
395 | IN UINT8 NewBit\r | |
ed66e1bc | 396 | );\r |
d7dec593 | 397 | \r |
6aab8214 | 398 | /**\r |
399 | Get the last Write record pointer.\r | |
400 | The last record is the record whose 'complete' state hasn't been set.\r | |
401 | After all, this header may be a EMPTY header entry for next Allocate.\r | |
d7dec593 | 402 | \r |
d7dec593 | 403 | \r |
6aab8214 | 404 | @param FtwLiteDevice Private data of this driver\r |
405 | @param FtwLastRecord Pointer to retrieve the last write record\r | |
d7dec593 | 406 | \r |
6aab8214 | 407 | @retval EFI_SUCCESS Get the last write record successfully\r |
408 | @retval EFI_ABORTED The FTW work space is damaged\r | |
d7dec593 | 409 | \r |
6aab8214 | 410 | **/\r |
d7dec593 | 411 | EFI_STATUS\r |
412 | FtwGetLastRecord (\r | |
413 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r | |
414 | OUT EFI_FTW_LITE_RECORD **FtwLastRecord\r | |
ed66e1bc | 415 | );\r |
d7dec593 | 416 | \r |
6aab8214 | 417 | /**\r |
d7dec593 | 418 | \r |
6aab8214 | 419 | Check whether a flash buffer is erased.\r |
d7dec593 | 420 | \r |
d7dec593 | 421 | \r |
6aab8214 | 422 | @param Polarity All 1 or all 0\r |
423 | @param Buffer Buffer to check\r | |
424 | @param BufferSize Size of the buffer\r | |
d7dec593 | 425 | \r |
6aab8214 | 426 | @return A BOOLEAN value indicating erased or not.\r |
427 | \r | |
428 | **/\r | |
d7dec593 | 429 | BOOLEAN\r |
430 | IsErasedFlashBuffer (\r | |
431 | IN BOOLEAN Polarity,\r | |
432 | IN UINT8 *Buffer,\r | |
433 | IN UINTN BufferSize\r | |
ed66e1bc | 434 | );\r |
d7dec593 | 435 | \r |
6aab8214 | 436 | /**\r |
437 | Initialize a work space when there is no work space.\r | |
d7dec593 | 438 | \r |
d7dec593 | 439 | \r |
6aab8214 | 440 | @param WorkingHeader Pointer of working block header\r |
d7dec593 | 441 | \r |
6aab8214 | 442 | @retval EFI_SUCCESS The function completed successfully\r |
443 | @retval EFI_ABORTED The function could not complete successfully.\r | |
d7dec593 | 444 | \r |
6aab8214 | 445 | **/\r |
d7dec593 | 446 | EFI_STATUS\r |
447 | InitWorkSpaceHeader (\r | |
448 | IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r | |
ed66e1bc | 449 | );\r |
d7dec593 | 450 | \r |
6aab8214 | 451 | /**\r |
452 | Read from working block to refresh the work space in memory.\r | |
d7dec593 | 453 | \r |
d7dec593 | 454 | \r |
6aab8214 | 455 | @param FtwLiteDevice Point to private data of FTW driver\r |
d7dec593 | 456 | \r |
6aab8214 | 457 | @retval EFI_SUCCESS The function completed successfully\r |
458 | @retval EFI_ABORTED The function could not complete successfully.\r | |
d7dec593 | 459 | \r |
6aab8214 | 460 | **/\r |
d7dec593 | 461 | EFI_STATUS\r |
462 | WorkSpaceRefresh (\r | |
463 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice\r | |
ed66e1bc | 464 | );\r |
d7dec593 | 465 | \r |
6aab8214 | 466 | /**\r |
467 | Check to see if it is a valid work space.\r | |
d7dec593 | 468 | \r |
d7dec593 | 469 | \r |
6aab8214 | 470 | @param WorkingHeader Pointer of working block header\r |
d7dec593 | 471 | \r |
6aab8214 | 472 | @retval EFI_SUCCESS The function completed successfully\r |
473 | @retval EFI_ABORTED The function could not complete successfully.\r | |
d7dec593 | 474 | \r |
6aab8214 | 475 | **/\r |
d7dec593 | 476 | BOOLEAN\r |
477 | IsValidWorkSpace (\r | |
478 | IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r | |
ed66e1bc | 479 | );\r |
d7dec593 | 480 | \r |
6aab8214 | 481 | /**\r |
482 | Reclaim the work space on the working block.\r | |
d7dec593 | 483 | \r |
d7dec593 | 484 | \r |
6aab8214 | 485 | @param FtwLiteDevice Point to private data of FTW driver\r |
e11ae3a5 | 486 | @param PreserveRecord Whether to preserve the working record is needed\r |
d7dec593 | 487 | \r |
6aab8214 | 488 | @retval EFI_SUCCESS The function completed successfully\r |
489 | @retval EFI_OUT_OF_RESOURCES Allocate memory error\r | |
490 | @retval EFI_ABORTED The function could not complete successfully\r | |
d7dec593 | 491 | \r |
6aab8214 | 492 | **/\r |
d7dec593 | 493 | EFI_STATUS\r |
494 | FtwReclaimWorkSpace (\r | |
e11ae3a5 LG |
495 | IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r |
496 | IN BOOLEAN PreserveRecord\r | |
ed66e1bc | 497 | );\r |
d7dec593 | 498 | \r |
499 | #endif\r |