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