]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/Dxe/FwVol/FwVolAttrib.c
Clean up DxeCore to remove duplicate memory allocation & device path utility services...
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / FwVol / FwVolAttrib.c
CommitLineData
23c98c94 1/** @file\r
504214c4 2 Implements get/set firmware volume attributes\r
28a00297 3\r
23c98c94 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
28a00297 12\r
504214c4 13**/\r
28a00297 14\r
9c4ac31c 15#include "DxeMain.h"\r
28a00297 16\r
162ed594 17\r
18/**\r
19 Retrieves attributes, insures positive polarity of attribute bits, returns\r
20 resulting attributes in output parameter.\r
21\r
022c6d45 22 @param This Calling context\r
23 @param Attributes output buffer which contains attributes\r
162ed594 24\r
25 @retval EFI_SUCCESS Successfully got volume attributes\r
26\r
27**/\r
28a00297 28EFI_STATUS\r
29EFIAPI\r
30FvGetVolumeAttributes (\r
0c2b5da8 31 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r
32 OUT EFI_FV_ATTRIBUTES *Attributes\r
28a00297 33 )\r
28a00297 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
022c6d45 56 // Mask out Fvb bits that are not defined in FV\r
28a00297 57 //\r
58 FvbAttributes &= 0xfffff0ff;\r
022c6d45 59\r
60 *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes;\r
61\r
28a00297 62 return Status;\r
63}\r
64\r
65\r
162ed594 66\r
67/**\r
68 Sets current attributes for volume\r
69\r
022c6d45 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
162ed594 73\r
74 @retval EFI_UNSUPPORTED Could not be set.\r
75\r
76**/\r
28a00297 77EFI_STATUS\r
78EFIAPI\r
79FvSetVolumeAttributes (\r
0c2b5da8 80 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r
81 IN OUT EFI_FV_ATTRIBUTES *Attributes\r
28a00297 82 )\r
162ed594 83{\r
84 return EFI_UNSUPPORTED;\r
85}\r
28a00297 86\r
28a00297 87\r
162ed594 88/**\r
89 Return information of type InformationType for the requested firmware\r
90 volume.\r
28a00297 91\r
022c6d45 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
28a00297 97\r
162ed594 98 @retval EFI_SUCCESS Successfully got volume Information.\r
28a00297 99\r
162ed594 100**/\r
0c2b5da8 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
0c2b5da8 109{\r
110 return EFI_UNSUPPORTED;\r
111}\r
112\r
113\r
162ed594 114\r
115/**\r
116 Set information of type InformationType for the requested firmware\r
117 volume.\r
118\r
022c6d45 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
162ed594 124\r
125 @retval EFI_SUCCESS Successfully set volume Information.\r
126\r
127**/\r
0c2b5da8 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
0c2b5da8 136{\r
137 return EFI_UNSUPPORTED;\r
138}\r
139\r
140\r
162ed594 141\r