mirror of https://github.com/acidanthera/audk.git
ArmVirtPkg/ArmVirtGicArchLib: eliminate unchecked PcdSetXX() calls
These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=165 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # RVCT Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
b78736bd29
commit
65ebe6e6c9
|
@ -41,6 +41,7 @@ ArmVirtGicArchLibConstructor (
|
||||||
UINTN GicRevision;
|
UINTN GicRevision;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT64 DistBase, CpuBase, RedistBase;
|
UINT64 DistBase, CpuBase, RedistBase;
|
||||||
|
RETURN_STATUS PcdStatus;
|
||||||
|
|
||||||
Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
|
Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
|
||||||
(VOID **)&FdtClient);
|
(VOID **)&FdtClient);
|
||||||
|
@ -85,8 +86,10 @@ ArmVirtGicArchLibConstructor (
|
||||||
RedistBase = SwapBytes64 (Reg[2]);
|
RedistBase = SwapBytes64 (Reg[2]);
|
||||||
ASSERT (RedistBase < MAX_UINTN);
|
ASSERT (RedistBase < MAX_UINTN);
|
||||||
|
|
||||||
PcdSet64 (PcdGicDistributorBase, DistBase);
|
PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);
|
||||||
PcdSet64 (PcdGicRedistributorsBase, RedistBase);
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
PcdStatus = PcdSet64S (PcdGicRedistributorsBase, RedistBase);
|
||||||
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",
|
DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",
|
||||||
DistBase, RedistBase));
|
DistBase, RedistBase));
|
||||||
|
@ -120,8 +123,10 @@ ArmVirtGicArchLibConstructor (
|
||||||
ASSERT (DistBase < MAX_UINTN);
|
ASSERT (DistBase < MAX_UINTN);
|
||||||
ASSERT (CpuBase < MAX_UINTN);
|
ASSERT (CpuBase < MAX_UINTN);
|
||||||
|
|
||||||
PcdSet64 (PcdGicDistributorBase, DistBase);
|
PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);
|
||||||
PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase);
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
PcdStatus = PcdSet64S (PcdGicInterruptInterfaceBase, CpuBase);
|
||||||
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));
|
DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue