summaryrefslogtreecommitdiff
path: root/include/asm-alpha/bitops.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 18:24:48 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 18:24:48 -0800
commitc9df1e203d7efe8c93d3cdc04093f44f040f8e83 (patch)
tree9bc86b9aeee5576677e5c8415ef5b757201dc2bc /include/asm-alpha/bitops.h
parent560e89962e32171585dd95af9ac9911ebc0e02ce (diff)
v2.4.4.5 -> v2.4.4.6
- Johannes Erdfelt: OHCI hash-chain corruption fix, USB updates - Richard Henderson, Ivan Kokshaysky: alpha PCI iommu fixes - Tim Waugh: parport changelogs and printk levels - Andrew Morton: vmalloc off-by-one (overly sensitive) test - Al Viro: VFS layer cleanups - Cort Dougan: PPC updates (big bootloader re-org) - Alan Cox: more merges, remove phillips camera conversion code - Andrea Arkangeli: alpha fixups - OGAWA Hirofumi: big-sector support with FAT - Neil Brown: more md fixes
Diffstat (limited to 'include/asm-alpha/bitops.h')
-rw-r--r--include/asm-alpha/bitops.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 78e0f58c39b2..11935eaddac2 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -46,7 +46,7 @@ __set_bit(unsigned long nr, volatile void * addr)
{
int *m = ((int *) addr) + (nr >> 5);
- *m |= 1UL << (nr & 31);
+ *m |= 1 << (nr & 31);
}
#define smp_mb__before_clear_bit() smp_mb()
@@ -70,6 +70,17 @@ clear_bit(unsigned long nr, volatile void * addr)
:"Ir" (~(1UL << (nr & 31))), "m" (*m));
}
+/*
+ * WARNING: non atomic version.
+ */
+static __inline__ void
+__change_bit(unsigned long nr, volatile void * addr)
+{
+ int *m = ((int *) addr) + (nr >> 5);
+
+ *m ^= 1 << (nr & 31);
+}
+
extern __inline__ void
change_bit(unsigned long nr, volatile void * addr)
{
@@ -170,6 +181,20 @@ __test_and_clear_bit(unsigned long nr, volatile void * addr)
return (old & mask) != 0;
}
+/*
+ * WARNING: non atomic version.
+ */
+static __inline__ int
+__test_and_change_bit(unsigned long nr, volatile void * addr)
+{
+ unsigned long mask = 1 << (nr & 0x1f);
+ int *m = ((int *) addr) + (nr >> 5);
+ int old = *m;
+
+ *m = old ^ mask;
+ return (old & mask) != 0;
+}
+
extern __inline__ int
test_and_change_bit(unsigned long nr, volatile void * addr)
{