]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Implements get/set firmware volume attributes\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | **/\r | |
8 | \r | |
9 | #include "DxeMain.h"\r | |
10 | #include "FwVolDriver.h"\r | |
11 | \r | |
12 | /**\r | |
13 | Retrieves attributes, insures positive polarity of attribute bits, returns\r | |
14 | resulting attributes in output parameter.\r | |
15 | \r | |
16 | @param This Calling context\r | |
17 | @param Attributes output buffer which contains attributes\r | |
18 | \r | |
19 | @retval EFI_SUCCESS Successfully got volume attributes\r | |
20 | \r | |
21 | **/\r | |
22 | EFI_STATUS\r | |
23 | EFIAPI\r | |
24 | FvGetVolumeAttributes (\r | |
25 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
26 | OUT EFI_FV_ATTRIBUTES *Attributes\r | |
27 | )\r | |
28 | {\r | |
29 | EFI_STATUS Status;\r | |
30 | FV_DEVICE *FvDevice;\r | |
31 | EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;\r | |
32 | EFI_FVB_ATTRIBUTES_2 FvbAttributes;\r | |
33 | \r | |
34 | FvDevice = FV_DEVICE_FROM_THIS (This);\r | |
35 | Fvb = FvDevice->Fvb;\r | |
36 | \r | |
37 | //\r | |
38 | // First get the Firmware Volume Block Attributes\r | |
39 | //\r | |
40 | Status = Fvb->GetAttributes (Fvb, &FvbAttributes);\r | |
41 | \r | |
42 | //\r | |
43 | // Mask out Fvb bits that are not defined in FV\r | |
44 | //\r | |
45 | FvbAttributes &= 0xfffff0ff;\r | |
46 | \r | |
47 | *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes;\r | |
48 | \r | |
49 | return Status;\r | |
50 | }\r | |
51 | \r | |
52 | /**\r | |
53 | Sets current attributes for volume\r | |
54 | \r | |
55 | @param This Calling context\r | |
56 | @param Attributes At input, contains attributes to be set. At output\r | |
57 | contains new value of FV\r | |
58 | \r | |
59 | @retval EFI_UNSUPPORTED Could not be set.\r | |
60 | \r | |
61 | **/\r | |
62 | EFI_STATUS\r | |
63 | EFIAPI\r | |
64 | FvSetVolumeAttributes (\r | |
65 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
66 | IN OUT EFI_FV_ATTRIBUTES *Attributes\r | |
67 | )\r | |
68 | {\r | |
69 | return EFI_UNSUPPORTED;\r | |
70 | }\r | |
71 | \r | |
72 | /**\r | |
73 | Return information of type InformationType for the requested firmware\r | |
74 | volume.\r | |
75 | \r | |
76 | @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r | |
77 | @param InformationType InformationType for requested.\r | |
78 | @param BufferSize On input, size of Buffer.On output, the amount of data\r | |
79 | returned in Buffer.\r | |
80 | @param Buffer A poniter to the data buffer to return.\r | |
81 | \r | |
82 | @retval EFI_SUCCESS Successfully got volume Information.\r | |
83 | \r | |
84 | **/\r | |
85 | EFI_STATUS\r | |
86 | EFIAPI\r | |
87 | FvGetVolumeInfo (\r | |
88 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
89 | IN CONST EFI_GUID *InformationType,\r | |
90 | IN OUT UINTN *BufferSize,\r | |
91 | OUT VOID *Buffer\r | |
92 | )\r | |
93 | {\r | |
94 | return EFI_UNSUPPORTED;\r | |
95 | }\r | |
96 | \r | |
97 | /**\r | |
98 | Set information of type InformationType for the requested firmware\r | |
99 | volume.\r | |
100 | \r | |
101 | @param This Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r | |
102 | @param InformationType InformationType for requested.\r | |
103 | @param BufferSize On input, size of Buffer.On output, the amount of data\r | |
104 | returned in Buffer.\r | |
105 | @param Buffer A poniter to the data buffer to return.\r | |
106 | \r | |
107 | @retval EFI_SUCCESS Successfully set volume Information.\r | |
108 | \r | |
109 | **/\r | |
110 | EFI_STATUS\r | |
111 | EFIAPI\r | |
112 | FvSetVolumeInfo (\r | |
113 | IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r | |
114 | IN CONST EFI_GUID *InformationType,\r | |
115 | IN UINTN BufferSize,\r | |
116 | IN CONST VOID *Buffer\r | |
117 | )\r | |
118 | {\r | |
119 | return EFI_UNSUPPORTED;\r | |
120 | }\r |