2 RISC-V specific functionality for DxeLoad.
4 Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
13 Transfers control to DxeCore.
15 This function performs a CPU architecture specific operations to execute
16 the entry point of DxeCore with the parameters of HobList.
17 It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
19 @param DxeCoreEntryPoint The entry point of DxeCore.
20 @param HobList The start of HobList passed to DxeCore.
25 IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint
,
26 IN EFI_PEI_HOB_POINTERS HobList
35 // Allocate 128KB for the Stack
37 BaseOfStack
= AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE
));
38 if (BaseOfStack
== NULL
) {
39 DEBUG ((DEBUG_ERROR
, "%a: Can't allocate memory for stack.", __FUNCTION__
));
44 // Compute the top of the stack we were allocated. Pre-allocate a UINTN
47 TopOfStack
= (VOID
*)((UINTN
)BaseOfStack
+ EFI_SIZE_TO_PAGES (STACK_SIZE
) * EFI_PAGE_SIZE
- CPU_STACK_ALIGNMENT
);
48 TopOfStack
= ALIGN_POINTER (TopOfStack
, CPU_STACK_ALIGNMENT
);
51 // End of PEI phase signal
53 Status
= PeiServicesInstallPpi (&gEndOfPeiSignalPpi
);
54 if (EFI_ERROR (Status
)) {
55 DEBUG ((DEBUG_ERROR
, "%a: Fail to signal End of PEI event.", __FUNCTION__
));
60 // Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.
62 UpdateStackHob ((EFI_PHYSICAL_ADDRESS
)(UINTN
)BaseOfStack
, STACK_SIZE
);
64 DEBUG ((DEBUG_INFO
, "DXE Core new stack at %x, stack pointer at %x\n", BaseOfStack
, TopOfStack
));
67 // Transfer the control to the entry point of DxeCore.
70 (SWITCH_STACK_ENTRY_POINT
)(UINTN
)DxeCoreEntryPoint
,