]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h
MdeModulePkg/Variable/RuntimeDxe: move MOR func. declarations to header
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / PrivilegePolymorphic.h
1 /** @file
2 Polymorphic functions that are called from both the privileged driver (i.e.,
3 the DXE_SMM variable module) and the non-privileged drivers (i.e., one or
4 both of the DXE_RUNTIME variable modules).
5
6 Each of these functions has two implementations, appropriate for privileged
7 vs. non-privileged driver code.
8
9 Copyright (c) 2017, Red Hat, Inc.<BR>
10 Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
11
12 This program and the accompanying materials are licensed and made available
13 under the terms and conditions of the BSD License which accompanies this
14 distribution. The full text of the license may be found at
15 http://opensource.org/licenses/bsd-license.php
16
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
18 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 **/
20 #ifndef _PRIVILEGE_POLYMORPHIC_H_
21 #define _PRIVILEGE_POLYMORPHIC_H_
22
23 #include <Uefi/UefiBaseType.h>
24
25 /**
26 SecureBoot Hook for auth variable update.
27
28 @param[in] VariableName Name of Variable to be found.
29 @param[in] VendorGuid Variable vendor GUID.
30 **/
31 VOID
32 EFIAPI
33 SecureBootHook (
34 IN CHAR16 *VariableName,
35 IN EFI_GUID *VendorGuid
36 );
37
38 /**
39 Initialization for MOR Control Lock.
40
41 @retval EFI_SUCCESS MorLock initialization success.
42 @return Others Some error occurs.
43 **/
44 EFI_STATUS
45 MorLockInit (
46 VOID
47 );
48
49 /**
50 This service is an MOR/MorLock checker handler for the SetVariable().
51
52 @param[in] VariableName the name of the vendor's variable, as a
53 Null-Terminated Unicode String
54 @param[in] VendorGuid Unify identifier for vendor.
55 @param[in] Attributes Attributes bitmask to set for the variable.
56 @param[in] DataSize The size in bytes of Data-Buffer.
57 @param[in] Data Point to the content of the variable.
58
59 @retval EFI_SUCCESS The MOR/MorLock check pass, and Variable
60 driver can store the variable data.
61 @retval EFI_INVALID_PARAMETER The MOR/MorLock data or data size or
62 attributes is not allowed for MOR variable.
63 @retval EFI_ACCESS_DENIED The MOR/MorLock is locked.
64 @retval EFI_ALREADY_STARTED The MorLock variable is handled inside this
65 function. Variable driver can just return
66 EFI_SUCCESS.
67 **/
68 EFI_STATUS
69 SetVariableCheckHandlerMor (
70 IN CHAR16 *VariableName,
71 IN EFI_GUID *VendorGuid,
72 IN UINT32 Attributes,
73 IN UINTN DataSize,
74 IN VOID *Data
75 );
76
77 #endif