george anzinger wrote: > > The patch to fix idr is attached. Cleans up the int/long confusion > and also rearranges a couple of structures to honor the sizes involved. > I definitly agree with you George. However, in order to avoid hardcoding the size of an int to 32 I used a constant called BITS_PER_INT (that's really just for cleanness): #endif #define IDR_MASK ((1 << IDR_BITS)-1) -/* Leave the possibility of an incomplete final layer */ -#define MAX_LEVEL (BITS_PER_LONG - RESERVED_ID_BITS + IDR_BITS - 1) / IDR_BITS -#define MAX_ID_SHIFT (BITS_PER_LONG - RESERVED_ID_BITS) +/* Define the size of the id's */ +#define BITS_PER_INT (sizeof(int)*8) + +#define MAX_ID_SHIFT (BITS_PER_INT - RESERVED_ID_BITS) #define MAX_ID_BIT (1 << MAX_ID_SHIFT) #define MAX_ID_MASK (MAX_ID_BIT - 1) +/* Leave the possibility of an incomplete final layer */ +#define MAX_LEVEL (MAX_ID_SHIFT + IDR_BITS - 1) / IDR_BITS + /* Number of id_layer structs to leave in free list */ #define IDR_FREE_MAX MAX_LEVEL + MAX_LEVEL > > Sure, except I don't have a test-program. ;-) > > > That is why you should visit the High-res-timers web site (see URL > below) and get the "support" patch. It installs in you kernel tree at > .../Documentation/high-res-timers/ and has test programs as well as > man pages, readme files etc. > I used the test programs and they are really good to test the interface. To have them working on IA64 I had to slightly modify the file syscall_timer.c in the lib. This is due to the fact only a function syscall() is used under ia64 instead of _syscall{1,2,3,4}(). I've attached a patch that does the trick, it's a bit "raw" but it works and that's only until glibc is upgraded to support those syscalls :-) Eric