summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2010-12-27 20:22:24 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2010-12-27 20:22:24 +0000
commita7e2d82ab36871723f9f048d087e5c63d0d772f7 (patch)
tree646fd3f0174c877908ad03e80d0b085d4ca39678 /sys/arch/amd64
parent6f5d61a8911f12544ef8a65040688b9468e95278 (diff)
Correct x86_atomic_*_ul() to operate on 64bit integers, eliminate
x86_atomic_*_l(), and update the callers of all of those to use the underlying x86_atomic_*_u32() functions that they were expecting anyway. Whether the x86_atomic_*_ul() macros should be eliminated has been deferred. ok kettenis@, tedu@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/intr.c4
-rw-r--r--sys/arch/amd64/amd64/ipi.c8
-rw-r--r--sys/arch/amd64/include/atomic.h10
3 files changed, 10 insertions, 12 deletions
diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c
index 655c0ef64e8..44ba2669fc1 100644
--- a/sys/arch/amd64/amd64/intr.c
+++ b/sys/arch/amd64/amd64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.25 2010/09/20 06:33:46 matthew Exp $ */
+/* $OpenBSD: intr.c,v 1.26 2010/12/27 20:22:23 guenther Exp $ */
/* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */
/*
@@ -498,7 +498,7 @@ intr_disestablish(struct intrhand *ih)
simple_lock(&ci->ci_slock);
pic->pic_hwmask(pic, ih->ih_pin);
- x86_atomic_clearbits_l(&ci->ci_ipending, (1 << ih->ih_slot));
+ x86_atomic_clearbits_u32(&ci->ci_ipending, (1 << ih->ih_slot));
/*
* Remove the handler from the chain.
diff --git a/sys/arch/amd64/amd64/ipi.c b/sys/arch/amd64/amd64/ipi.c
index 253d4b607be..f6ca47c87f6 100644
--- a/sys/arch/amd64/amd64/ipi.c
+++ b/sys/arch/amd64/amd64/ipi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipi.c,v 1.9 2010/12/27 19:51:27 guenther Exp $ */
+/* $OpenBSD: ipi.c,v 1.10 2010/12/27 20:22:23 guenther Exp $ */
/* $NetBSD: ipi.c,v 1.2 2003/03/01 13:05:37 fvdl Exp $ */
/*-
@@ -50,7 +50,7 @@ x86_send_ipi(struct cpu_info *ci, int ipimask)
{
int ret;
- x86_atomic_setbits_l(&ci->ci_ipis, ipimask);
+ x86_atomic_setbits_u32(&ci->ci_ipis, ipimask);
/* Don't send IPI to cpu which isn't (yet) running. */
if (!(ci->ci_flags & CPUF_RUNNING))
@@ -88,7 +88,7 @@ x86_broadcast_ipi(int ipimask)
continue;
if ((ci->ci_flags & CPUF_RUNNING) == 0)
continue;
- x86_atomic_setbits_l(&ci->ci_ipis, ipimask);
+ x86_atomic_setbits_u32(&ci->ci_ipis, ipimask);
count++;
}
if (!count)
@@ -105,7 +105,7 @@ x86_ipi_handler(void)
u_int32_t pending;
int bit;
- pending = x86_atomic_testset_ul(&ci->ci_ipis, 0);
+ pending = x86_atomic_testset_u32(&ci->ci_ipis, 0);
for (bit = 0; bit < X86_NIPI && pending; bit++) {
if (pending & (1<<bit)) {
diff --git a/sys/arch/amd64/include/atomic.h b/sys/arch/amd64/include/atomic.h
index 1df5a74ef2c..4578f9a0478 100644
--- a/sys/arch/amd64/include/atomic.h
+++ b/sys/arch/amd64/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.6 2007/05/25 16:22:11 art Exp $ */
+/* $OpenBSD: atomic.h,v 1.7 2010/12/27 20:22:23 guenther Exp $ */
/* $NetBSD: atomic.h,v 1.1 2003/04/26 18:39:37 fvdl Exp $ */
/*
@@ -120,12 +120,10 @@ x86_atomic_clearbits_u64(volatile u_int64_t *ptr, u_int64_t bits)
__asm __volatile(LOCK " andq %1,%0" : "=m" (*ptr) : "ir" (~bits));
}
-#define x86_atomic_testset_ul x86_atomic_testset_u32
+#define x86_atomic_testset_ul x86_atomic_testset_u64
#define x86_atomic_testset_i x86_atomic_testset_i32
-#define x86_atomic_setbits_l x86_atomic_setbits_u32
-#define x86_atomic_setbits_ul x86_atomic_setbits_u32
-#define x86_atomic_clearbits_l x86_atomic_clearbits_u32
-#define x86_atomic_clearbits_ul x86_atomic_clearbits_u32
+#define x86_atomic_setbits_ul x86_atomic_setbits_u64
+#define x86_atomic_clearbits_ul x86_atomic_clearbits_u64
#define atomic_setbits_int x86_atomic_setbits_u32
#define atomic_clearbits_int x86_atomic_clearbits_u32