2 Implements get/set firmware volume attributes
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Retrieves attributes, insures positive polarity of attribute bits, returns
20 resulting attributes in output parameter.
22 @param This Calling context
23 @param Attributes output buffer which contains attributes
25 @retval EFI_SUCCESS Successfully got volume attributes
30 FvGetVolumeAttributes (
31 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
32 OUT EFI_FV_ATTRIBUTES
*Attributes
37 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*Fvb
;
38 EFI_FVB_ATTRIBUTES FvbAttributes
;
40 FvDevice
= FV_DEVICE_FROM_THIS (This
);
43 if (FvDevice
->CachedFv
== NULL
) {
44 Status
= FvCheck (FvDevice
);
45 if (EFI_ERROR (Status
)) {
51 // First get the Firmware Volume Block Attributes
53 Status
= Fvb
->GetAttributes (Fvb
, &FvbAttributes
);
56 // Mask out Fvb bits that are not defined in FV
58 FvbAttributes
&= 0xfffff0ff;
60 *Attributes
= (EFI_FV_ATTRIBUTES
)FvbAttributes
;
68 Sets current attributes for volume
70 @param This Calling context
71 @param Attributes At input, contains attributes to be set. At output
72 contains new value of FV
74 @retval EFI_UNSUPPORTED Could not be set.
79 FvSetVolumeAttributes (
80 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
81 IN OUT EFI_FV_ATTRIBUTES
*Attributes
84 return EFI_UNSUPPORTED
;
89 Return information of type InformationType for the requested firmware
92 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
93 @param InformationType InformationType for requested.
94 @param BufferSize On input, size of Buffer.On output, the amount of data
96 @param Buffer A poniter to the data buffer to return.
98 @retval EFI_SUCCESS Successfully got volume Information.
104 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
105 IN CONST EFI_GUID
*InformationType
,
106 IN OUT UINTN
*BufferSize
,
110 return EFI_UNSUPPORTED
;
116 Set information of type InformationType for the requested firmware
119 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
120 @param InformationType InformationType for requested.
121 @param BufferSize On input, size of Buffer.On output, the amount of data
123 @param Buffer A poniter to the data buffer to return.
125 @retval EFI_SUCCESS Successfully set volume Information.
131 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
132 IN CONST EFI_GUID
*InformationType
,
134 IN CONST VOID
*Buffer
137 return EFI_UNSUPPORTED
;