]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/Ipf/IpfFtwMisc.c
Use #include "XXX.h" for module internal header files.
[mirror_edk2.git] / MdeModulePkg / Universal / FirmwareVolume / FaultTolerantWriteDxe / Ipf / IpfFtwMisc.c
CommitLineData
6cc9ca32
LG
1/** @file\r
2\r
3 Ipf platform related code to support FtwLite..\r
d7dec593 4\r
6cc9ca32 5Copyright (c) 2006 - 2008, Intel Corporation \r
d7dec593 6All rights reserved. This program and the accompanying materials \r
7are licensed and made available under the terms and conditions of the BSD License \r
8which accompanies this distribution. The full text of the license may be found at \r
9http://opensource.org/licenses/bsd-license.php \r
10 \r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
6cc9ca32 14**/\r
d7dec593 15\r
16\r
e87a334f 17#include "FtwLite.h"\r
d7dec593 18\r
19//\r
20// MACROs for boot block update\r
21//\r
22#define BOOT_BLOCK_BASE\r
23\r
6aab8214 24/**\r
25\r
26 Get swap state\r
27 This is a internal function.\r
28\r
29 @param FtwLiteDevice Calling context\r
30 @param SwapState Swap state\r
31\r
32 @retval EFI_SUCCESS State successfully got\r
33\r
34**/\r
d7dec593 35EFI_STATUS\r
36GetSwapState (\r
37 IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
38 OUT BOOLEAN *SwapState\r
39 )\r
6aab8214 40{\r
41 return EFI_SUCCESS;\r
42}\r
d7dec593 43\r
6aab8214 44/**\r
45 Set swap state.\r
46 This is a internal function.\r
d7dec593 47\r
d7dec593 48\r
6aab8214 49 @param FtwLiteDevice Indicates a pointer to the calling context.\r
50 @param TopSwap New swap state\r
d7dec593 51\r
6aab8214 52 @retval EFI_SUCCESS The function completed successfully\r
53 Note:\r
54 the Top-Swap bit (bit 13, D31: F0, Offset D4h). Note that\r
55 software will not be able to clear the Top-Swap bit until the system is\r
56 rebooted without GNT[A]# being pulled down.\r
d7dec593 57\r
6aab8214 58**/\r
d7dec593 59EFI_STATUS\r
60SetSwapState (\r
61 IN EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
62 IN BOOLEAN TopSwap\r
63 )\r
6aab8214 64{\r
65 return EFI_SUCCESS;\r
66}\r
d7dec593 67\r
6aab8214 68/**\r
d7dec593 69\r
6aab8214 70 Check whether the block is a boot block.\r
d7dec593 71\r
d7dec593 72\r
6aab8214 73 @param FtwLiteDevice Calling context\r
74 @param FvBlock Fvb protocol instance\r
75 @param Lba Lba value\r
d7dec593 76\r
6aab8214 77 @retval FALSE This is a boot block.\r
78 @retval TRUE This is not a boot block.\r
d7dec593 79\r
6aab8214 80**/\r
d7dec593 81BOOLEAN\r
82IsBootBlock (\r
83 EFI_FTW_LITE_DEVICE *FtwLiteDevice,\r
84 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock,\r
85 EFI_LBA Lba\r
86 )\r
d7dec593 87{\r
88 //\r
89 // IPF doesn't support safe bootblock update\r
90 // so treat bootblock as normal block\r
91 //\r
92 return FALSE;\r
93}\r
94\r
6aab8214 95/**\r
96 Copy the content of spare block to a boot block. Size is FTW_BLOCK_SIZE.\r
97 Spare block is accessed by FTW backup FVB protocol interface. LBA is\r
98 FtwLiteDevice->FtwSpareLba.\r
99 Boot block is accessed by BootFvb protocol interface. LBA is 0.\r
d7dec593 100\r
d7dec593 101\r
6aab8214 102 @param FtwLiteDevice The private data of FTW_LITE driver\r
d7dec593 103\r
6aab8214 104 @retval EFI_SUCCESS Spare block content is copied to boot block\r
105 @retval EFI_INVALID_PARAMETER Input parameter error\r
106 @retval EFI_OUT_OF_RESOURCES Allocate memory error\r
107 @retval EFI_ABORTED The function could not complete successfully\r
108 Notes:\r
d7dec593 109\r
6aab8214 110**/\r
111EFI_STATUS\r
112FlushSpareBlockToBootBlock (\r
113 EFI_FTW_LITE_DEVICE *FtwLiteDevice\r
114 )\r
d7dec593 115{\r
116 return EFI_SUCCESS;\r
117}\r