lkml.org 
[lkml]   [1996]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Jiffies Wraparound (was Re: interrupt counts)
Date
From

Ok, this suggestion _may_ be the product of too much caffine and not enough
sleep, but here it goes anway.

If we really want to catch all the bad code that treats
jiffies as a numeric type and does direct comparisons against them,
or otherwise treats them in unkind ways, why not make the compiler
do the work for us. Declare jiffies to have a type that is the same
size as the current type, but that does not support arithmetic operations,
e.g.:

struct {
unsigned int data;
} JiffieType;

Now, we just need to define a few suitable macros to allow the operations
we do need, and allow them in a safe manner. There should be no loss of
speed in the compiled code. Then it's just a matter of a few weeks of
work on someones part to track down all the places the compiler complains
about this... Of course this doesn't help with comparisions
between time values that have been stored in different variables,
but the same principle could be applied to this problem.

-- eric

Who is not volunteering to do the job, except maybe for checking
the TCP/IP layer for problems like this...




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