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