2 Implements get/set firmware volume attributes
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 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.
16 #include "FwVolDriver.h"
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_2 FvbAttributes
;
41 FvDevice
= FV_DEVICE_FROM_THIS (This
);
45 // First get the Firmware Volume Block Attributes
47 Status
= Fvb
->GetAttributes (Fvb
, &FvbAttributes
);
50 // Mask out Fvb bits that are not defined in FV
52 FvbAttributes
&= 0xfffff0ff;
54 *Attributes
= (EFI_FV_ATTRIBUTES
)FvbAttributes
;
62 Sets current attributes for volume
64 @param This Calling context
65 @param Attributes At input, contains attributes to be set. At output
66 contains new value of FV
68 @retval EFI_UNSUPPORTED Could not be set.
73 FvSetVolumeAttributes (
74 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
75 IN OUT EFI_FV_ATTRIBUTES
*Attributes
78 return EFI_UNSUPPORTED
;
83 Return information of type InformationType for the requested firmware
86 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
87 @param InformationType InformationType for requested.
88 @param BufferSize On input, size of Buffer.On output, the amount of data
90 @param Buffer A poniter to the data buffer to return.
92 @retval EFI_SUCCESS Successfully got volume Information.
98 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
99 IN CONST EFI_GUID
*InformationType
,
100 IN OUT UINTN
*BufferSize
,
104 return EFI_UNSUPPORTED
;
110 Set information of type InformationType for the requested firmware
113 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
114 @param InformationType InformationType for requested.
115 @param BufferSize On input, size of Buffer.On output, the amount of data
117 @param Buffer A poniter to the data buffer to return.
119 @retval EFI_SUCCESS Successfully set volume Information.
125 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
126 IN CONST EFI_GUID
*InformationType
,
128 IN CONST VOID
*Buffer
131 return EFI_UNSUPPORTED
;