]>
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 | 11 | \r |
9d510e61 | 12 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
00663d04 | 13 | **/\r |
1436aea4 | 14 | \r |
00663d04 LE |
15 | #ifndef _PRIVILEGE_POLYMORPHIC_H_\r |
16 | #define _PRIVILEGE_POLYMORPHIC_H_\r | |
17 | \r | |
18 | #include <Uefi/UefiBaseType.h>\r | |
19 | \r | |
20 | /**\r | |
21 | SecureBoot Hook for auth variable update.\r | |
22 | \r | |
23 | @param[in] VariableName Name of Variable to be found.\r | |
24 | @param[in] VendorGuid Variable vendor GUID.\r | |
25 | **/\r | |
26 | VOID\r | |
27 | EFIAPI\r | |
28 | SecureBootHook (\r | |
1436aea4 MK |
29 | IN CHAR16 *VariableName,\r |
30 | IN EFI_GUID *VendorGuid\r | |
00663d04 LE |
31 | );\r |
32 | \r | |
03877377 LE |
33 | /**\r |
34 | Initialization for MOR Control Lock.\r | |
35 | \r | |
36 | @retval EFI_SUCCESS MorLock initialization success.\r | |
37 | @return Others Some error occurs.\r | |
38 | **/\r | |
39 | EFI_STATUS\r | |
40 | MorLockInit (\r | |
41 | VOID\r | |
42 | );\r | |
43 | \r | |
f1304280 LE |
44 | /**\r |
45 | Delayed initialization for MOR Control Lock at EndOfDxe.\r | |
46 | \r | |
47 | This function performs any operations queued by MorLockInit().\r | |
48 | **/\r | |
49 | VOID\r | |
50 | MorLockInitAtEndOfDxe (\r | |
51 | VOID\r | |
52 | );\r | |
53 | \r | |
03877377 LE |
54 | /**\r |
55 | This service is an MOR/MorLock checker handler for the SetVariable().\r | |
56 | \r | |
57 | @param[in] VariableName the name of the vendor's variable, as a\r | |
58 | Null-Terminated Unicode String\r | |
59 | @param[in] VendorGuid Unify identifier for vendor.\r | |
60 | @param[in] Attributes Attributes bitmask to set for the variable.\r | |
61 | @param[in] DataSize The size in bytes of Data-Buffer.\r | |
62 | @param[in] Data Point to the content of the variable.\r | |
63 | \r | |
64 | @retval EFI_SUCCESS The MOR/MorLock check pass, and Variable\r | |
65 | driver can store the variable data.\r | |
66 | @retval EFI_INVALID_PARAMETER The MOR/MorLock data or data size or\r | |
67 | attributes is not allowed for MOR variable.\r | |
68 | @retval EFI_ACCESS_DENIED The MOR/MorLock is locked.\r | |
69 | @retval EFI_ALREADY_STARTED The MorLock variable is handled inside this\r | |
70 | function. Variable driver can just return\r | |
71 | EFI_SUCCESS.\r | |
72 | **/\r | |
73 | EFI_STATUS\r | |
74 | SetVariableCheckHandlerMor (\r | |
1436aea4 MK |
75 | IN CHAR16 *VariableName,\r |
76 | IN EFI_GUID *VendorGuid,\r | |
77 | IN UINT32 Attributes,\r | |
78 | IN UINTN DataSize,\r | |
79 | IN VOID *Data\r | |
03877377 LE |
80 | );\r |
81 | \r | |
e83d841f | 82 | /**\r |
49395ea0 HW |
83 | This service is consumed by the variable modules to place a barrier to stop\r |
84 | speculative execution.\r | |
85 | \r | |
86 | Ensures that no later instruction will execute speculatively, until all prior\r | |
87 | instructions have completed.\r | |
e83d841f HW |
88 | \r |
89 | **/\r | |
90 | VOID\r | |
49395ea0 | 91 | VariableSpeculationBarrier (\r |
e83d841f HW |
92 | VOID\r |
93 | );\r | |
94 | \r | |
a855f63e | 95 | /**\r |
44289eea | 96 | Notify the system that the SMM variable driver is ready.\r |
a855f63e AB |
97 | **/\r |
98 | VOID\r | |
99 | VariableNotifySmmReady (\r | |
100 | VOID\r | |
101 | );\r | |
102 | \r | |
103 | /**\r | |
44289eea | 104 | Notify the system that the SMM variable write driver is ready.\r |
a855f63e AB |
105 | **/\r |
106 | VOID\r | |
107 | VariableNotifySmmWriteReady (\r | |
108 | VOID\r | |
109 | );\r | |
110 | \r | |
111 | /**\r | |
112 | Variable Driver main entry point. The Variable driver places the 4 EFI\r | |
113 | runtime services in the EFI System Table and installs arch protocols\r | |
114 | for variable read and write services being available. It also registers\r | |
115 | a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r | |
116 | \r | |
117 | @retval EFI_SUCCESS Variable service successfully initialized.\r | |
118 | **/\r | |
119 | EFI_STATUS\r | |
120 | EFIAPI\r | |
121 | MmVariableServiceInitialize (\r | |
122 | VOID\r | |
123 | );\r | |
124 | \r | |
125 | /**\r | |
126 | This function checks if the buffer is valid per processor architecture and\r | |
127 | does not overlap with SMRAM.\r | |
128 | \r | |
129 | @param Buffer The buffer start address to be checked.\r | |
130 | @param Length The buffer length to be checked.\r | |
131 | \r | |
132 | @retval TRUE This buffer is valid per processor architecture and does not\r | |
133 | overlap with SMRAM.\r | |
134 | @retval FALSE This buffer is not valid per processor architecture or overlaps\r | |
135 | with SMRAM.\r | |
136 | **/\r | |
137 | BOOLEAN\r | |
138 | VariableSmmIsBufferOutsideSmmValid (\r | |
139 | IN EFI_PHYSICAL_ADDRESS Buffer,\r | |
140 | IN UINT64 Length\r | |
141 | );\r | |
142 | \r | |
143 | /**\r | |
144 | Whether the TCG or TCG2 protocols are installed in the UEFI protocol database.\r | |
145 | This information is used by the MorLock code to infer whether an existing\r | |
146 | MOR variable is legitimate or not.\r | |
147 | \r | |
148 | @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI\r | |
149 | protocol database\r | |
150 | @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI\r | |
151 | protocol database\r | |
152 | **/\r | |
153 | BOOLEAN\r | |
154 | VariableHaveTcgProtocols (\r | |
155 | VOID\r | |
156 | );\r | |
157 | \r | |
00663d04 | 158 | #endif\r |