summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/atomic.h
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-02-11 10:44:09 +0000
committermarkm <markm@FreeBSD.org>2001-02-11 10:44:09 +0000
commit4e9c36b3003ffcfb812ef0bea8d7504d6a422c13 (patch)
tree3590416bf784163b3ca3a8bc2452bde5c704d0ad /sys/amd64/include/atomic.h
parent0f9088da5625e8088bdbd7b3587fdadb265b1482 (diff)
downloadFreeBSD-src-4e9c36b3003ffcfb812ef0bea8d7504d6a422c13.zip
FreeBSD-src-4e9c36b3003ffcfb812ef0bea8d7504d6a422c13.tar.gz
RIP <machine/lock.h>.
Some things needed bits of <i386/include/lock.h> - cy.c now has its own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK() has been moved to <i386/include/apic.h> (AKA <machine/apic.h>). Reviewed by: jhb
Diffstat (limited to 'sys/amd64/include/atomic.h')
-rw-r--r--sys/amd64/include/atomic.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h
index b5035b89e..cb899a6 100644
--- a/sys/amd64/include/atomic.h
+++ b/sys/amd64/include/atomic.h
@@ -74,16 +74,18 @@ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p); \
void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v);
#else /* !KLD_MODULE */
+
#if defined(SMP)
#if defined(LOCORE)
#define MPLOCKED lock ;
-#else
+#else /* !LOCORE */
#define MPLOCKED "lock ; "
-#endif
-#else
+#endif /* LOCORE */
+#else /* !SMP */
#define MPLOCKED
-#endif
+#endif /* SMP */
+#if !defined(LOCORE)
/*
* The assembly is volatilized to demark potential before-and-after side
* effects if an interrupt or SMP collision were to occur.
@@ -201,8 +203,10 @@ atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
: : "memory"); \
}
#endif /* defined(I386_CPU) */
+#endif /* !defined(LOCORE) */
#endif /* KLD_MODULE */
+#if !defined(LOCORE)
ATOMIC_ASM(set, char, "orb %b2,%0", v)
ATOMIC_ASM(clear, char, "andb %b2,%0", ~v)
ATOMIC_ASM(add, char, "addb %b2,%0", v)
@@ -401,4 +405,5 @@ atomic_readandclear_long(volatile u_long *addr)
return (result);
}
#endif /* !defined(WANT_FUNCTIONS) */
+#endif /* !defined(LOCORE) */
#endif /* ! _MACHINE_ATOMIC_H_ */
OpenPOWER on IntegriCloud