2 Implements get/set firmware volume attributes
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "FwVolDriver.h"
13 Retrieves attributes, insures positive polarity of attribute bits, returns
14 resulting attributes in output parameter.
16 @param This Calling context
17 @param Attributes output buffer which contains attributes
19 @retval EFI_SUCCESS Successfully got volume attributes
24 FvGetVolumeAttributes (
25 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
26 OUT EFI_FV_ATTRIBUTES
*Attributes
31 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*Fvb
;
32 EFI_FVB_ATTRIBUTES_2 FvbAttributes
;
34 FvDevice
= FV_DEVICE_FROM_THIS (This
);
38 // First get the Firmware Volume Block Attributes
40 Status
= Fvb
->GetAttributes (Fvb
, &FvbAttributes
);
43 // Mask out Fvb bits that are not defined in FV
45 FvbAttributes
&= 0xfffff0ff;
47 *Attributes
= (EFI_FV_ATTRIBUTES
)FvbAttributes
;
53 Sets current attributes for volume
55 @param This Calling context
56 @param Attributes At input, contains attributes to be set. At output
57 contains new value of FV
59 @retval EFI_UNSUPPORTED Could not be set.
64 FvSetVolumeAttributes (
65 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
66 IN OUT EFI_FV_ATTRIBUTES
*Attributes
69 return EFI_UNSUPPORTED
;
73 Return information of type InformationType for the requested firmware
76 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
77 @param InformationType InformationType for requested.
78 @param BufferSize On input, size of Buffer.On output, the amount of data
80 @param Buffer A poniter to the data buffer to return.
82 @retval EFI_SUCCESS Successfully got volume Information.
88 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
89 IN CONST EFI_GUID
*InformationType
,
90 IN OUT UINTN
*BufferSize
,
94 return EFI_UNSUPPORTED
;
98 Set information of type InformationType for the requested firmware
101 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
102 @param InformationType InformationType for requested.
103 @param BufferSize On input, size of Buffer.On output, the amount of data
105 @param Buffer A poniter to the data buffer to return.
107 @retval EFI_SUCCESS Successfully set volume Information.
113 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
114 IN CONST EFI_GUID
*InformationType
,
116 IN CONST VOID
*Buffer
119 return EFI_UNSUPPORTED
;