]>
Commit | Line | Data |
---|---|---|
28a00297 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | FwVolAttrib.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Implements get/set firmware volume attributes\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #include <DxeMain.h>\r | |
23 | \r | |
24 | EFI_STATUS\r | |
25 | EFIAPI\r | |
26 | FvGetVolumeAttributes (\r | |
27 | IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,\r | |
28 | OUT EFI_FV_ATTRIBUTES *Attributes\r | |
29 | )\r | |
30 | /*++\r | |
31 | \r | |
32 | Routine Description:\r | |
33 | Retrieves attributes, insures positive polarity of attribute bits, returns\r | |
34 | resulting attributes in output parameter\r | |
35 | \r | |
36 | Arguments:\r | |
37 | This - Calling context\r | |
38 | Attributes - output buffer which contains attributes\r | |
39 | \r | |
40 | Returns:\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->GetAttributes (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 | |
76 | EFI_STATUS\r | |
77 | EFIAPI\r | |
78 | FvSetVolumeAttributes (\r | |
79 | IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,\r | |
80 | IN OUT EFI_FV_ATTRIBUTES *Attributes\r | |
81 | )\r | |
82 | /*++\r | |
83 | \r | |
84 | Routine Description:\r | |
85 | Sets current attributes for volume\r | |
86 | \r | |
87 | Arguments:\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 | |
92 | Returns:\r | |
93 | EFI_UNSUPPORTED - Could not be set.\r | |
94 | \r | |
95 | --*/\r | |
96 | {\r | |
97 | return EFI_UNSUPPORTED;\r | |
98 | }\r | |
99 | \r |