]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h
OvmfPkg/QemuFwCfgLib: Prepare for SEV support
[mirror_edk2.git] / OvmfPkg / Library / QemuFwCfgLib / QemuFwCfgLibInternal.h
1 /** @file
2 Internal interfaces specific to the QemuFwCfgLib instances in OvmfPkg.
3
4 Copyright (C) 2016, Red Hat, Inc.
5 Copyright (C) 2017, Advanced Micro Devices. All rights reserved
6
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef __QEMU_FW_CFG_LIB_INTERNAL_H__
18 #define __QEMU_FW_CFG_LIB_INTERNAL_H__
19
20 /**
21 Returns a boolean indicating if the firmware configuration interface is
22 available for library-internal purposes.
23
24 This function never changes fw_cfg state.
25
26 @retval TRUE The interface is available internally.
27 @retval FALSE The interface is not available internally.
28 **/
29 BOOLEAN
30 InternalQemuFwCfgIsAvailable (
31 VOID
32 );
33
34
35 /**
36 Returns a boolean indicating whether QEMU provides the DMA-like access method
37 for fw_cfg.
38
39 @retval TRUE The DMA-like access method is available.
40 @retval FALSE The DMA-like access method is unavailable.
41 **/
42 BOOLEAN
43 InternalQemuFwCfgDmaIsAvailable (
44 VOID
45 );
46
47 /**
48 Returns a boolean indicating whether SEV support is enabled
49
50 @retval TRUE SEV is enabled
51 @retval FALSE SEV is disabled
52 **/
53 BOOLEAN
54 InternalQemuFwCfgSevIsEnabled (
55 VOID
56 );
57
58 /**
59 Allocate a bounce buffer for SEV DMA.
60
61 @param[out] Buffer Allocated DMA Buffer pointer
62 @param[in] NumPage Number of pages.
63
64 **/
65 VOID
66 InternalQemuFwCfgSevDmaAllocateBuffer (
67 OUT VOID **Buffer,
68 IN UINT32 NumPages
69 );
70
71 /**
72 Free the DMA buffer allocated using InternalQemuFwCfgSevDmaAllocateBuffer
73
74 @param[in] NumPage Number of pages.
75 @param[in] Buffer DMA Buffer pointer
76
77 **/
78 VOID
79 InternalQemuFwCfgSevDmaFreeBuffer (
80 IN VOID *Buffer,
81 IN UINT32 NumPages
82 );
83 #endif