OvmfPkg/MemEncryptSevLib: clean up MemEncryptSevClearPageEncMask() decl
[mirror_edk2.git] / OvmfPkg / Include / Library / MemEncryptSevLib.h
CommitLineData
a1f22614
BS
1/** @file\r
2\r
3 Define Secure Encrypted Virtualization (SEV) base library helper function\r
4\r
5 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
6\r
7 This program and the accompanying materials are licensed and made available\r
8 under the terms and conditions of the BSD License which accompanies this\r
9 distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#ifndef _MEM_ENCRYPT_SEV_LIB_H_\r
18#define _MEM_ENCRYPT_SEV_LIB_H_\r
19\r
20#include <Base.h>\r
21\r
22/**\r
23 Returns a boolean to indicate whether SEV is enabled\r
24\r
d4dd22c7 25 @retval TRUE SEV is enabled\r
a1f22614 26 @retval FALSE SEV is not enabled\r
d4dd22c7 27**/\r
a1f22614
BS
28BOOLEAN\r
29EFIAPI\r
30MemEncryptSevIsEnabled (\r
31 VOID\r
32 );\r
33\r
34/**\r
5b5028e6
LE
35 This function clears memory encryption bit for the memory region specified by\r
36 BaseAddress and NumPages from the current page table context.\r
37\r
38 @param[in] Cr3BaseAddress Cr3 Base Address (if zero then use\r
39 current CR3)\r
40 @param[in] BaseAddress The physical address that is the start\r
41 address of a memory region.\r
42 @param[in] NumPages The number of pages from start memory\r
43 region.\r
44 @param[in] Flush Flush the caches before clearing the bit\r
45 (mostly TRUE except MMIO addresses)\r
46\r
47 @retval RETURN_SUCCESS The attributes were cleared for the\r
48 memory region.\r
49 @retval RETURN_INVALID_PARAMETER Number of pages is zero.\r
50 @retval RETURN_UNSUPPORTED Clearing the memory encryption attribute\r
51 is not supported\r
52**/\r
a1f22614
BS
53RETURN_STATUS\r
54EFIAPI\r
55MemEncryptSevClearPageEncMask (\r
56 IN PHYSICAL_ADDRESS Cr3BaseAddress,\r
57 IN PHYSICAL_ADDRESS BaseAddress,\r
5b5028e6
LE
58 IN UINTN NumPages,\r
59 IN BOOLEAN Flush\r
a1f22614
BS
60 );\r
61\r
62/**\r
63 This function sets memory encryption bit for the memory region specified by\r
64 BaseAddress and Number of pages from the current page table context.\r
65\r
4bd6bf31
LE
66 @param[in] BaseAddress The physical address that is the start\r
67 address of a memory region.\r
68 @param[in] NumberOfPages The number of pages from start memory\r
69 region.\r
a1f22614
BS
70 @param[in] Flush Flush the caches before clearing the bit\r
71 (mostly TRUE except MMIO addresses)\r
72\r
4bd6bf31
LE
73 @retval RETURN_SUCCESS The attributes were set for the memory\r
74 region.\r
a1f22614
BS
75 @retval RETURN_INVALID_PARAMETER Number of pages is zero.\r
76 @retval RETURN_UNSUPPORTED Clearing memory encryption attribute is not\r
77 supported\r
78 **/\r
79RETURN_STATUS\r
80EFIAPI\r
81MemEncryptSevSetPageEncMask (\r
82 IN PHYSICAL_ADDRESS Cr3BaseAddress,\r
83 IN PHYSICAL_ADDRESS BaseAddress,\r
84 IN UINTN NumberOfPages,\r
85 IN BOOLEAN CacheFlush\r
86 );\r
87#endif // _MEM_ENCRYPT_SEV_LIB_H_\r