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