lkml.org 
[lkml]   [1998]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] jiffies wraparound [Re: 2.1.125 Show stopper list: Draft]


On Mon, 19 Oct 1998, Andrea Arcangeli wrote:

> On Mon, 19 Oct 1998, Finn Arne Gangstad wrote:
>
> >You have to initialise tv1.index .. tv5.index to the correct values if
> >you start with timer_jiffies != 0;
>
> Very good, my guesses was right ;-). Thanks.

I thought some more about it, and the correct values are like this (I
verified this for all 2^32 possible values)

unsigned long j = timer_jiffies - 1;
unsigned int i1 = (1 + j) & TVR_MASK;
unsigned int i2 = (1 + (j >> TVR_BITS)) & TVN_MASK;
unsigned int i3 = (1 + (j >> (TVR_BITS + TVN_BITS))) & TVN_MASK;
unsigned int i4 = (1 + (j >> (TVR_BITS + 2 * TVN_BITS))) & TVN_MASK;
unsigned int i5 = (1 + (j >> (TVR_BITS + 3 * TVN_BITS))) & TVN_MASK;

where i1 is tv1.index, i2 is tv2.index etc..

- Finn Arne


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [from the cache]
©2003-2011 Jasper Spaans