diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-05-29 03:20:44 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-05-29 03:20:44 +0000 |
commit | 93c77ad51e4fcc28584bb93f63dd48a4a6c771ec (patch) | |
tree | 0198ee58bab354860cf7d00f461d33143ff1aa7f /sys/arch/amd64 | |
parent | 171f684dab1e3ccc2da4ee86219e9396e8e38e55 (diff) |
sched work by niklas and art backed out; causes panics
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/ioapic.c | 8 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/locore.S | 5 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/trap.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/include/pic.h | 4 |
4 files changed, 14 insertions, 9 deletions
diff --git a/sys/arch/amd64/amd64/ioapic.c b/sys/arch/amd64/amd64/ioapic.c index 21c4b38ddab..6ee5bf11a1b 100644 --- a/sys/arch/amd64/amd64/ioapic.c +++ b/sys/arch/amd64/amd64/ioapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioapic.c,v 1.4 2005/05/25 23:17:47 niklas Exp $ */ +/* $OpenBSD: ioapic.c,v 1.5 2005/05/29 03:20:36 deraadt Exp $ */ /* $NetBSD: ioapic.c,v 1.6 2003/05/15 13:30:31 fvdl Exp $ */ /*- @@ -127,14 +127,14 @@ ioapic_lock(struct ioapic_softc *sc) flags = read_psl(); disable_intr(); - mtx_enter(&sc->sc_pic.pic_mutex); + SIMPLE_LOCK(&sc->sc_pic.pic_lock); return flags; } static __inline void ioapic_unlock(struct ioapic_softc *sc, u_long flags) { - mtx_leave(&sc->sc_pic.pic_mutex); + SIMPLE_UNLOCK(&sc->sc_pic.pic_lock); write_psl(flags); } @@ -294,7 +294,7 @@ ioapic_attach(struct device *parent, struct device *self, void *aux) sc->sc_data = (volatile u_int32_t *)(bh + IOAPIC_DATA); sc->sc_pic.pic_type = PIC_IOAPIC; - mtx_init(&sc->sc_pic.pic_mutex, IPL_NONE); + SIMPLE_LOCK_INIT(&sc->sc_pic.pic_lock); sc->sc_pic.pic_hwmask = ioapic_hwmask; sc->sc_pic.pic_hwunmask = ioapic_hwunmask; sc->sc_pic.pic_addroute = ioapic_addroute; diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index a73047353d6..46583605655 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.18 2005/05/27 19:32:39 art Exp $ */ +/* $OpenBSD: locore.S,v 1.19 2005/05/29 03:20:36 deraadt Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -846,8 +846,9 @@ idle_start: cmpl $0,_C_LABEL(whichqs)(%rip) jz idle_loop idle_exit: + movl $IPL_HIGH,CPUVAR(ILEVEL) sti -#if defined(MULTIPROCESSOR) +#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) call _C_LABEL(sched_lock_idle) #endif switch_search: diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 0bc830b1c7b..05289bfe2ed 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.5 2005/05/25 23:17:47 niklas Exp $ */ +/* $OpenBSD: trap.c,v 1.6 2005/05/29 03:20:36 deraadt Exp $ */ /* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */ /*- @@ -386,6 +386,10 @@ copyfault: case T_PAGEFLT: /* allow page faults in kernel mode */ if (p == NULL) goto we_re_toast; +#ifdef LOCKDEBUG + if (simple_lock_held(&sched_lock)) + goto we_re_toast; +#endif #ifdef MULTIPROCESSOR if ((p->p_flag & P_BIGLOCK) == 0) goto we_re_toast; diff --git a/sys/arch/amd64/include/pic.h b/sys/arch/amd64/include/pic.h index 0ef3a8fa4ca..0859288542f 100644 --- a/sys/arch/amd64/include/pic.h +++ b/sys/arch/amd64/include/pic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pic.h,v 1.3 2005/05/25 23:17:47 niklas Exp $ */ +/* $OpenBSD: pic.h,v 1.4 2005/05/29 03:20:36 deraadt Exp $ */ /* $NetBSD: pic.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */ #ifndef _X86_PIC_H @@ -20,7 +20,7 @@ struct pic { struct device pic_dev; int pic_type; #ifdef MULTIPROCESSOR - struct mutex pic_mutex; + struct SIMPLE_LOCK pic_lock; #endif void (*pic_hwmask)(struct pic *, int); void (*pic_hwunmask)(struct pic *, int); |