lkml.org 
[lkml]   [2003]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] New x86_64 time code for 2.5.70
On Thu, Jun 12, 2003 at 12:32:01AM +0300, Mika Penttilä wrote:
> /*
> + * Read the period, compute tick and quotient.
> + */
> +
> + id = hpet_readl(HPET_ID);
> +
> + if (!(id & HPET_ID_VENDOR) || !(id & HPET_ID_NUMBER) ||
> + !(id & HPET_ID_LEGSUP))
> + return -1;
> +
> + hpet_period = hpet_readl(HPET_PERIOD);
> + if (hpet_period < 100000 || hpet_period > 100000000)
> + return -1;
> +
>
>
> Line below seems to be wrong, given hpet period is in fsecs.
>
>
> + hpet_tick = (tick_nsec + hpet_period / 2) / hpet_period;

Yes, it should be:

hpet_tick = (1000000000L * (USECS_PER_SEC/HZ) + hpet_period / 2) / hpet_period;

>
>
>
>
>
> --Mika
>
>
>
>
>

--
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.080 / U:4.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site