3 Implements get/set firmware volume attributes
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
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.
20 Retrieves attributes, insures positive polarity of attribute bits, returns
21 resulting attributes in output parameter.
23 @param This Calling context
24 @param Attributes output buffer which contains attributes
26 @retval EFI_SUCCESS Successfully got volume attributes
31 FvGetVolumeAttributes (
32 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
33 OUT EFI_FV_ATTRIBUTES
*Attributes
38 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*Fvb
;
39 EFI_FVB_ATTRIBUTES FvbAttributes
;
41 FvDevice
= FV_DEVICE_FROM_THIS (This
);
44 if (FvDevice
->CachedFv
== NULL
) {
45 Status
= FvCheck (FvDevice
);
46 if (EFI_ERROR (Status
)) {
52 // First get the Firmware Volume Block Attributes
54 Status
= Fvb
->GetAttributes (Fvb
, &FvbAttributes
);
57 // Mask out Fvb bits that are not defined in FV
59 FvbAttributes
&= 0xfffff0ff;
61 *Attributes
= (EFI_FV_ATTRIBUTES
)FvbAttributes
;
69 Sets current attributes for volume
71 @param This Calling context
72 @param Attributes At input, contains attributes to be set. At output
73 contains new value of FV
75 @retval EFI_UNSUPPORTED Could not be set.
80 FvSetVolumeAttributes (
81 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
82 IN OUT EFI_FV_ATTRIBUTES
*Attributes
85 return EFI_UNSUPPORTED
;
90 Return information of type InformationType for the requested firmware
93 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
94 @param InformationType InformationType for requested.
95 @param BufferSize On input, size of Buffer.On output, the amount of data
97 @param Buffer A poniter to the data buffer to return.
99 @retval EFI_SUCCESS Successfully got volume Information.
105 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
106 IN CONST EFI_GUID
*InformationType
,
107 IN OUT UINTN
*BufferSize
,
111 return EFI_UNSUPPORTED
;
117 Set information of type InformationType for the requested firmware
120 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
121 @param InformationType InformationType for requested.
122 @param BufferSize On input, size of Buffer.On output, the amount of data
124 @param Buffer A poniter to the data buffer to return.
126 @retval EFI_SUCCESS Successfully set volume Information.
132 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
133 IN CONST EFI_GUID
*InformationType
,
135 IN CONST VOID
*Buffer
138 return EFI_UNSUPPORTED
;