]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase
[mirror_edk2.git] / OvmfPkg / IntelTdx / PrePiHobListPointerLibTdx / PrePiHobListPointer.c
1 /** @file
2 *
3 * Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
4 * SPDX-License-Identifier: BSD-2-Clause-Patent
5 *
6 **/
7
8 #include <PiPei.h>
9 #include <Library/PrePiHobListPointerLib.h>
10 #include <Library/DebugLib.h>
11 #include <Library/HobLib.h>
12 #include <WorkArea.h>
13
14 /**
15 Returns the pointer to the HOB list.
16
17 This function returns the pointer to first HOB in the list.
18
19 @return The pointer to the HOB list.
20
21 **/
22 VOID *
23 EFIAPI
24 PrePeiGetHobList (
25 VOID
26 )
27 {
28 TDX_WORK_AREA *TdxWorkArea;
29
30 TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaBase);
31 ASSERT (TdxWorkArea != NULL);
32 ASSERT (TdxWorkArea->SecTdxWorkArea.HobList != 0);
33
34 return (VOID *)(UINTN)TdxWorkArea->SecTdxWorkArea.HobList;
35 }
36
37 /**
38 Updates the pointer to the HOB list.
39
40 @param HobList Hob list pointer to store
41
42 **/
43 EFI_STATUS
44 EFIAPI
45 PrePeiSetHobList (
46 IN VOID *HobList
47 )
48 {
49 TDX_WORK_AREA *TdxWorkArea;
50
51 TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaBase);
52 ASSERT (TdxWorkArea != NULL);
53
54 TdxWorkArea->SecTdxWorkArea.HobList = (UINTN)HobList;
55
56 return EFI_SUCCESS;
57 }