diff options
author | Laszlo Ersek <lersek@redhat.com> | 2016-10-21 11:59:36 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2016-10-25 10:46:29 +0200 |
commit | 65ebe6e6c9789e36be6d1adb1105469a189f23ab (patch) | |
tree | cc4fbcb1ade3374dc237c688aff523c43a0d4887 /ArmVirtPkg/Library | |
parent | b78736bd29bca3f8c32351826a2eb20597742852 (diff) | |
download | edk2-65ebe6e6c9789e36be6d1adb1105469a189f23ab.tar.gz edk2-65ebe6e6c9789e36be6d1adb1105469a189f23ab.tar.bz2 edk2-65ebe6e6c9789e36be6d1adb1105469a189f23ab.zip |
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>
Diffstat (limited to 'ArmVirtPkg/Library')
-rw-r--r-- | ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c index 648806126e..dc1f5155f1 100644 --- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c +++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c @@ -41,6 +41,7 @@ ArmVirtGicArchLibConstructor ( UINTN GicRevision;
EFI_STATUS Status;
UINT64 DistBase, CpuBase, RedistBase;
+ RETURN_STATUS PcdStatus;
Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
(VOID **)&FdtClient);
@@ -85,8 +86,10 @@ ArmVirtGicArchLibConstructor ( RedistBase = SwapBytes64 (Reg[2]);
ASSERT (RedistBase < MAX_UINTN);
- PcdSet64 (PcdGicDistributorBase, DistBase);
- PcdSet64 (PcdGicRedistributorsBase, RedistBase);
+ PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);
+ 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",
DistBase, RedistBase));
@@ -120,8 +123,10 @@ ArmVirtGicArchLibConstructor ( ASSERT (DistBase < MAX_UINTN);
ASSERT (CpuBase < MAX_UINTN);
- PcdSet64 (PcdGicDistributorBase, DistBase);
- PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase);
+ PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);
+ 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));
|