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