Skip to content

Commit

Permalink
Ring3: Fixed Uart bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Krichanov committed Sep 26, 2024
1 parent 760614b commit 88d942e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions ArmVirtPkg/Library/DebugLibFdtPL011Uart/User.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ DebugLibFdtPL011UartUserConstructor (
for (Index = 0; Index < SystemTable->NumberOfTableEntries; ++Index) {
if (CompareGuid (&gEarlyPL011BaseAddressGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {
mDebugLibFdtPL011UartAddress = (UINTN)SystemTable->ConfigurationTable[Index].VendorTable;
return EFI_SUCCESS;
}
}

return EFI_NOT_FOUND;
return EFI_SUCCESS;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions MdeModulePkg/Core/Dxe/SysCall/Initialization.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ InitializeRing3 (
UINTN Index;
EFI_CONFIGURATION_TABLE *Conf;
EARLY_PL011_BASE_ADDRESS *UartBase;
CONST VOID *Hob;

//
// Set Ring3 EntryPoint and BootServices.
Expand Down Expand Up @@ -77,19 +78,18 @@ InitializeRing3 (

Conf->VendorTable = gRing3Data->SystemTable.ConfigurationTable[Index].VendorTable;

if (CompareGuid (&gEfiHobListGuid, &(Conf->VendorGuid))) {
UartBase = GET_GUID_HOB_DATA (Conf->VendorTable);
gUartBaseAddress = (UINTN)UartBase->DebugAddress;
}

++Conf;
}

Hob = GetFirstGuidHob (&gEarlyPL011BaseAddressGuid);
UartBase = GET_GUID_HOB_DATA (Hob);
gUartBaseAddress = (UINTN)UartBase->DebugAddress;

CopyGuid (&(Conf->VendorGuid), &gEarlyPL011BaseAddressGuid);
Conf->VendorTable = (VOID *)gUartBaseAddress;
++gRing3Data->SystemTable.NumberOfTableEntries;

DEBUG ((DEBUG_ERROR, "Core: gUartBaseAddress = %p\n", gUartBaseAddress));
DEBUG ((DEBUG_ERROR, "Core: gUartBaseAddress = 0x%p\n", gUartBaseAddress));

gRing3Data->SystemTable.ConfigurationTable = (EFI_CONFIGURATION_TABLE *)(UINTN)Physical;
}
Expand Down

0 comments on commit 88d942e

Please sign in to comment.