summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2024-03-29 21:29:35 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2024-03-29 21:29:35 +0000
commit3c247f0907266f60ab1437eb926539940a010a92 (patch)
treef57695377f45cb77ab6b6151519f4d1a4e518472 /sys/arch/sparc64/dev
parent61e38aa522496ed88842eb050db891bdc9611c83 (diff)
Drop the first argument of intr_establish().
Instead, require all callers to put the right value in the ih_pil field, and have intr_establish() trust them rather than assigning this field again from its first argument. ok claudio@ kettenis@
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r--sys/arch/sparc64/dev/ebus_mainbus.c6
-rw-r--r--sys/arch/sparc64/dev/fhc.c4
-rw-r--r--sys/arch/sparc64/dev/psycho.c8
-rw-r--r--sys/arch/sparc64/dev/pyro.c4
-rw-r--r--sys/arch/sparc64/dev/sbus.c11
-rw-r--r--sys/arch/sparc64/dev/schizo.c6
-rw-r--r--sys/arch/sparc64/dev/vbus.c4
-rw-r--r--sys/arch/sparc64/dev/vpci.c4
8 files changed, 23 insertions, 24 deletions
diff --git a/sys/arch/sparc64/dev/ebus_mainbus.c b/sys/arch/sparc64/dev/ebus_mainbus.c
index 7e011b9d5b6..6b1728b589f 100644
--- a/sys/arch/sparc64/dev/ebus_mainbus.c
+++ b/sys/arch/sparc64/dev/ebus_mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ebus_mainbus.c,v 1.12 2021/10/24 17:05:03 mpi Exp $ */
+/* $OpenBSD: ebus_mainbus.c,v 1.13 2024/03/29 21:29:33 miod Exp $ */
/*
* Copyright (c) 2007 Mark Kettenis
@@ -274,7 +274,7 @@ ebus_mainbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
if (ih == NULL)
return (NULL);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
ih->ih_ack = ebus_mainbus_intr_ack;
err = hv_intr_settarget(sysino, ih->ih_cpu->ci_upaid);
@@ -322,7 +322,7 @@ ebus_mainbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
if (ih == NULL)
return (NULL);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
if (intrmapptr != NULL) {
u_int64_t intrmap;
diff --git a/sys/arch/sparc64/dev/fhc.c b/sys/arch/sparc64/dev/fhc.c
index 23b77c0e277..6b967a095be 100644
--- a/sys/arch/sparc64/dev/fhc.c
+++ b/sys/arch/sparc64/dev/fhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fhc.c,v 1.21 2017/09/08 05:36:52 deraadt Exp $ */
+/* $OpenBSD: fhc.c,v 1.22 2024/03/29 21:29:33 miod Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net)
@@ -273,7 +273,7 @@ fhc_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
if (ih == NULL)
return (NULL);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
if (intrmapptr != NULL) {
u_int64_t r;
diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c
index f3c5b29a30a..377eefc6f60 100644
--- a/sys/arch/sparc64/dev/psycho.c
+++ b/sys/arch/sparc64/dev/psycho.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psycho.c,v 1.83 2023/04/11 00:45:08 jsg Exp $ */
+/* $OpenBSD: psycho.c,v 1.84 2024/03/29 21:29:33 miod Exp $ */
/* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */
/*
@@ -681,7 +681,7 @@ psycho_set_intr(struct psycho_softc *sc, int ipl, void *handler,
ih->ih_map = mapper;
ih->ih_clr = clearer;
ih->ih_fun = handler;
- ih->ih_pil = (1 << ipl);
+ ih->ih_pil = ipl;
ih->ih_number = INTVEC(*(ih->ih_map));
snprintf(ih->ih_name, sizeof(ih->ih_name),
"%s:%s", sc->sc_dev.dv_xname, suffix);
@@ -691,7 +691,7 @@ psycho_set_intr(struct psycho_softc *sc, int ipl, void *handler,
ih->ih_fun, ih->ih_arg, sc->sc_dev.dv_xname, ih->ih_number,
ih->ih_pil));
- intr_establish(ipl, ih);
+ intr_establish(ih);
}
/*
@@ -1286,7 +1286,7 @@ found:
if (flags & BUS_INTR_ESTABLISH_MPSAFE)
ih->ih_mpsafe = 1;
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
/*
* Enable the interrupt now we have the handler installed.
diff --git a/sys/arch/sparc64/dev/pyro.c b/sys/arch/sparc64/dev/pyro.c
index af48a1f0b88..5f99b0e61ad 100644
--- a/sys/arch/sparc64/dev/pyro.c
+++ b/sys/arch/sparc64/dev/pyro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pyro.c,v 1.37 2024/03/29 21:18:19 miod Exp $ */
+/* $OpenBSD: pyro.c,v 1.38 2024/03/29 21:29:33 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -786,7 +786,7 @@ pyro_intr_establish_cpu(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
if (flags & BUS_INTR_ESTABLISH_MPSAFE)
ih->ih_mpsafe = 1;
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
if (intrmapptr != NULL) {
u_int64_t intrmap;
diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c
index 49f222e5179..ddb77a6c26b 100644
--- a/sys/arch/sparc64/dev/sbus.c
+++ b/sys/arch/sparc64/dev/sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbus.c,v 1.46 2021/10/24 17:05:04 mpi Exp $ */
+/* $OpenBSD: sbus.c,v 1.47 2024/03/29 21:29:33 miod Exp $ */
/* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */
/*-
@@ -291,7 +291,7 @@ sbus_mb_attach(struct device *parent, struct device *self, void *aux)
struct mainbus_attach_args *ma = aux;
int node = ma->ma_node;
struct intrhand *ih;
- int ipl, error;
+ int error;
struct sysioreg *sysio;
char buf[32];
char *name;
@@ -363,11 +363,10 @@ sbus_mb_attach(struct device *parent, struct device *self, void *aux)
ih->ih_map = &sysio->therm_int_map;
ih->ih_clr = NULL; /* &sysio->therm_clr_int; */
ih->ih_fun = sbus_overtemp;
- ipl = 1;
- ih->ih_pil = (1 << ipl);
+ ih->ih_pil = 1;
ih->ih_number = INTVEC(*(ih->ih_map));
strlcpy(ih->ih_name, sc->sc_dev.dv_xname, sizeof(ih->ih_name));
- intr_establish(ipl, ih);
+ intr_establish(ih);
*(ih->ih_map) |= INTMAP_V;
/*
@@ -757,7 +756,7 @@ sbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int pri, int level,
if (ih == NULL)
return (ih);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
return (ih);
}
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c
index 3152e77cada..2b4a3af4fb5 100644
--- a/sys/arch/sparc64/dev/schizo.c
+++ b/sys/arch/sparc64/dev/schizo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schizo.c,v 1.69 2019/06/25 22:30:56 dlg Exp $ */
+/* $OpenBSD: schizo.c,v 1.70 2024/03/29 21:29:33 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -561,7 +561,7 @@ schizo_set_intr(struct schizo_softc *sc, struct schizo_pbm *pbm, int ipl,
return;
}
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
}
bus_space_tag_t
@@ -806,7 +806,7 @@ schizo_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
if (flags & BUS_INTR_ESTABLISH_MPSAFE)
ih->ih_mpsafe = 1;
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
if (intrmapptr != NULL) {
u_int64_t intrmap;
diff --git a/sys/arch/sparc64/dev/vbus.c b/sys/arch/sparc64/dev/vbus.c
index 983fbac3aaf..44840a391b8 100644
--- a/sys/arch/sparc64/dev/vbus.c
+++ b/sys/arch/sparc64/dev/vbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vbus.c,v 1.12 2021/10/24 17:05:04 mpi Exp $ */
+/* $OpenBSD: vbus.c,v 1.13 2024/03/29 21:29:33 miod Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
*
@@ -244,7 +244,7 @@ vbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
if (err != H_EOK)
return (NULL);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
ih->ih_ack = vbus_intr_ack;
err = sun4v_intr_settarget(devhandle, sysino, ih->ih_cpu->ci_upaid);
diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c
index 14f3c5c0d10..afaae203209 100644
--- a/sys/arch/sparc64/dev/vpci.c
+++ b/sys/arch/sparc64/dev/vpci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vpci.c,v 1.34 2024/03/29 21:18:19 miod Exp $ */
+/* $OpenBSD: vpci.c,v 1.35 2024/03/29 21:29:33 miod Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org>
*
@@ -695,7 +695,7 @@ vpci_intr_establish_cpu(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
return (NULL);
ih->ih_cpu = cpu;
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
ih->ih_ack = vpci_intr_ack;
err = sun4v_intr_settarget(devhandle, sysino, ih->ih_cpu->ci_upaid);