From: miod Date: Fri, 29 Mar 2024 21:18:19 +0000 (+0000) Subject: send_softint() was designed as being able to target a particular cpu, but the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bdd1b0790409749823ece7acb2e7a489865adf7d;p=openbsd send_softint() was designed as being able to target a particular cpu, but the code for this was never written and all uses target the running cpu anyway, so stop pretending it may do things it won't do and drop that cpu argument. ok claudio@ kettenis@ --- diff --git a/sys/arch/sparc64/dev/pyro.c b/sys/arch/sparc64/dev/pyro.c index 21381b0f442..af48a1f0b88 100644 --- a/sys/arch/sparc64/dev/pyro.c +++ b/sys/arch/sparc64/dev/pyro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pyro.c,v 1.36 2020/10/01 05:14:10 jsg Exp $ */ +/* $OpenBSD: pyro.c,v 1.37 2024/03/29 21:18:19 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -849,7 +849,7 @@ pyro_msi_eq_intr(void *arg) bus_space_write_8(sc->sc_bust, sc->sc_csrh, FIRE_MSI_CLEAR(msinum), FIRE_MSI_CLEAR_EQWR_N); - send_softint(-1, ih->ih_pil, ih); + send_softint(ih->ih_pil, ih); head += 1; head &= eq->eq_mask; diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c index 7e6dce21c0b..14f3c5c0d10 100644 --- a/sys/arch/sparc64/dev/vpci.c +++ b/sys/arch/sparc64/dev/vpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vpci.c,v 1.33 2020/10/27 21:01:33 kettenis Exp $ */ +/* $OpenBSD: vpci.c,v 1.34 2024/03/29 21:18:19 miod Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -769,7 +769,7 @@ vpci_msi_eq_intr(void *arg) if (err != H_EOK) printf("%s: pci_msi_setstate: %d\n", __func__, err); - send_softint(-1, ih->ih_pil, ih); + send_softint(ih->ih_pil, ih); head += sizeof(struct vpci_msi_msg); head &= eq->eq_mask; diff --git a/sys/arch/sparc64/include/intr.h b/sys/arch/sparc64/include/intr.h index 65fc4944b3c..b12fd0a396e 100644 --- a/sys/arch/sparc64/include/intr.h +++ b/sys/arch/sparc64/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.23 2024/03/29 21:16:01 miod Exp $ */ +/* $OpenBSD: intr.h,v 1.24 2024/03/29 21:18:19 miod Exp $ */ /* $NetBSD: intr.h,v 1.8 2001/01/14 23:50:30 thorpej Exp $ */ /*- @@ -110,6 +110,6 @@ void *softintr_establish(int, void (*)(void *), void *); void softintr_disestablish(void *); void softintr_schedule(void *); -void send_softint(int cpu, int level, struct intrhand *ih); +void send_softint(int, struct intrhand *); #endif /* _MACHINE_INTR_H_ */ diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c index 92c52adfbc5..c5cf142fdba 100644 --- a/sys/arch/sparc64/sparc64/clock.c +++ b/sys/arch/sparc64/sparc64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.83 2024/03/29 21:06:14 miod Exp $ */ +/* $OpenBSD: clock.c,v 1.84 2024/03/29 21:18:19 miod Exp $ */ /* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */ /* @@ -727,5 +727,5 @@ sys_tick_get_timecount(struct timecounter *tc) void sparc64_raise_clockintr(void) { - send_softint(-1, PIL_CLOCK, &curcpu()->ci_tickintr); + send_softint(PIL_CLOCK, &curcpu()->ci_tickintr); } diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c index 682f68accbc..812ad901e3b 100644 --- a/sys/arch/sparc64/sparc64/intr.c +++ b/sys/arch/sparc64/sparc64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.65 2024/03/29 21:17:13 miod Exp $ */ +/* $OpenBSD: intr.c,v 1.66 2024/03/29 21:18:19 miod Exp $ */ /* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */ /* @@ -313,7 +313,7 @@ softintr_schedule(void *cookie) { struct intrhand *ih = cookie; - send_softint(-1, ih->ih_pil, ih); + send_softint(ih->ih_pil, ih); } #ifdef DIAGNOSTIC diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index 069797b81a4..376ea82b7d0 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.209 2024/03/29 21:17:13 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.210 2024/03/29 21:18:19 miod Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -7218,38 +7218,35 @@ ENTRY(cecc_catch) END(cecc_catch) /* - * send_softint(cpu, level, intrhand) + * send_softint(level, intrhand) * * Send a softint with an intrhand pointer so we can cause a vectored * interrupt instead of a polled interrupt. This does pretty much the * same as interrupt_vector. If intrhand is NULL then it just sends - * a polled interrupt. If cpu is -1 then send it to this CPU, if it's - * -2 send it to any CPU, otherwise send it to a particular CPU. - * - * XXXX Dispatching to different CPUs is not implemented yet. + * a polled interrupt. */ ENTRY(send_softint) rdpr %pstate, %g1 andn %g1, PSTATE_IE, %o3 wrpr %o3, 0, %pstate - brz,pn %o2, 1f + brz,pn %o1, 1f add %g7, CI_INTRPENDING, %o3 - ldx [%o2 + IH_PEND], %o5 + ldx [%o1 + IH_PEND], %o5 brnz,pn %o5, 1f - sll %o1, 3+3, %o5 ! Find start of table for this IPL + sll %o0, 3+3, %o5 ! Find start of table for this IPL add %o3, %o5, %o3 ldx [%o3], %o5 ! Load list head - add %o2, IH_PEND, %o4 + add %o1, IH_PEND, %o4 casxa [%o4] ASI_N, %g0, %o5 brnz,pn %o5, 1f nop - stx %o2, [%o3] + stx %o1, [%o3] mov 1, %o3 ! Change from level to bitmask - sllx %o3, %o1, %o3 + sllx %o3, %o0, %o3 wr %o3, 0, SET_SOFTINT ! SET_SOFTINT 1: retl