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