Hi!
When writing my input drivers I've stumbled into a problem, that the bit
operations from bitops.h didn't work as expected. The problem (found after
freezing my machine a couple times, with the help of Martin Mares) is the
following:
GCC can compile
test_bit(100, z);
as
btsl $100,z
Which is obviously wrong, 'cause btsl can't take immediate arguments higher
than 31. GAS should choke on this, but doesn't - another bug.
GCC is not at fault here, bitops.h is, since it allows any value to be
passed to btsl as an immediate argument. The attached patch fixes that.
Have fun,
Vojtech
--n8g4imXOkfNTN/H1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="bitops.h.diff"
--- bitops.h.orig Thu Jan 28 21:41:18 1999
+++ bitops.h Sat Apr 17 21:53:39 1999
@@ -46,7 +46,7 @@
__asm__ __volatile__( LOCK_PREFIX
"btsl %1,%0"
:"=m" (ADDR)
- :"ir" (nr));
+ :"Ir" (nr));
}
extern __inline__ void clear_bit(int nr, volatile void * addr)
@@ -54,7 +54,7 @@
__asm__ __volatile__( LOCK_PREFIX
"btrl %1,%0"
:"=m" (ADDR)
- :"ir" (nr));
+ :"Ir" (nr));
}
extern __inline__ void change_bit(int nr, volatile void * addr)
@@ -62,7 +62,7 @@
__asm__ __volatile__( LOCK_PREFIX
"btcl %1,%0"
:"=m" (ADDR)
- :"ir" (nr));
+ :"Ir" (nr));
}
extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
@@ -72,7 +72,7 @@
__asm__ __volatile__( LOCK_PREFIX
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
- :"ir" (nr));
+ :"Ir" (nr));
return oldbit;
}
@@ -83,7 +83,7 @@
__asm__ __volatile__( LOCK_PREFIX
"btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
- :"ir" (nr));
+ :"Ir" (nr));
return oldbit;
}
@@ -94,7 +94,7 @@
__asm__ __volatile__( LOCK_PREFIX
"btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
- :"ir" (nr));
+ :"Ir" (nr));
return oldbit;
}
@@ -113,7 +113,7 @@
__asm__ __volatile__(
"btl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit)
- :"m" (ADDR),"ir" (nr));
+ :"m" (ADDR),"Ir" (nr));
return oldbit;
}
--n8g4imXOkfNTN/H1--
-
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/