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