]>
Commit | Line | Data |
---|---|---|
00663d04 LE |
1 | /** @file\r |
2 | Polymorphic functions that are called from both the privileged driver (i.e.,\r | |
3 | the DXE_SMM variable module) and the non-privileged drivers (i.e., one or\r | |
4 | both of the DXE_RUNTIME variable modules).\r | |
5 | \r | |
6 | Each of these functions has two implementations, appropriate for privileged\r | |
7 | vs. non-privileged driver code.\r | |
8 | \r | |
9 | Copyright (c) 2017, Red Hat, Inc.<BR>\r | |
e83d841f | 10 | Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r |
00663d04 LE |
11 | \r |
12 | This program and the accompanying materials are licensed and made available\r | |
13 | under the terms and conditions of the BSD License which accompanies this\r | |
14 | distribution. The full text of the license may be found at\r | |
15 | http://opensource.org/licenses/bsd-license.php\r | |
16 | \r | |
17 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r | |
18 | WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
19 | **/\r | |
20 | #ifndef _PRIVILEGE_POLYMORPHIC_H_\r | |
21 | #define _PRIVILEGE_POLYMORPHIC_H_\r | |
22 | \r | |
23 | #include <Uefi/UefiBaseType.h>\r | |
24 | \r | |
25 | /**\r | |
26 | SecureBoot Hook for auth variable update.\r | |
27 | \r | |
28 | @param[in] VariableName Name of Variable to be found.\r | |
29 | @param[in] VendorGuid Variable vendor GUID.\r | |
30 | **/\r | |
31 | VOID\r | |
32 | EFIAPI\r | |
33 | SecureBootHook (\r | |
34 | IN CHAR16 *VariableName,\r | |
35 | IN EFI_GUID *VendorGuid\r | |
36 | );\r | |
37 | \r | |
03877377 LE |
38 | /**\r |
39 | Initialization for MOR Control Lock.\r | |
40 | \r | |
41 | @retval EFI_SUCCESS MorLock initialization success.\r | |
42 | @return Others Some error occurs.\r | |
43 | **/\r | |
44 | EFI_STATUS\r | |
45 | MorLockInit (\r | |
46 | VOID\r | |
47 | );\r | |
48 | \r | |
f1304280 LE |
49 | /**\r |
50 | Delayed initialization for MOR Control Lock at EndOfDxe.\r | |
51 | \r | |
52 | This function performs any operations queued by MorLockInit().\r | |
53 | **/\r | |
54 | VOID\r | |
55 | MorLockInitAtEndOfDxe (\r | |
56 | VOID\r | |
57 | );\r | |
58 | \r | |
03877377 LE |
59 | /**\r |
60 | This service is an MOR/MorLock checker handler for the SetVariable().\r | |
61 | \r | |
62 | @param[in] VariableName the name of the vendor's variable, as a\r | |
63 | Null-Terminated Unicode String\r | |
64 | @param[in] VendorGuid Unify identifier for vendor.\r | |
65 | @param[in] Attributes Attributes bitmask to set for the variable.\r | |
66 | @param[in] DataSize The size in bytes of Data-Buffer.\r | |
67 | @param[in] Data Point to the content of the variable.\r | |
68 | \r | |
69 | @retval EFI_SUCCESS The MOR/MorLock check pass, and Variable\r | |
70 | driver can store the variable data.\r | |
71 | @retval EFI_INVALID_PARAMETER The MOR/MorLock data or data size or\r | |
72 | attributes is not allowed for MOR variable.\r | |
73 | @retval EFI_ACCESS_DENIED The MOR/MorLock is locked.\r | |
74 | @retval EFI_ALREADY_STARTED The MorLock variable is handled inside this\r | |
75 | function. Variable driver can just return\r | |
76 | EFI_SUCCESS.\r | |
77 | **/\r | |
78 | EFI_STATUS\r | |
79 | SetVariableCheckHandlerMor (\r | |
80 | IN CHAR16 *VariableName,\r | |
81 | IN EFI_GUID *VendorGuid,\r | |
82 | IN UINT32 Attributes,\r | |
83 | IN UINTN DataSize,\r | |
84 | IN VOID *Data\r | |
85 | );\r | |
86 | \r | |
e83d841f | 87 | /**\r |
49395ea0 HW |
88 | This service is consumed by the variable modules to place a barrier to stop\r |
89 | speculative execution.\r | |
90 | \r | |
91 | Ensures that no later instruction will execute speculatively, until all prior\r | |
92 | instructions have completed.\r | |
e83d841f HW |
93 | \r |
94 | **/\r | |
95 | VOID\r | |
49395ea0 | 96 | VariableSpeculationBarrier (\r |
e83d841f HW |
97 | VOID\r |
98 | );\r | |
99 | \r | |
a855f63e | 100 | /**\r |
44289eea | 101 | Notify the system that the SMM variable driver is ready.\r |
a855f63e AB |
102 | **/\r |
103 | VOID\r | |
104 | VariableNotifySmmReady (\r | |
105 | VOID\r | |
106 | );\r | |
107 | \r | |
108 | /**\r | |
44289eea | 109 | Notify the system that the SMM variable write driver is ready.\r |
a855f63e AB |
110 | **/\r |
111 | VOID\r | |
112 | VariableNotifySmmWriteReady (\r | |
113 | VOID\r | |
114 | );\r | |
115 | \r | |
116 | /**\r | |
117 | Variable Driver main entry point. The Variable driver places the 4 EFI\r | |
118 | runtime services in the EFI System Table and installs arch protocols\r | |
119 | for variable read and write services being available. It also registers\r | |
120 | a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r | |
121 | \r | |
122 | @retval EFI_SUCCESS Variable service successfully initialized.\r | |
123 | **/\r | |
124 | EFI_STATUS\r | |
125 | EFIAPI\r | |
126 | MmVariableServiceInitialize (\r | |
127 | VOID\r | |
128 | );\r | |
129 | \r | |
130 | /**\r | |
131 | This function checks if the buffer is valid per processor architecture and\r | |
132 | does not overlap with SMRAM.\r | |
133 | \r | |
134 | @param Buffer The buffer start address to be checked.\r | |
135 | @param Length The buffer length to be checked.\r | |
136 | \r | |
137 | @retval TRUE This buffer is valid per processor architecture and does not\r | |
138 | overlap with SMRAM.\r | |
139 | @retval FALSE This buffer is not valid per processor architecture or overlaps\r | |
140 | with SMRAM.\r | |
141 | **/\r | |
142 | BOOLEAN\r | |
143 | VariableSmmIsBufferOutsideSmmValid (\r | |
144 | IN EFI_PHYSICAL_ADDRESS Buffer,\r | |
145 | IN UINT64 Length\r | |
146 | );\r | |
147 | \r | |
148 | /**\r | |
149 | Whether the TCG or TCG2 protocols are installed in the UEFI protocol database.\r | |
150 | This information is used by the MorLock code to infer whether an existing\r | |
151 | MOR variable is legitimate or not.\r | |
152 | \r | |
153 | @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI\r | |
154 | protocol database\r | |
155 | @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI\r | |
156 | protocol database\r | |
157 | **/\r | |
158 | BOOLEAN\r | |
159 | VariableHaveTcgProtocols (\r | |
160 | VOID\r | |
161 | );\r | |
162 | \r | |
00663d04 | 163 | #endif\r |