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