summaryrefslogtreecommitdiff
path: root/ArmPkg/Library
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2015-02-02 12:01:38 +0000
committerlersek <lersek@Edk2>2015-02-02 12:01:38 +0000
commitb36bc5af5854c3cd8b500e189366f1402ac30100 (patch)
treecd565b16f1d093dfa6407d12a0780e57924e8935 /ArmPkg/Library
parent074a67fc808cbd7b0259b71304a2d5b45ecb9a75 (diff)
downloadedk2-platforms-b36bc5af5854c3cd8b500e189366f1402ac30100.tar.xz
ArmPkg: ArmArchTimerLib: use edk2-conformant (UINT64 * UINT32) / UINT32
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16690 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r--ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
index fb010a8e4a..51d7ce998f 100644
--- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
+++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
@@ -96,7 +96,13 @@ MicroSecondDelay (
// Calculate counter ticks that can represent requested delay:
// = MicroSeconds x TICKS_PER_MICRO_SEC
// = MicroSeconds x Frequency.10^-6
- TimerTicks64 = ((UINT64)MicroSeconds * PcdGet32 (PcdArmArchTimerFreqInHz)) / 1000000U;
+ TimerTicks64 = DivU64x32 (
+ MultU64x32 (
+ MicroSeconds,
+ PcdGet32 (PcdArmArchTimerFreqInHz)
+ ),
+ 1000000U
+ );
// Read System Counter value
SystemCounterVal = ArmGenericTimerGetSystemCount ();