-/* $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
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);
if (ih == NULL)
return (NULL);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
if (intrmapptr != NULL) {
u_int64_t intrmap;
-/* $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)
if (ih == NULL)
return (NULL);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
if (intrmapptr != NULL) {
u_int64_t r;
-/* $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 $ */
/*
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);
ih->ih_fun, ih->ih_arg, sc->sc_dev.dv_xname, ih->ih_number,
ih->ih_pil));
- intr_establish(ipl, ih);
+ intr_establish(ih);
}
/*
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.
-/* $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)
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;
-/* $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 $ */
/*-
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;
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;
/*
if (ih == NULL)
return (ih);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
return (ih);
}
-/* $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)
return;
}
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
}
bus_space_tag_t
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;
-/* $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
*
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);
-/* $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>
*
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);
-/* $OpenBSD: intr.h,v 1.24 2024/03/29 21:18:19 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.25 2024/03/29 21:29:34 miod Exp $ */
/* $NetBSD: intr.h,v 1.8 2001/01/14 23:50:30 thorpej Exp $ */
/*-
extern struct intrhand *intrlev[MAXINTNUM];
-void intr_establish(int, struct intrhand *);
+void intr_establish(struct intrhand *);
/* XXX - arbitrary numbers; no interpretation is defined yet */
#define IPL_NONE 0 /* nothing */
-/* $OpenBSD: clock.c,v 1.85 2024/03/29 21:26:38 miod Exp $ */
+/* $OpenBSD: clock.c,v 1.86 2024/03/29 21:29:34 miod Exp $ */
/* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */
/*
void sparc64_raise_clockintr(void);
-static struct intrhand level0 = { tickintr };
+static struct intrhand level10 = {
+ .ih_fun = tickintr,
+ .ih_number = 1,
+ .ih_pil = 10,
+ .ih_name = "clock"
+};
/*
* clock (eeprom) attaches at the sbus or the ebus (PCI)
struct cpu_info *ci;
- /* We don't have a counter-timer -- use %tick */
- level0.ih_clr = 0;
-
/*
* Establish a level 10 interrupt handler
*
* We will have a conflict with the softint handler,
* so we set the ih_number to 1.
*/
- level0.ih_number = 1;
- strlcpy(level0.ih_name, "clock", sizeof(level0.ih_name));
- intr_establish(10, &level0);
- evcount_percpu(&level0.ih_count);
+ intr_establish(&level10);
+ evcount_percpu(&level10.ih_count);
if (sys_tick_rate > 0) {
sys_tick_nsec_cycle_ratio =
sys_tick_rate * (1ULL << 32) / 1000000000;
sys_tick_nsec_max = UINT64_MAX / sys_tick_nsec_cycle_ratio;
if (impl == IMPL_HUMMINGBIRD) {
- level0.ih_fun = stickintr;
+ level10.ih_fun = stickintr;
cpu_start_clock = stick_start;
} else {
- level0.ih_fun = sys_tickintr;
+ level10.ih_fun = sys_tickintr;
cpu_start_clock = sys_tick_start;
}
} else {
tick_nsec_cycle_ratio =
cpu_clockrate * (1ULL << 32) / 1000000000;
tick_nsec_max = UINT64_MAX / tick_nsec_cycle_ratio;
- level0.ih_fun = tickintr;
+ level10.ih_fun = tickintr;
cpu_start_clock = tick_start;
}
for (ci = cpus; ci != NULL; ci = ci->ci_next)
- memcpy(&ci->ci_tickintr, &level0, sizeof(level0));
+ memcpy(&ci->ci_tickintr, &level10, sizeof(level10));
}
void
tickintr(void *cap)
{
clockintr_dispatch(cap);
- evcount_inc(&level0.ih_count);
+ evcount_inc(&level10.ih_count);
return (1);
}
sys_tickintr(void *cap)
{
clockintr_dispatch(cap);
- evcount_inc(&level0.ih_count);
+ evcount_inc(&level10.ih_count);
return (1);
}
stickintr(void *cap)
{
clockintr_dispatch(cap);
- evcount_inc(&level0.ih_count);
+ evcount_inc(&level10.ih_count);
return (1);
}
-/* $OpenBSD: intr.c,v 1.66 2024/03/29 21:18:19 miod Exp $ */
+/* $OpenBSD: intr.c,v 1.67 2024/03/29 21:29:34 miod Exp $ */
/* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */
/*
}
/*
- * Attach an interrupt handler to the vector chain for the given level.
+ * Attach an interrupt handler to the vector chain.
*/
void
-intr_establish(int level, struct intrhand *ih)
+intr_establish(struct intrhand *ih)
{
struct intrhand *q;
u_int64_t m, id;
s = splhigh();
- /*
- * This is O(N^2) for long chains, but chains are never long
- * and we do want to preserve order.
- */
- ih->ih_pil = level; /* XXXX caller should have done this before */
- ih->ih_pending = 0; /* XXXX caller should have done this before */
+ ih->ih_pending = NULL;
ih->ih_next = NULL;
if (ih->ih_cpu == NULL)
ih->ih_cpu = curcpu();
ih->ih_fun = (int (*)(void *))fun; /* XXX */
ih->ih_arg = arg;
ih->ih_pil = level;
- ih->ih_pending = 0;
+ ih->ih_pending = NULL;
ih->ih_ack = NULL;
ih->ih_clr = NULL;
return (ih);
-/* $OpenBSD: machdep.c,v 1.215 2024/03/29 21:27:53 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.216 2024/03/29 21:29:34 miod Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
if (ih == NULL)
return (NULL);
- intr_establish(ih->ih_pil, ih);
+ intr_establish(ih);
return (ih);
}