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