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