From: Kenn H. <ke...@us...> - 2002-06-05 21:55:09
|
Update of /cvsroot/linux-vax/kernel-2.5/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv31851/include/asm-vax Modified Files: bitops.h mmu_context.h Log Message: Merge with Linus' 2.5.2 release Index: bitops.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/include/asm-vax/bitops.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- bitops.h 20 May 2002 00:33:38 -0000 1.3 +++ bitops.h 5 Jun 2002 21:55:04 -0000 1.4 @@ -98,6 +98,24 @@ :"ir" (nr)); } +/** + * __clear_bit - Set a bit in memory + * @nr: the bit to clear + * @addr: the address to start counting from + * + * Unlike clear_bit(), this function is non-atomic and may be reordered. + * If it's called on the same region of memory simultaneously, the effect + * may be that only one operation succeeds. + */ +static __inline__ void __clear_bit(int nr, volatile void * addr) +{ + __asm__( + "bbcc %1,%0, 2f\n" + "2:\n" + :"=m" (ADDR) + :"ir" (nr)); +} + #define smp_mb__before_clear_bit() smp_mb() #define smp_mb__after_clear_bit() smp_mb() Index: mmu_context.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/include/asm-vax/mmu_context.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mmu_context.h 20 May 2002 00:33:39 -0000 1.3 +++ mmu_context.h 5 Jun 2002 21:55:04 -0000 1.4 @@ -3,4 +3,32 @@ #include <asm/mm/mmu_context.h> +/* This was introduced in 2.5.2 and for some strange reason, was + implemented in this header file for i386/sparc/sparc64. */ + + /* + * Every architecture must define this function. It's the fastest + * way of searching a 168-bit bitmap where the first 128 bits are + * unlikely to be set. It's guaranteed that at least one of the 168 + * bits is cleared. + */ +#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 +# error update this function. +#endif + +static inline int sched_find_first_zero_bit(char *bitmap) +{ + unsigned int *b = (unsigned int *)bitmap; + unsigned int rt; + + rt = b[0] & b[1] & b[2] & b[3]; + if (unlikely(rt != 0xffffffff)) + return find_first_zero_bit(bitmap, MAX_RT_PRIO); + + if (b[4] != ~0) + return ffz(b[4]) + MAX_RT_PRIO; + return ffz(b[5]) + 32 + MAX_RT_PRIO; +} + + #endif /* __VAX_TMP_MMUCONTEXT_H */ |