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 FvGetVolumeAttributes (
21 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
22 OUT EFI_FV_ATTRIBUTES
*Attributes
27 Retrieves attributes, insures positive polarity of attribute bits, returns
28 resulting attributes in output parameter
31 This - Calling context
32 Attributes - output buffer which contains attributes
35 EFI_SUCCESS - Successfully got volume attributes
41 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*Fvb
;
42 EFI_FVB_ATTRIBUTES FvbAttributes
;
44 FvDevice
= FV_DEVICE_FROM_THIS (This
);
47 if (FvDevice
->CachedFv
== NULL
) {
48 Status
= FvCheck (FvDevice
);
49 if (EFI_ERROR (Status
)) {
55 // First get the Firmware Volume Block Attributes
57 Status
= Fvb
->GetAttributes (Fvb
, &FvbAttributes
);
60 // Mask out Fvb bits that are not defined in FV
62 FvbAttributes
&= 0xfffff0ff;
64 *Attributes
= (EFI_FV_ATTRIBUTES
)FvbAttributes
;
72 FvSetVolumeAttributes (
73 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
74 IN OUT EFI_FV_ATTRIBUTES
*Attributes
79 Sets current attributes for volume
82 This - Calling context
83 Attributes - At input, contains attributes to be set. At output contains
87 EFI_UNSUPPORTED - Could not be set.
91 return EFI_UNSUPPORTED
;
97 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
98 IN CONST EFI_GUID
*InformationType
,
99 IN OUT UINTN
*BufferSize
,
105 Return information of type InformationType for the requested firmware
109 This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
110 InformationType - InformationType for requested.
111 BufferSize - On input, size of Buffer.On output, the amount of
112 data returned in Buffer.
113 Buffer - A poniter to the data buffer to return.
115 EFI_SUCCESS - Successfully got volume Information.
119 return EFI_UNSUPPORTED
;
126 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL
*This
,
127 IN CONST EFI_GUID
*InformationType
,
129 IN CONST VOID
*Buffer
134 Set information of type InformationType for the requested firmware
138 This - Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
139 InformationType - InformationType for requested.
140 BufferSize - On input, size of Buffer.On output, the amount of
141 data returned in Buffer.
142 Buffer - A poniter to the data buffer to return.
144 EFI_SUCCESS - Successfully set volume Information.
148 return EFI_UNSUPPORTED
;