Explicitly pass a "mpsafe" arg down to intr_establish, as at that point

we do not have the original ipl passed in around to check for mpsafeness.
Fixes PR port-sparc64/38673. Thanks to Andrew for pointing at the problem.
This commit is contained in:
martin 2008-05-18 22:40:14 +00:00
parent edf03256a8
commit ee9ac5c71f
6 changed files with 21 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: psycho.c,v 1.85 2008/04/05 13:40:05 cegger Exp $ */
/* $NetBSD: psycho.c,v 1.86 2008/05/18 22:40:14 martin Exp $ */
/*
* Copyright (c) 2001, 2002 Eduardo E. Horvath
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.85 2008/04/05 13:40:05 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.86 2008/05/18 22:40:14 martin Exp $");
#include "opt_ddb.h"
@ -672,7 +672,7 @@ psycho_set_intr(struct psycho_softc *sc, int ipl, void *handler,
ih->ih_fun = handler;
ih->ih_pil = (1<<ipl);
ih->ih_number = INTVEC(*(ih->ih_map));
intr_establish(ipl, ih);
intr_establish(ipl, ipl != IPL_VM, ih);
*(ih->ih_map) |= INTMAP_V|(CPU_UPAID << INTMAP_TID_SHIFT);
}
@ -1298,7 +1298,7 @@ found:
"; installing handler %p arg %p with ino %u pil %u\n",
handler, arg, (u_int)ino, (u_int)ih->ih_pil));
intr_establish(ih->ih_pil, ih);
intr_establish(ih->ih_pil, level != IPL_VM, ih);
/*
* Enable the interrupt now we have the handler installed.

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbus.c,v 1.79 2008/04/05 13:40:05 cegger Exp $ */
/* $NetBSD: sbus.c,v 1.80 2008/05/18 22:40:14 martin Exp $ */
/*
* Copyright (c) 1999-2002 Eduardo Horvath
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.79 2008/04/05 13:40:05 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.80 2008/05/18 22:40:14 martin Exp $");
#include "opt_ddb.h"
@ -274,7 +274,7 @@ sbus_attach(struct device *parent, struct device *self, void *aux)
ipl = 1;
ih->ih_pil = (1<<ipl);
ih->ih_number = INTVEC(*(ih->ih_map));
intr_establish(ipl, ih);
intr_establish(ipl, true, ih);
*(ih->ih_map) |= INTMAP_V|(CPU_UPAID << INTMAP_TID_SHIFT);
/*
@ -646,7 +646,7 @@ sbus_intr_establish(bus_space_tag_t t, int pri, int level,
ih->ih_arg = arg;
ih->ih_number = vec;
ih->ih_pil = (1<<ipl);
intr_establish(ipl, ih);
intr_establish(ipl, level != IPL_VM, ih);
return (ih);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.80 2008/04/29 14:06:31 ad Exp $ */
/* $NetBSD: cpu.h,v 1.81 2008/05/18 22:40:14 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -315,7 +315,7 @@ struct intrhand {
extern struct intrhand *intrhand[];
extern struct intrhand *intrlev[MAXINTNUM];
void intr_establish(int level, struct intrhand *);
void intr_establish(int level, bool mpsafe, struct intrhand *);
void *sparc_softintr_establish(int, int (*)(void *), void *);
void sparc_softintr_schedule(void *);
void sparc_softintr_disestablish(void *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.96 2008/04/29 14:06:31 ad Exp $ */
/* $NetBSD: clock.c,v 1.97 2008/05/18 22:40:14 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.96 2008/04/29 14:06:31 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.97 2008/05/18 22:40:14 martin Exp $");
#include "opt_multiprocessor.h"
@ -240,7 +240,7 @@ timerattach(struct device *parent, struct device *self, void *aux)
/* Install the appropriate interrupt vector here */
level10.ih_number = ma->ma_interrupts[0];
level10.ih_clr = &timerreg_4u.t_clrintr[0];
intr_establish(PIL_CLOCK, &level10);
intr_establish(PIL_CLOCK, true, &level10);
printf(" irq vectors %lx", (u_long)level10.ih_number);
#ifndef MULTIPROCESSOR
/*
@ -248,7 +248,7 @@ timerattach(struct device *parent, struct device *self, void *aux)
*/
level14.ih_number = ma->ma_interrupts[1];
level14.ih_clr = &timerreg_4u.t_clrintr[1];
intr_establish(PIL_STATCLOCK, &level14);
intr_establish(PIL_STATCLOCK, true, &level14);
printf(" and %lx", (u_long)level14.ih_number);
#endif
@ -322,7 +322,7 @@ tickintr_establish(int pil, int (*fun)(void *))
ih = sparc_softintr_establish(pil, fun, NULL);
ih->ih_number = 1;
if (CPU_IS_PRIMARY(ci))
intr_establish(pil, ih);
intr_establish(pil, true, ih);
ci->ci_tick_ih = ih;
/* set the next interrupt time */

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.59 2008/04/29 15:57:56 martin Exp $ */
/* $NetBSD: intr.c,v 1.60 2008/05/18 22:40:14 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.59 2008/04/29 15:57:56 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.60 2008/05/18 22:40:14 martin Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -163,12 +163,9 @@ intr_biglock_wrapper(void *vp)
* This is not possible if it has been taken away as a fast vector.
*/
void
intr_establish(int level, struct intrhand *ih)
intr_establish(int level, bool mpsafe, struct intrhand *ih)
{
struct intrhand *q = NULL;
#ifdef MULTIPROCESSOR
bool mpsafe = (level != IPL_VM);
#endif
int s;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.221 2008/04/28 20:23:37 martin Exp $ */
/* $NetBSD: machdep.c,v 1.222 2008/05/18 22:40:14 martin Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.221 2008/04/28 20:23:37 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.222 2008/05/18 22:40:14 martin Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -1729,7 +1729,7 @@ sparc_mainbus_intr_establish(bus_space_tag_t t, int pil, int level,
ih->ih_fun = handler;
ih->ih_arg = arg;
intr_establish(pil, ih);
intr_establish(pil, level != IPL_VM, ih);
return (ih);
}