diff options
| author | Bruce Evans <bde@FreeBSD.org> | 2003-07-30 19:31:11 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 2003-07-30 19:31:11 +0000 |
| commit | e81dc827312ff1562e1db3bb907c6e4309f60578 (patch) | |
| tree | 3d81d0fc31e600399564dbd012e6d3ed8b5c8ff0 | |
| parent | 23047d3472fb2771f3d19ac94d33fc8b83c506be (diff) | |
Notes
| -rw-r--r-- | sys/i386/include/atomic.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 5471e0cace9f..6b4da95b47aa 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -65,7 +65,7 @@ * require different constraints in the asm statement. */ #if defined(KLD_MODULE) -#define ATOMIC_ASM(NAME, TYPE, OP, V) \ +#define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ extern void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); #else /* !KLD_MODULE */ @@ -79,34 +79,34 @@ * The assembly is volatilized to demark potential before-and-after side * effects if an interrupt or SMP collision were to occur. */ -#define ATOMIC_ASM(NAME, TYPE, OP, V) \ +#define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ static __inline void \ atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ : "=m" (*p) \ - : "ir" (V)); \ + : CONS (V)); \ } #endif /* KLD_MODULE */ -ATOMIC_ASM(set, char, "orb %1,%0", v) -ATOMIC_ASM(clear, char, "andb %1,%0", ~v) -ATOMIC_ASM(add, char, "addb %1,%0", v) -ATOMIC_ASM(subtract, char, "subb %1,%0", v) +ATOMIC_ASM(set, char, "orb %b1,%0", "iq", v) +ATOMIC_ASM(clear, char, "andb %b1,%0", "iq", ~v) +ATOMIC_ASM(add, char, "addb %b1,%0", "iq", v) +ATOMIC_ASM(subtract, char, "subb %b1,%0", "iq", v) -ATOMIC_ASM(set, short, "orw %1,%0", v) -ATOMIC_ASM(clear, short, "andw %1,%0", ~v) -ATOMIC_ASM(add, short, "addw %1,%0", v) -ATOMIC_ASM(subtract, short, "subw %1,%0", v) +ATOMIC_ASM(set, short, "orw %w1,%0", "ir", v) +ATOMIC_ASM(clear, short, "andw %w1,%0", "ir", ~v) +ATOMIC_ASM(add, short, "addw %w1,%0", "ir", v) +ATOMIC_ASM(subtract, short, "subw %w1,%0", "ir", v) -ATOMIC_ASM(set, int, "orl %1,%0", v) -ATOMIC_ASM(clear, int, "andl %1,%0", ~v) -ATOMIC_ASM(add, int, "addl %1,%0", v) -ATOMIC_ASM(subtract, int, "subl %1,%0", v) +ATOMIC_ASM(set, int, "orl %1,%0", "ir", v) +ATOMIC_ASM(clear, int, "andl %1,%0", "ir", ~v) +ATOMIC_ASM(add, int, "addl %1,%0", "ir", v) +ATOMIC_ASM(subtract, int, "subl %1,%0", "ir", v) -ATOMIC_ASM(set, long, "orl %1,%0", v) -ATOMIC_ASM(clear, long, "andl %1,%0", ~v) -ATOMIC_ASM(add, long, "addl %1,%0", v) -ATOMIC_ASM(subtract, long, "subl %1,%0", v) +ATOMIC_ASM(set, long, "orl %1,%0", "ir", v) +ATOMIC_ASM(clear, long, "andl %1,%0", "ir", ~v) +ATOMIC_ASM(add, long, "addl %1,%0", "ir", v) +ATOMIC_ASM(subtract, long, "subl %1,%0", "ir", v) #endif /* ! _MACHINE_ATOMIC_H_ */ |
