]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Dxe/FwVol/FwVolAttrib.c
Code Scrub for Dxe Core.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / FwVol / FwVolAttrib.c
1 /** @file
2 Implements get/set firmware volume attributes
3
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
5 All rights reserved. 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
9
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.
12
13 **/
14
15 #include <DxeMain.h>
16
17
18 /**
19 Retrieves attributes, insures positive polarity of attribute bits, returns
20 resulting attributes in output parameter.
21
22 @param This Calling context
23 @param Attributes output buffer which contains attributes
24
25 @retval EFI_SUCCESS Successfully got volume attributes
26
27 **/
28 EFI_STATUS
29 EFIAPI
30 FvGetVolumeAttributes (
31 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
32 OUT EFI_FV_ATTRIBUTES *Attributes
33 )
34 {
35 EFI_STATUS Status;
36 FV_DEVICE *FvDevice;
37 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
38 EFI_FVB_ATTRIBUTES FvbAttributes;
39
40 FvDevice = FV_DEVICE_FROM_THIS (This);
41 Fvb = FvDevice->Fvb;
42
43 if (FvDevice->CachedFv == NULL) {
44 Status = FvCheck (FvDevice);
45 if (EFI_ERROR (Status)) {
46 return Status;
47 }
48 }
49
50 //
51 // First get the Firmware Volume Block Attributes
52 //
53 Status = Fvb->GetAttributes (Fvb, &FvbAttributes);
54
55 //
56 // Mask out Fvb bits that are not defined in FV
57 //
58 FvbAttributes &= 0xfffff0ff;
59
60 *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes;
61
62 return Status;
63 }
64
65
66
67 /**
68 Sets current attributes for volume
69
70 @param This Calling context
71 @param Attributes At input, contains attributes to be set. At output
72 contains new value of FV
73
74 @retval EFI_UNSUPPORTED Could not be set.
75
76 **/
77 EFI_STATUS
78 EFIAPI
79 FvSetVolumeAttributes (
80 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
81 IN OUT EFI_FV_ATTRIBUTES *Attributes
82 )
83 {
84 return EFI_UNSUPPORTED;
85 }
86
87
88 /**
89 Return information of type InformationType for the requested firmware
90 volume.
91
92 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
93 @param InformationType InformationType for requested.
94 @param BufferSize On input, size of Buffer.On output, the amount of data
95 returned in Buffer.
96 @param Buffer A poniter to the data buffer to return.
97
98 @retval EFI_SUCCESS Successfully got volume Information.
99
100 **/
101 EFI_STATUS
102 EFIAPI
103 FvGetVolumeInfo (
104 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
105 IN CONST EFI_GUID *InformationType,
106 IN OUT UINTN *BufferSize,
107 OUT VOID *Buffer
108 )
109 {
110 return EFI_UNSUPPORTED;
111 }
112
113
114
115 /**
116 Set information of type InformationType for the requested firmware
117 volume.
118
119 @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.
120 @param InformationType InformationType for requested.
121 @param BufferSize On input, size of Buffer.On output, the amount of data
122 returned in Buffer.
123 @param Buffer A poniter to the data buffer to return.
124
125 @retval EFI_SUCCESS Successfully set volume Information.
126
127 **/
128 EFI_STATUS
129 EFIAPI
130 FvSetVolumeInfo (
131 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
132 IN CONST EFI_GUID *InformationType,
133 IN UINTN BufferSize,
134 IN CONST VOID *Buffer
135 )
136 {
137 return EFI_UNSUPPORTED;
138 }
139
140
141