mirror of
				https://gitlab.com/qemu-project/edk2.git
				synced 2025-10-30 07:56:39 +08:00 
			
		
		
		
	UefiCpuPkg/CpuDxeRiscV64: Retrieve booting info from SEC HOB data
The booting info is now stored in SEC HOB GUID data. Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
This commit is contained in:
		| @ -331,19 +331,17 @@ InitializeCpu ( | ||||
|   IN EFI_SYSTEM_TABLE  *SystemTable | ||||
|   ) | ||||
| { | ||||
|   EFI_STATUS                  Status; | ||||
|   EFI_RISCV_FIRMWARE_CONTEXT  *FirmwareContext; | ||||
|   EFI_STATUS              Status; | ||||
|   VOID                    *Hob; | ||||
|   RISCV_SEC_HANDOFF_DATA  *SecData; | ||||
|   const EFI_GUID          SecHobDataGuid = RISCV_SEC_HANDOFF_HOB_GUID; | ||||
|  | ||||
|   GetFirmwareContextPointer (&FirmwareContext); | ||||
|   ASSERT (FirmwareContext != NULL); | ||||
|   if (FirmwareContext == NULL) { | ||||
|     DEBUG ((DEBUG_ERROR, "Failed to get the pointer of EFI_RISCV_FIRMWARE_CONTEXT\n")); | ||||
|     return EFI_NOT_FOUND; | ||||
|   } | ||||
|   Hob = GetFirstGuidHob (&SecHobDataGuid); | ||||
|   ASSERT (Hob != NULL); | ||||
|  | ||||
|   DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __func__, FirmwareContext)); | ||||
|   SecData     = GET_GUID_HOB_DATA (Hob); | ||||
|   mBootHartId = SecData->BootHartId; | ||||
|  | ||||
|   mBootHartId = FirmwareContext->BootHartId; | ||||
|   DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __func__, mBootHartId)); | ||||
|  | ||||
|   InitializeCpuExceptionHandlers (NULL); | ||||
|  | ||||
| @ -12,6 +12,7 @@ | ||||
|  | ||||
| #include <PiDxe.h> | ||||
|  | ||||
| #include <Guid/RiscVSecHobData.h> | ||||
| #include <Protocol/Cpu.h> | ||||
| #include <Protocol/RiscVBootProtocol.h> | ||||
| #include <Library/BaseRiscVSbiLib.h> | ||||
| @ -22,6 +23,7 @@ | ||||
| #include <Library/CpuExceptionHandlerLib.h> | ||||
| #include <Library/CpuLib.h> | ||||
| #include <Library/DebugLib.h> | ||||
| #include <Library/HobLib.h> | ||||
| #include <Library/UefiBootServicesTableLib.h> | ||||
| #include <Library/UefiDriverEntryPoint.h> | ||||
| #include <Register/RiscV64/RiscVEncoding.h> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Tuan Phan
					Tuan Phan