]>
Commit | Line | Data |
---|---|---|
504214c4 LG |
1 | /** @file \r |
2 | \r | |
3 | Implements get/set firmware volume attributes\r | |
28a00297 | 4 | \r |
504214c4 | 5 | Copyright (c) 2006 - 2008, Intel Corporation \r |
28a00297 | 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 | |
504214c4 | 14 | **/\r |
28a00297 | 15 | \r |
16 | #include <DxeMain.h>\r | |
17 | \r | |
18 | EFI_STATUS\r | |
19 | EFIAPI\r | |
20 | FvGetVolumeAttributes (\r | |
0c2b5da8 | 21 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r |
22 | OUT EFI_FV_ATTRIBUTES *Attributes\r | |
28a00297 | 23 | )\r |
24 | /*++\r | |
25 | \r | |
26 | Routine Description:\r | |
27 | Retrieves attributes, insures positive polarity of attribute bits, returns\r | |
28 | resulting attributes in output parameter\r | |
29 | \r | |
30 | Arguments:\r | |
31 | This - Calling context\r | |
32 | Attributes - output buffer which contains attributes\r | |
33 | \r | |
34 | Returns:\r | |
35 | EFI_SUCCESS - Successfully got volume attributes\r | |
36 | \r | |
37 | --*/\r | |
38 | {\r | |
39 | EFI_STATUS Status;\r | |
40 | FV_DEVICE *FvDevice;\r | |
41 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;\r | |
42 | EFI_FVB_ATTRIBUTES FvbAttributes;\r | |
43 | \r | |
44 | FvDevice = FV_DEVICE_FROM_THIS (This);\r | |
45 | Fvb = FvDevice->Fvb;\r | |
46 | \r | |
47 | if (FvDevice->CachedFv == NULL) {\r | |
48 | Status = FvCheck (FvDevice);\r | |
49 | if (EFI_ERROR (Status)) {\r | |
50 | return Status;\r | |
51 | }\r | |
52 | }\r | |
53 | \r | |
54 | //\r | |
55 | // First get the Firmware Volume Block Attributes\r | |
56 | //\r | |
57 | Status = Fvb->GetAttributes (Fvb, &FvbAttributes);\r | |
58 | \r | |
59 | //\r | |
60 | // Mask out Fvb bits that are not defined in FV \r | |
61 | //\r | |
62 | FvbAttributes &= 0xfffff0ff;\r | |
63 | \r | |
64 | *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes; \r | |
65 | \r | |
66 | return Status;\r | |
67 | }\r | |
68 | \r | |
69 | \r | |
70 | EFI_STATUS\r | |
71 | EFIAPI\r | |
72 | FvSetVolumeAttributes (\r | |
0c2b5da8 | 73 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r |
74 | IN OUT EFI_FV_ATTRIBUTES *Attributes\r | |
28a00297 | 75 | )\r |
76 | /*++\r | |
77 | \r | |
78 | Routine Description:\r | |
79 | Sets current attributes for volume\r | |
80 | \r | |
81 | Arguments:\r | |
82 | This - Calling context\r | |
83 | Attributes - At input, contains attributes to be set. At output contains\r | |
84 | new value of FV\r | |
85 | \r | |
86 | Returns:\r | |
87 | EFI_UNSUPPORTED - Could not be set.\r | |
88 | \r | |
89 | --*/\r | |
90 | {\r | |
91 | return EFI_UNSUPPORTED;\r | |
92 | }\r | |
93 | \r | |
0c2b5da8 | 94 | EFI_STATUS\r |
95 | EFIAPI\r | |
96 | FvGetVolumeInfo (\r | |
97 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
98 | IN CONST EFI_GUID *InformationType,\r | |
99 | IN OUT UINTN *BufferSize,\r | |
100 | OUT VOID *Buffer\r | |
101 | )\r | |
102 | /*++\r | |
103 | \r | |
104 | Routine Description:\r | |
105 | Return information of type InformationType for the requested firmware\r | |
106 | volume.\r | |
107 | \r | |
108 | Arguments:\r | |
109 | This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r | |
110 | InformationType - InformationType for requested.\r | |
111 | BufferSize - On input, size of Buffer.On output, the amount of\r | |
112 | data returned in Buffer.\r | |
113 | Buffer - A poniter to the data buffer to return.\r | |
114 | Returns:\r | |
115 | EFI_SUCCESS - Successfully got volume Information.\r | |
116 | \r | |
117 | --*/\r | |
118 | {\r | |
119 | return EFI_UNSUPPORTED;\r | |
120 | }\r | |
121 | \r | |
122 | \r | |
123 | EFI_STATUS\r | |
124 | EFIAPI\r | |
125 | FvSetVolumeInfo (\r | |
126 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
127 | IN CONST EFI_GUID *InformationType,\r | |
128 | IN UINTN BufferSize,\r | |
129 | IN CONST VOID *Buffer\r | |
130 | )\r | |
131 | /*++\r | |
132 | \r | |
133 | Routine Description:\r | |
134 | Set information of type InformationType for the requested firmware\r | |
135 | volume.\r | |
136 | \r | |
137 | Arguments:\r | |
138 | This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r | |
139 | InformationType - InformationType for requested.\r | |
140 | BufferSize - On input, size of Buffer.On output, the amount of\r | |
141 | data returned in Buffer.\r | |
142 | Buffer - A poniter to the data buffer to return.\r | |
143 | Returns:\r | |
144 | EFI_SUCCESS - Successfully set volume Information.\r | |
145 | \r | |
146 | --*/\r | |
147 | {\r | |
148 | return EFI_UNSUPPORTED;\r | |
149 | }\r | |
150 | \r | |
151 | \r |