unsigned long
search_exception_table(unsigned long addr)
{
- struct list_head *i;
unsigned long ret = 0;
#ifndef CONFIG_MODULES
/*
* SMP save set_bit routine based on compare and swap (CS)
*/
-static inline void set_bit_cs(int nr, volatile void *ptr)
+static inline void set_bit_cs(int nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save clear_bit routine based on compare and swap (CS)
*/
-static inline void clear_bit_cs(int nr, volatile void *ptr)
+static inline void clear_bit_cs(int nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save change_bit routine based on compare and swap (CS)
*/
-static inline void change_bit_cs(int nr, volatile void *ptr)
+static inline void change_bit_cs(int nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save test_and_set_bit routine based on compare and swap (CS)
*/
-static inline int test_and_set_bit_cs(int nr, volatile void *ptr)
+static inline int
+test_and_set_bit_cs(int nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save test_and_clear_bit routine based on compare and swap (CS)
*/
-static inline int test_and_clear_bit_cs(int nr, volatile void *ptr)
+static inline int
+test_and_clear_bit_cs(int nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save test_and_change_bit routine based on compare and swap (CS)
*/
-static inline int test_and_change_bit_cs(int nr, volatile void *ptr)
+static inline int
+test_and_change_bit_cs(int nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* fast, non-SMP set_bit routine
*/
-static inline void __set_bit(int nr, volatile void *ptr)
+static inline void __set_bit(int nr, volatile unsigned long *ptr)
{
unsigned long addr;
}
static inline void
-__constant_set_bit(const int nr, volatile void *ptr)
+__constant_set_bit(const int nr, volatile unsigned long *ptr)
{
unsigned long addr;
* fast, non-SMP clear_bit routine
*/
static inline void
-__clear_bit(int nr, volatile void *ptr)
+__clear_bit(int nr, volatile unsigned long *ptr)
{
unsigned long addr;
}
static inline void
-__constant_clear_bit(const int nr, volatile void *ptr)
+__constant_clear_bit(const int nr, volatile unsigned long *ptr)
{
unsigned long addr;
/*
* fast, non-SMP change_bit routine
*/
-static inline void __change_bit(int nr, volatile void *ptr)
+static inline void __change_bit(int nr, volatile unsigned long *ptr)
{
unsigned long addr;
}
static inline void
-__constant_change_bit(const int nr, volatile void *ptr)
+__constant_change_bit(const int nr, volatile unsigned long *ptr)
{
unsigned long addr;
/*
* fast, non-SMP test_and_set_bit routine
*/
-static inline int test_and_set_bit_simple(int nr, volatile void *ptr)
+static inline int
+test_and_set_bit_simple(int nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
/*
* fast, non-SMP test_and_clear_bit routine
*/
-static inline int test_and_clear_bit_simple(int nr, volatile void *ptr)
+static inline int
+test_and_clear_bit_simple(int nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
/*
* fast, non-SMP test_and_change_bit routine
*/
-static inline int test_and_change_bit_simple(int nr, volatile void *ptr)
+static inline int
+test_and_change_bit_simple(int nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
* This routine doesn't need to be atomic.
*/
-static inline int __test_bit(int nr, volatile void *ptr)
+static inline int __test_bit(int nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
return (ch >> (nr & 7)) & 1;
}
-static inline int __constant_test_bit(int nr, volatile void * addr) {
+static inline int
+__constant_test_bit(int nr, volatile unsigned long * addr) {
return (((volatile char *) addr)[(nr>>3)^3] & (1<<(nr&7))) != 0;
}
/*
* Find-bit routines..
*/
-static inline int find_first_zero_bit(void * addr, unsigned size)
+static inline int
+find_first_zero_bit(unsigned long * addr, unsigned size)
{
unsigned long cmp, count;
int res;
return (res < size) ? res : size;
}
-static inline int find_first_bit(void * addr, unsigned size)
+static inline int
+find_first_bit(unsigned long * addr, unsigned size)
{
unsigned long cmp, count;
int res;
return (res < size) ? res : size;
}
-static inline int find_next_zero_bit (void * addr, int size, int offset)
+static inline int
+find_next_zero_bit (unsigned long * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
unsigned long bitvec, reg;
return (offset + res);
}
-static inline int find_next_bit (void * addr, int size, int offset)
+static inline int
+find_next_bit (unsigned long * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
unsigned long bitvec, reg;
* __ffs = find first bit in word. Undefined if no bit exists,
* so code should check against 0UL first..
*/
-static inline unsigned long __ffs(unsigned long word)
+static inline unsigned long __ffs (unsigned long word)
{
unsigned long reg, result;
* differs in spirit from the above ffz (man ffs).
*/
-extern int inline ffs (int x)
+extern inline int ffs (int x)
{
int r = 1;
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/
-#define ext2_set_bit(nr, addr) test_and_set_bit((nr)^24, addr)
-#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr)^24, addr)
-#define ext2_test_bit(nr, addr) test_bit((nr)^24, addr)
-static inline int ext2_find_first_zero_bit(void *vaddr, unsigned size)
+#define ext2_set_bit(nr, addr) \
+ test_and_set_bit((nr)^24, (unsigned long *)addr)
+#define ext2_clear_bit(nr, addr) \
+ test_and_clear_bit((nr)^24, (unsigned long *)addr)
+#define ext2_test_bit(nr, addr) \
+ test_bit((nr)^24, (unsigned long *)addr)
+
+static inline int
+ext2_find_first_zero_bit(void *vaddr, unsigned size)
{
unsigned long cmp, count;
int res;
#define BUG() do { \
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
- __asm__ __volatile__(".word 0x0000"); \
+ __asm__ __volatile__(".long 0"); \
} while (0)
#define PAGE_BUG(page) do { \
#endif
#undef __FD_SET
-#define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp)
+#define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp->fds_bits)
#undef __FD_CLR
-#define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp)
+#define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp->fds_bits)
#undef __FD_ISSET
-#define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp)
+#define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp->fds_bits)
#undef __FD_ZERO
#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
: "=&d" (old), "=&d" (new)
: "a" (&sem->count), "m" (tmp)
: "cc", "memory" );
- if (new > 1) // FIXME: is this correct ?!?
+ if (new > 1)
rwsem_downgrade_wake(sem);
}
*/
extern unsigned long machine_flags;
-#define MACHINE_IS_VM (machine_flags & 1)
-#define MACHINE_HAS_IEEE (machine_flags & 2)
-#define MACHINE_IS_P390 (machine_flags & 4)
-#define MACHINE_HAS_CSP (machine_flags & 8)
-#define MACHINE_HAS_MVPG (machine_flags & 16)
+#define MACHINE_IS_VM (machine_flags & 1)
+#define MACHINE_HAS_IEEE (machine_flags & 2)
+#define MACHINE_IS_P390 (machine_flags & 4)
+#define MACHINE_HAS_CSP (machine_flags & 8)
+#define MACHINE_HAS_MVPG (machine_flags & 16)
-#define MACHINE_HAS_SCLP (!MACHINE_IS_P390)
+#define MACHINE_HAS_SCLP (!MACHINE_IS_P390)
/*
* Console mode. Override with conmode=
+#ifndef _S390_BITOPS_H
+#define _S390_BITOPS_H
+
/*
* include/asm-s390/bitops.h
*
* Copyright (C) 1992, Linus Torvalds
*
*/
-
-#ifndef _S390_BITOPS_H
-#define _S390_BITOPS_H
+#include <linux/config.h>
/*
* bit 0 is the LSB of *addr; bit 63 is the MSB of *addr;
* of the form "flags |= (1 << bitnr)" are used INTERMIXED
* with operation of the form "set_bit(bitnr, flags)".
*/
-#include <linux/config.h>
/* set ALIGN_CS to 1 if the SMP safe bit operations should
* align the address to 4 byte boundary. It seems to work
/*
* SMP save set_bit routine based on compare and swap (CS)
*/
-static inline void set_bit_cs(unsigned long nr, volatile void *ptr)
+static inline void set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save clear_bit routine based on compare and swap (CS)
*/
-static inline void clear_bit_cs(unsigned long nr, volatile void *ptr)
+static inline void clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save change_bit routine based on compare and swap (CS)
*/
-static inline void change_bit_cs(unsigned long nr, volatile void *ptr)
+static inline void change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* SMP save test_and_set_bit routine based on compare and swap (CS)
*/
-static inline int
-test_and_set_bit_cs(unsigned long nr, volatile void *ptr)
+static inline int
+test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
* SMP save test_and_clear_bit routine based on compare and swap (CS)
*/
static inline int
-test_and_clear_bit_cs(unsigned long nr, volatile void *ptr)
+test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
* SMP save test_and_change_bit routine based on compare and swap (CS)
*/
static inline int
-test_and_change_bit_cs(unsigned long nr, volatile void *ptr)
+test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr, old, new, mask;
/*
* fast, non-SMP set_bit routine
*/
-static inline void __set_bit(unsigned long nr, volatile void *ptr)
+static inline void __set_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
}
static inline void
-__constant_set_bit(const unsigned long nr, volatile void *ptr)
+__constant_set_bit(const unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
* fast, non-SMP clear_bit routine
*/
static inline void
-__clear_bit(unsigned long nr, volatile void *ptr)
+__clear_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
}
static inline void
-__constant_clear_bit(const unsigned long nr, volatile void *ptr)
+__constant_clear_bit(const unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
/*
* fast, non-SMP change_bit routine
*/
-static inline void __change_bit(unsigned long nr, volatile void *ptr)
+static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
}
static inline void
-__constant_change_bit(const unsigned long nr, volatile void *ptr)
+__constant_change_bit(const unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
* fast, non-SMP test_and_set_bit routine
*/
static inline int
-test_and_set_bit_simple(unsigned long nr, volatile void *ptr)
+test_and_set_bit_simple(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
* fast, non-SMP test_and_clear_bit routine
*/
static inline int
-test_and_clear_bit_simple(unsigned long nr, volatile void *ptr)
+test_and_clear_bit_simple(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
* fast, non-SMP test_and_change_bit routine
*/
static inline int
-test_and_change_bit_simple(unsigned long nr, volatile void *ptr)
+test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
* This routine doesn't need to be atomic.
*/
-static inline int __test_bit(unsigned long nr, volatile void *ptr)
+static inline int __test_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long addr;
unsigned char ch;
}
static inline int
-__constant_test_bit(unsigned long nr, volatile void *addr) {
+__constant_test_bit(unsigned long nr, volatile unsigned long *addr) {
return (((volatile char *) addr)[(nr>>3)^7] & (1<<(nr&7))) != 0;
}
* Find-bit routines..
*/
static inline unsigned long
-find_first_zero_bit(void * addr, unsigned long size)
+find_first_zero_bit(unsigned long * addr, unsigned long size)
{
unsigned long res, cmp, count;
}
static inline unsigned long
-find_first_bit(void * addr, unsigned long size)
+find_first_bit(unsigned long * addr, unsigned long size)
{
unsigned long res, cmp, count;
}
static inline unsigned long
-find_next_zero_bit (void * addr, unsigned long size, unsigned long offset)
+find_next_zero_bit (unsigned long * addr, unsigned long size, unsigned long offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 6);
unsigned long bitvec, reg;
}
static inline unsigned long
-find_next_bit (void * addr, unsigned long size, unsigned long offset)
+find_next_bit (unsigned long * addr, unsigned long size, unsigned long offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 6);
unsigned long bitvec, reg;
* the libc and compiler builtin ffs routines, therefore
* differs in spirit from the above ffz (man ffs).
*/
-extern int inline ffs (int x)
+extern inline int ffs (int x)
{
int r = 1;
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/
-#define ext2_set_bit(nr, addr) test_and_set_bit((nr)^56, addr)
-#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr)^56, addr)
-#define ext2_test_bit(nr, addr) test_bit((nr)^56, addr)
+#define ext2_set_bit(nr, addr) \
+ test_and_set_bit((nr)^56, (unsigned long *)addr)
+#define ext2_clear_bit(nr, addr) \
+ test_and_clear_bit((nr)^56, (unsigned long *)addr)
+#define ext2_test_bit(nr, addr) \
+ test_bit((nr)^56, (unsigned long *)addr)
+
static inline unsigned long
ext2_find_first_zero_bit(void *vaddr, unsigned long size)
{
#endif
#undef __FD_SET
-#define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp)
+#define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp->fds_bits)
#undef __FD_CLR
-#define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp)
+#define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp->fds_bits)
#undef __FD_ISSET
-#define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp)
+#define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp->fds_bits)
#undef __FD_ZERO
#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
: "=&d" (old), "=&d" (new)
: "a" (&sem->count), "m" (tmp)
: "cc", "memory" );
- if (new > 1) // FIXME: is this correct ?!?
+ if (new > 1)
rwsem_downgrade_wake(sem);
}