diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/ioapic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/ioapic.c b/sys/arch/amd64/amd64/ioapic.c index f16acb9869b..7d401e5e045 100644 --- a/sys/arch/amd64/amd64/ioapic.c +++ b/sys/arch/amd64/amd64/ioapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioapic.c,v 1.13 2008/06/26 05:42:09 ray Exp $ */ +/* $OpenBSD: ioapic.c,v 1.14 2008/09/15 19:19:45 kettenis Exp $ */ /* $NetBSD: ioapic.c,v 1.6 2003/05/15 13:30:31 fvdl Exp $ */ /*- @@ -122,14 +122,18 @@ ioapic_lock(struct ioapic_softc *sc) flags = read_psl(); disable_intr(); +#ifdef MULTIPROCESSOR mtx_enter(&sc->sc_pic.pic_mutex); +#endif return flags; } static __inline void ioapic_unlock(struct ioapic_softc *sc, u_long flags) { +#ifdef MULTIPROCESSOR mtx_leave(&sc->sc_pic.pic_mutex); +#endif write_psl(flags); } @@ -307,7 +311,9 @@ 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; +#ifdef MULTIPROCESSOR mtx_init(&sc->sc_pic.pic_mutex, IPL_NONE); +#endif sc->sc_pic.pic_hwmask = ioapic_hwmask; sc->sc_pic.pic_hwunmask = ioapic_hwunmask; sc->sc_pic.pic_addroute = ioapic_addroute; |