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