3 X64 platform related code to support FtwLite.
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 // MACROs for boot block update
22 #define BOOT_BLOCK_BASE
29 @param FtwLiteDevice Calling context
30 @param SwapState Swap state
32 @retval EFI_SUCCESS State successfully read.
37 IN EFI_FTW_LITE_DEVICE
*FtwLiteDevice
,
38 OUT BOOLEAN
*SwapState
48 @param FtwLiteDevice Indicates a pointer to the calling context.
49 @param TopSwap New swap state
51 @retval EFI_SUCCESS The function completed successfully
53 the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that
54 software will not be able to clear the Top-Swap bit until the system is
55 rebooted without GNT[A]# being pulled down.
60 IN EFI_FTW_LITE_DEVICE
*FtwLiteDevice
,
69 Check whether the block is a boot block.
72 @param FtwLiteDevice Calling context
73 @param FvBlock Fvb protocol instance
76 @retval FALSE This is a boot block.
77 @retval TRUE This is not a boot block.
82 EFI_FTW_LITE_DEVICE
*FtwLiteDevice
,
83 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*FvBlock
,
91 Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.
92 Spare block is accessed by FTW backup FVB protocol interface. LBA is
93 FtwLiteDevice->FtwSpareLba.
94 Boot block is accessed by BootFvb protocol interface. LBA is 0.
97 @param FtwLiteDevice The private data of FTW_LITE driver
99 @retval EFI_SUCCESS Spare block content is copied to boot block
100 @retval EFI_INVALID_PARAMETER Input parameter error
101 @retval EFI_OUT_OF_RESOURCES Allocate memory error
102 @retval EFI_ABORTED The function could not complete successfully
107 FlushSpareBlockToBootBlock (
108 EFI_FTW_LITE_DEVICE
*FtwLiteDevice