]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/WorkArea.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / WorkArea.h
1 /** @file
2
3 Work Area structure definition
4
5 Copyright (c) 2021, AMD Inc.
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8 **/
9
10 #ifndef __OVMF_WORK_AREA_H__
11 #define __OVMF_WORK_AREA_H__
12
13 //
14 // Guest type for the work area
15 //
16 typedef enum {
17 GUEST_TYPE_NON_ENCRYPTED,
18 GUEST_TYPE_AMD_SEV,
19 GUEST_TYPE_INTEL_TDX,
20 } GUEST_TYPE;
21
22 //
23 // Confidential computing work area header definition. Any change
24 // to the structure need to be kept in sync with the
25 // PcdOvmfConfidentialComputingWorkAreaHeader.
26 //
27 // PcdOvmfConfidentialComputingWorkAreaHeader ==
28 // sizeof (CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER)
29 // PcdOvmfConfidentialComputingWorkAreaHeader defined in:
30 // OvmfPkg/OvmfPkg.dec
31 // OvmfPkg/OvmfPkgDefines.fdf.inc
32 typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER {
33 UINT8 GuestType;
34 UINT8 Reserved1[3];
35 } CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER;
36
37 //
38 // Internal structure for holding SEV-ES information needed during SEC phase
39 // and valid only during SEC phase and early PEI during platform
40 // initialization.
41 //
42 // This structure is also used by assembler files:
43 // OvmfPkg/ResetVector/ResetVector.nasmb
44 // OvmfPkg/ResetVector/Ia32/PageTables64.asm
45 // OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
46 // any changes must stay in sync with its usage.
47 //
48 typedef struct _SEC_SEV_ES_WORK_AREA {
49 UINT8 SevEsEnabled;
50 UINT8 Reserved1[7];
51
52 UINT64 RandomData;
53
54 UINT64 EncryptionMask;
55 } SEC_SEV_ES_WORK_AREA;
56
57 //
58 // The SEV work area definition.
59 //
60 typedef struct _SEV_WORK_AREA {
61 CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
62
63 SEC_SEV_ES_WORK_AREA SevEsWorkArea;
64 } SEV_WORK_AREA;
65
66 typedef union {
67 CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
68 SEV_WORK_AREA SevWorkArea;
69 } OVMF_WORK_AREA;
70
71 #endif