summaryrefslogtreecommitdiff
path: root/source/components/hardware
diff options
context:
space:
mode:
authoraystarik <aystarik>2005-06-29 16:58:53 +0000
committeraystarik <aystarik>2005-06-29 16:58:53 +0000
commitff2347c12f17ab9523ebf85318ebef5bb7ef2a40 (patch)
tree2fbd8a5d5ddab8eca9ffd61377adaa527a9772f4 /source/components/hardware
parenta99188fe19ce4ea8ed66a1d0d766b819c4154caf (diff)
downloadacpica-ff2347c12f17ab9523ebf85318ebef5bb7ef2a40.tar.gz
New divide interface
date 2004.10.05.22.51.00; author rmoore1; state Exp;
Diffstat (limited to 'source/components/hardware')
-rw-r--r--source/components/hardware/hwtimer.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/source/components/hardware/hwtimer.c b/source/components/hardware/hwtimer.c
index e8da8f164..f98462ccc 100644
--- a/source/components/hardware/hwtimer.c
+++ b/source/components/hardware/hwtimer.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwtimer.c - ACPI Power Management Timer Interface
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
*****************************************************************************/
@@ -226,10 +226,9 @@ AcpiGetTimerDuration (
UINT32 EndTicks,
UINT32 *TimeElapsed)
{
- UINT32 DeltaTicks = 0;
- UINT64_OVERLAY NormalizedTicks;
ACPI_STATUS Status;
- ACPI_INTEGER OutQuotient;
+ UINT32 DeltaTicks;
+ ACPI_INTEGER Quotient;
ACPI_FUNCTION_TRACE ("AcpiGetTimerDuration");
@@ -242,7 +241,7 @@ AcpiGetTimerDuration (
/*
* Compute Tick Delta:
- * Handle (max one) timer rollovers on 24- versus 32-bit timers.
+ * Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
*/
if (StartTicks < EndTicks)
{
@@ -263,23 +262,21 @@ AcpiGetTimerDuration (
DeltaTicks = (0xFFFFFFFF - StartTicks) + EndTicks;
}
}
- else
+ else /* StartTicks == EndTicks */
{
*TimeElapsed = 0;
return_ACPI_STATUS (AE_OK);
}
/*
- * Compute Duration (Requires a 64-bit divide):
+ * Compute Duration (Requires a 64-bit multiply and divide):
*
* TimeElapsed = (DeltaTicks * 1000000) / PM_TIMER_FREQUENCY;
*/
- NormalizedTicks.Full = ((UINT64) DeltaTicks) * 1000000;
-
- Status = AcpiUtShortDivide (&NormalizedTicks.Full, PM_TIMER_FREQUENCY,
- &OutQuotient, NULL);
+ Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * 1000000,
+ PM_TIMER_FREQUENCY, &Quotient, NULL);
- *TimeElapsed = (UINT32) OutQuotient;
+ *TimeElapsed = (UINT32) Quotient;
return_ACPI_STATUS (Status);
}