4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Implements get/set firmware volume attributes.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are licensed and made available under the terms and conditions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of the BSD License which accompanies this distribution. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Retrieves attributes, insures positive polarity of attribute bits, returns
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync resulting attributes in output parameter.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Calling context
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Attributes output buffer which contains attributes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Successfully got volume attributes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // First get the Firmware Volume Block Attributes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Sets current attributes for volume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Calling context
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Attributes On input, FvAttributes is a pointer to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync an EFI_FV_ATTRIBUTES containing the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync desired firmware volume settings. On
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync successful return, it contains the new
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync settings of the firmware volume. On
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync unsuccessful return, FvAttributes is not
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync modified and the firmware volume
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync settings are not changed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The requested firmware volume attributes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync were set and the resulting
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_FV_ATTRIBUTES is returned in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync FvAttributes.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_ACCESS_DENIED Atrribute is locked down.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER Atrribute is not valid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // First get the current Volume Attributes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((OldFvbAttributes & EFI_FVB2_LOCK_STATUS) != 0) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Only status attributes can be updated.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Capabilities = OldFvbAttributes & EFI_FVB2_CAPABILITIES;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Test read disable
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((Capabilities & EFI_FVB2_READ_DISABLED_CAP) == 0) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Test read enable
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((Capabilities & EFI_FVB2_READ_ENABLED_CAP) == 0) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Test write disable
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((Capabilities & EFI_FVB2_WRITE_DISABLED_CAP) == 0) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Test write enable
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((Capabilities & EFI_FVB2_WRITE_ENABLED_CAP) == 0) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Test lock
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync NewFvbAttributes = OldFvbAttributes & (0xFFFFFFFF & (~EFI_FVB2_STATUS));
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Return information of type InformationType for the requested firmware
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param InformationType InformationType for requested.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param BufferSize On input, size of Buffer.On output, the amount of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync data returned in Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer A poniter to the data buffer to return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return EFI_UNSUPPORTED Could not get.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Set information with InformationType into the requested firmware volume.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param InformationType InformationType for requested.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param BufferSize Size of Buffer data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer A poniter to the data buffer to be set.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_UNSUPPORTED Could not set.