]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Dxe/FwVol/FwVolAttrib.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / FwVol / FwVolAttrib.c
1 /** @file
2 Implements get/set firmware volume attributes
3
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "DxeMain.h"
10 #include "FwVolDriver.h"
11
12 /**
13 Retrieves attributes, insures positive polarity of attribute bits, returns
14 resulting attributes in output parameter.
15
16 @param This Calling context
17 @param Attributes output buffer which contains attributes
18
19 @retval EFI_SUCCESS Successfully got volume attributes
20
21 **/
22 EFI_STATUS
23 EFIAPI
24 FvGetVolumeAttributes (
25 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
26 OUT EFI_FV_ATTRIBUTES *Attributes
27 )
28 {
29 EFI_STATUS Status;
30 FV_DEVICE *FvDevice;
31 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
32 EFI_FVB_ATTRIBUTES_2 FvbAttributes;
33
34 FvDevice = FV_DEVICE_FROM_THIS (This);
35 Fvb = FvDevice->Fvb;
36
37 //
38 // First get the Firmware Volume Block Attributes
39 //
40 Status = Fvb->GetAttributes (Fvb, &FvbAttributes);
41
42 //
43 // Mask out Fvb bits that are not defined in FV
44 //
45 FvbAttributes &= 0xfffff0ff;
46
47 *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes;
48
49 return Status;
50 }
51
52 /**
53 Sets current attributes for volume
54
55 @param This Calling context
56 @param Attributes At input, contains attributes to be set. At output
57 contains new value of FV
58
59 @retval EFI_UNSUPPORTED Could not be set.
60
61 **/
62 EFI_STATUS
63 EFIAPI
64 FvSetVolumeAttributes (
65 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
66 IN OUT EFI_FV_ATTRIBUTES *Attributes
67 )
68 {
69 return EFI_UNSUPPORTED;
70 }
71
72 /**
73 Return information of type InformationType for the requested firmware
74 volume.
75
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
79 returned in Buffer.
80 @param Buffer A poniter to the data buffer to return.
81
82 @retval EFI_SUCCESS Successfully got volume Information.
83
84 **/
85 EFI_STATUS
86 EFIAPI
87 FvGetVolumeInfo (
88 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
89 IN CONST EFI_GUID *InformationType,
90 IN OUT UINTN *BufferSize,
91 OUT VOID *Buffer
92 )
93 {
94 return EFI_UNSUPPORTED;
95 }
96
97 /**
98 Set information of type InformationType for the requested firmware
99 volume.
100
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
104 returned in Buffer.
105 @param Buffer A poniter to the data buffer to return.
106
107 @retval EFI_SUCCESS Successfully set volume Information.
108
109 **/
110 EFI_STATUS
111 EFIAPI
112 FvSetVolumeInfo (
113 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
114 IN CONST EFI_GUID *InformationType,
115 IN UINTN BufferSize,
116 IN CONST VOID *Buffer
117 )
118 {
119 return EFI_UNSUPPORTED;
120 }