]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Core/Dxe/FwVol/FwVolAttrib.c
Initial import.
[mirror_edk2.git] / EdkModulePkg / Core / Dxe / FwVol / FwVolAttrib.c
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 FwVolAttrib.c\r
15\r
16Abstract:\r
17\r
18 Implements get/set firmware volume attributes\r
19\r
20--*/\r
21\r
22#include <DxeMain.h>\r
23\r
24EFI_STATUS\r
25EFIAPI\r
26FvGetVolumeAttributes (\r
27 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,\r
28 OUT EFI_FV_ATTRIBUTES *Attributes\r
29 )\r
30/*++\r
31\r
32Routine Description:\r
33 Retrieves attributes, insures positive polarity of attribute bits, returns\r
34 resulting attributes in output parameter\r
35\r
36Arguments:\r
37 This - Calling context\r
38 Attributes - output buffer which contains attributes\r
39\r
40Returns:\r
41 EFI_SUCCESS - Successfully got volume attributes\r
42\r
43--*/\r
44{\r
45 EFI_STATUS Status;\r
46 FV_DEVICE *FvDevice;\r
47 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;\r
48 EFI_FVB_ATTRIBUTES FvbAttributes;\r
49\r
50 FvDevice = FV_DEVICE_FROM_THIS (This);\r
51 Fvb = FvDevice->Fvb;\r
52\r
53 if (FvDevice->CachedFv == NULL) {\r
54 Status = FvCheck (FvDevice);\r
55 if (EFI_ERROR (Status)) {\r
56 return Status;\r
57 }\r
58 }\r
59\r
60 //\r
61 // First get the Firmware Volume Block Attributes\r
62 //\r
63 Status = Fvb->GetVolumeAttributes (Fvb, &FvbAttributes);\r
64\r
65 //\r
66 // Mask out Fvb bits that are not defined in FV \r
67 //\r
68 FvbAttributes &= 0xfffff0ff;\r
69 \r
70 *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes; \r
71 \r
72 return Status;\r
73}\r
74\r
75\r
76EFI_STATUS\r
77EFIAPI\r
78FvSetVolumeAttributes (\r
79 IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,\r
80 IN OUT EFI_FV_ATTRIBUTES *Attributes\r
81 )\r
82/*++\r
83\r
84Routine Description:\r
85 Sets current attributes for volume\r
86\r
87Arguments:\r
88 This - Calling context\r
89 Attributes - At input, contains attributes to be set. At output contains\r
90 new value of FV\r
91\r
92Returns:\r
93 EFI_UNSUPPORTED - Could not be set.\r
94\r
95--*/\r
96{\r
97 return EFI_UNSUPPORTED;\r
98}\r
99\r