Changed TODOs to TBDs

date	2001.04.26.18.14.00;	author psdiefen;	state Exp;
This commit is contained in:
aystarik 2005-06-29 16:58:26 +00:00
parent f674bdc7d3
commit cc934c8964

View File

@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Name: hwtimer.c - ACPI Power Management Timer Interface * Name: hwtimer.c - ACPI Power Management Timer Interface
* $Revision: 1.5 $ * $Revision: 1.8 $
* *
*****************************************************************************/ *****************************************************************************/
@ -118,7 +118,7 @@
#include "acpi.h" #include "acpi.h"
#include "achware.h" #include "achware.h"
#define _COMPONENT HARDWARE #define _COMPONENT ACPI_HARDWARE
MODULE_NAME ("hwtimer") MODULE_NAME ("hwtimer")
@ -195,20 +195,20 @@ AcpiGetTimer (
* EndTicks * EndTicks
* TimeElapsed * TimeElapsed
* *
* RETURN: TimeElapsed * RETURN: TimeElapsed
* *
* DESCRIPTION: Computes the time elapsed (in microseconds) between two * DESCRIPTION: Computes the time elapsed (in microseconds) between two
* PM Timer time stamps, taking into account the possibility of * PM Timer time stamps, taking into account the possibility of
* rollovers, the timer resolution, and timer frequency. * rollovers, the timer resolution, and timer frequency.
* *
* The PM Timer's clock ticks at roughly 3.6 times per * The PM Timer's clock ticks at roughly 3.6 times per
* _microsecond_, and its clock continues through Cx state * _microsecond_, and its clock continues through Cx state
* transitions (unlike many CPU timestamp counters) -- making it * transitions (unlike many CPU timestamp counters) -- making it
* a versatile and accurate timer. * a versatile and accurate timer.
* *
* Note that this function accomodates only a single timer * Note that this function accomodates only a single timer
* rollover. Thus for 24-bit timers, this function should only * rollover. Thus for 24-bit timers, this function should only
* be used for calculating durations less than ~4.6 seconds * be used for calculating durations less than ~4.6 seconds
* (~20 hours for 32-bit timers). * (~20 hours for 32-bit timers).
* *
******************************************************************************/ ******************************************************************************/
@ -227,12 +227,12 @@ AcpiGetTimerDuration (
FUNCTION_TRACE ("AcpiGetTimerDuration"); FUNCTION_TRACE ("AcpiGetTimerDuration");
if (!TimeElapsed) if (!TimeElapsed)
{ {
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
/* /*
* Compute Tick Delta: * Compute Tick Delta:
* ------------------- * -------------------
* Handle (max one) timer rollovers on 24- versus 32-bit timers. * Handle (max one) timer rollovers on 24- versus 32-bit timers.
@ -241,7 +241,7 @@ AcpiGetTimerDuration (
{ {
DeltaTicks = EndTicks - StartTicks; DeltaTicks = EndTicks - StartTicks;
} }
else if (StartTicks > EndTicks) else if (StartTicks > EndTicks)
{ {
/* 24-bit Timer */ /* 24-bit Timer */
if (0 == AcpiGbl_FADT->TmrValExt) if (0 == AcpiGbl_FADT->TmrValExt)
@ -249,7 +249,7 @@ AcpiGetTimerDuration (
DeltaTicks = (((0x00FFFFFF - StartTicks) + EndTicks) & 0x00FFFFFF); DeltaTicks = (((0x00FFFFFF - StartTicks) + EndTicks) & 0x00FFFFFF);
} }
/* 32-bit Timer */ /* 32-bit Timer */
else else
{ {
DeltaTicks = (0xFFFFFFFF - StartTicks) + EndTicks; DeltaTicks = (0xFFFFFFFF - StartTicks) + EndTicks;
} }
@ -260,17 +260,17 @@ AcpiGetTimerDuration (
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/* /*
* Compute Duration: * Compute Duration:
* ----------------- * -----------------
* Since certain compilers (gcc/Linux, argh!) don't support 64-bit * Since certain compilers (gcc/Linux, argh!) don't support 64-bit
* divides in kernel-space we have to do some trickery to preserve * divides in kernel-space we have to do some trickery to preserve
* accuracy while using 32-bit math. * accuracy while using 32-bit math.
* *
* TODO: Change to use 64-bit math when supported. * TBD: Change to use 64-bit math when supported.
* *
* The process is as follows: * The process is as follows:
* 1. Compute the number of seconds by dividing Delta Ticks by * 1. Compute the number of seconds by dividing Delta Ticks by
* the timer frequency. * the timer frequency.
* 2. Compute the number of milliseconds in the remainder from step #1 * 2. Compute the number of milliseconds in the remainder from step #1
* by multiplying by 1000 and then dividing by the timer frequency. * by multiplying by 1000 and then dividing by the timer frequency.
@ -278,7 +278,7 @@ AcpiGetTimerDuration (
* by multiplying by 1000 and then dividing by the timer frequency. * by multiplying by 1000 and then dividing by the timer frequency.
* 4. Add the results from steps 1, 2, and 3 to get the total duration. * 4. Add the results from steps 1, 2, and 3 to get the total duration.
* *
* Example: The time elapsed for DeltaTicks = 0xFFFFFFFF should be * Example: The time elapsed for DeltaTicks = 0xFFFFFFFF should be
* 1199864031 microseconds. This is computed as follows: * 1199864031 microseconds. This is computed as follows:
* Step #1: Seconds = 1199; Remainder = 3092840 * Step #1: Seconds = 1199; Remainder = 3092840
* Step #2: Milliseconds = 864; Remainder = 113120 * Step #2: Milliseconds = 864; Remainder = 113120