]>
Commit | Line | Data |
---|---|---|
28a00297 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | FwVolAttrib.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Implements get/set firmware volume attributes\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #include <DxeMain.h>\r | |
23 | \r | |
24 | EFI_STATUS\r | |
25 | EFIAPI\r | |
26 | FvGetVolumeAttributes (\r | |
0c2b5da8 | 27 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r |
28 | OUT EFI_FV_ATTRIBUTES *Attributes\r | |
28a00297 | 29 | )\r |
30 | /*++\r | |
31 | \r | |
32 | Routine Description:\r | |
33 | Retrieves attributes, insures positive polarity of attribute bits, returns\r | |
34 | resulting attributes in output parameter\r | |
35 | \r | |
36 | Arguments:\r | |
37 | This - Calling context\r | |
38 | Attributes - output buffer which contains attributes\r | |
39 | \r | |
40 | Returns:\r | |
41 | EFI_SUCCESS - Successfully got volume attributes\r | |
42 | \r | |
43 | --*/\r | |
44 | {\r | |
45 | EFI_STATUS Status;\r | |
46 | FV_DEVICE *FvDevice;\r | |
47 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;\r | |
48 | EFI_FVB_ATTRIBUTES FvbAttributes;\r | |
49 | \r | |
50 | FvDevice = FV_DEVICE_FROM_THIS (This);\r | |
51 | Fvb = FvDevice->Fvb;\r | |
52 | \r | |
53 | if (FvDevice->CachedFv == NULL) {\r | |
54 | Status = FvCheck (FvDevice);\r | |
55 | if (EFI_ERROR (Status)) {\r | |
56 | return Status;\r | |
57 | }\r | |
58 | }\r | |
59 | \r | |
60 | //\r | |
61 | // First get the Firmware Volume Block Attributes\r | |
62 | //\r | |
63 | Status = Fvb->GetAttributes (Fvb, &FvbAttributes);\r | |
64 | \r | |
65 | //\r | |
66 | // Mask out Fvb bits that are not defined in FV \r | |
67 | //\r | |
68 | FvbAttributes &= 0xfffff0ff;\r | |
69 | \r | |
70 | *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes; \r | |
71 | \r | |
72 | return Status;\r | |
73 | }\r | |
74 | \r | |
75 | \r | |
76 | EFI_STATUS\r | |
77 | EFIAPI\r | |
78 | FvSetVolumeAttributes (\r | |
0c2b5da8 | 79 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r |
80 | IN OUT EFI_FV_ATTRIBUTES *Attributes\r | |
28a00297 | 81 | )\r |
82 | /*++\r | |
83 | \r | |
84 | Routine Description:\r | |
85 | Sets current attributes for volume\r | |
86 | \r | |
87 | Arguments:\r | |
88 | This - Calling context\r | |
89 | Attributes - At input, contains attributes to be set. At output contains\r | |
90 | new value of FV\r | |
91 | \r | |
92 | Returns:\r | |
93 | EFI_UNSUPPORTED - Could not be set.\r | |
94 | \r | |
95 | --*/\r | |
96 | {\r | |
97 | return EFI_UNSUPPORTED;\r | |
98 | }\r | |
99 | \r | |
0c2b5da8 | 100 | EFI_STATUS\r |
101 | EFIAPI\r | |
102 | FvGetVolumeInfo (\r | |
103 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
104 | IN CONST EFI_GUID *InformationType,\r | |
105 | IN OUT UINTN *BufferSize,\r | |
106 | OUT VOID *Buffer\r | |
107 | )\r | |
108 | /*++\r | |
109 | \r | |
110 | Routine Description:\r | |
111 | Return information of type InformationType for the requested firmware\r | |
112 | volume.\r | |
113 | \r | |
114 | Arguments:\r | |
115 | This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r | |
116 | InformationType - InformationType for requested.\r | |
117 | BufferSize - On input, size of Buffer.On output, the amount of\r | |
118 | data returned in Buffer.\r | |
119 | Buffer - A poniter to the data buffer to return.\r | |
120 | Returns:\r | |
121 | EFI_SUCCESS - Successfully got volume Information.\r | |
122 | \r | |
123 | --*/\r | |
124 | {\r | |
125 | return EFI_UNSUPPORTED;\r | |
126 | }\r | |
127 | \r | |
128 | \r | |
129 | EFI_STATUS\r | |
130 | EFIAPI\r | |
131 | FvSetVolumeInfo (\r | |
132 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
133 | IN CONST EFI_GUID *InformationType,\r | |
134 | IN UINTN BufferSize,\r | |
135 | IN CONST VOID *Buffer\r | |
136 | )\r | |
137 | /*++\r | |
138 | \r | |
139 | Routine Description:\r | |
140 | Set information of type InformationType for the requested firmware\r | |
141 | volume.\r | |
142 | \r | |
143 | Arguments:\r | |
144 | This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r | |
145 | InformationType - InformationType for requested.\r | |
146 | BufferSize - On input, size of Buffer.On output, the amount of\r | |
147 | data returned in Buffer.\r | |
148 | Buffer - A poniter to the data buffer to return.\r | |
149 | Returns:\r | |
150 | EFI_SUCCESS - Successfully set volume Information.\r | |
151 | \r | |
152 | --*/\r | |
153 | {\r | |
154 | return EFI_UNSUPPORTED;\r | |
155 | }\r | |
156 | \r | |
157 | \r |