]>
Commit | Line | Data |
---|---|---|
23c98c94 | 1 | /** @file\r |
504214c4 | 2 | Implements get/set firmware volume attributes\r |
28a00297 | 3 | \r |
1f33d186 | 4 | Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r |
cd5ebaa0 | 5 | This program and the accompanying materials\r |
23c98c94 | 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 | |
28a00297 | 44 | //\r |
45 | // First get the Firmware Volume Block Attributes\r | |
46 | //\r | |
47 | Status = Fvb->GetAttributes (Fvb, &FvbAttributes);\r | |
48 | \r | |
49 | //\r | |
022c6d45 | 50 | // Mask out Fvb bits that are not defined in FV\r |
28a00297 | 51 | //\r |
52 | FvbAttributes &= 0xfffff0ff;\r | |
022c6d45 | 53 | \r |
54 | *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes;\r | |
55 | \r | |
28a00297 | 56 | return Status;\r |
57 | }\r | |
58 | \r | |
59 | \r | |
162ed594 | 60 | \r |
61 | /**\r | |
62 | Sets current attributes for volume\r | |
63 | \r | |
022c6d45 | 64 | @param This Calling context\r |
65 | @param Attributes At input, contains attributes to be set. At output\r | |
66 | contains new value of FV\r | |
162ed594 | 67 | \r |
68 | @retval EFI_UNSUPPORTED Could not be set.\r | |
69 | \r | |
70 | **/\r | |
28a00297 | 71 | EFI_STATUS\r |
72 | EFIAPI\r | |
73 | FvSetVolumeAttributes (\r | |
0c2b5da8 | 74 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r |
75 | IN OUT EFI_FV_ATTRIBUTES *Attributes\r | |
28a00297 | 76 | )\r |
162ed594 | 77 | {\r |
78 | return EFI_UNSUPPORTED;\r | |
79 | }\r | |
28a00297 | 80 | \r |
28a00297 | 81 | \r |
162ed594 | 82 | /**\r |
83 | Return information of type InformationType for the requested firmware\r | |
84 | volume.\r | |
28a00297 | 85 | \r |
022c6d45 | 86 | @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r |
87 | @param InformationType InformationType for requested.\r | |
88 | @param BufferSize On input, size of Buffer.On output, the amount of data\r | |
89 | returned in Buffer.\r | |
90 | @param Buffer A poniter to the data buffer to return.\r | |
28a00297 | 91 | \r |
162ed594 | 92 | @retval EFI_SUCCESS Successfully got volume Information.\r |
28a00297 | 93 | \r |
162ed594 | 94 | **/\r |
0c2b5da8 | 95 | EFI_STATUS\r |
96 | EFIAPI\r | |
97 | FvGetVolumeInfo (\r | |
98 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
99 | IN CONST EFI_GUID *InformationType,\r | |
100 | IN OUT UINTN *BufferSize,\r | |
101 | OUT VOID *Buffer\r | |
102 | )\r | |
0c2b5da8 | 103 | {\r |
104 | return EFI_UNSUPPORTED;\r | |
105 | }\r | |
106 | \r | |
107 | \r | |
162ed594 | 108 | \r |
109 | /**\r | |
110 | Set information of type InformationType for the requested firmware\r | |
111 | volume.\r | |
112 | \r | |
022c6d45 | 113 | @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r |
114 | @param InformationType InformationType for requested.\r | |
115 | @param BufferSize On input, size of Buffer.On output, the amount of data\r | |
116 | returned in Buffer.\r | |
117 | @param Buffer A poniter to the data buffer to return.\r | |
162ed594 | 118 | \r |
119 | @retval EFI_SUCCESS Successfully set volume Information.\r | |
120 | \r | |
121 | **/\r | |
0c2b5da8 | 122 | EFI_STATUS\r |
123 | EFIAPI\r | |
124 | FvSetVolumeInfo (\r | |
125 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
126 | IN CONST EFI_GUID *InformationType,\r | |
127 | IN UINTN BufferSize,\r | |
128 | IN CONST VOID *Buffer\r | |
129 | )\r | |
0c2b5da8 | 130 | {\r |
131 | return EFI_UNSUPPORTED;\r | |
132 | }\r | |
133 | \r | |
134 | \r | |
162ed594 | 135 | \r |