diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-01-27 21:17:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-01-27 21:17:51 +0000 |
commit | 94b0fdaf55d0e1863ae8079b84ab5f66ba3a380a (patch) | |
tree | 107b3d5122c18943cbd6044ecefb186975149eb8 /sys/arch | |
parent | 3de4742d1bad4fefa11fd537805f4ab4adbe44a2 (diff) |
Fill all fields of intrhand structures not created by bus_intr_allocate().
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/dev/psycho.c | 23 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/sbus.c | 4 |
2 files changed, 17 insertions, 10 deletions
diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c index bde842df157..b9dd9467f3e 100644 --- a/sys/arch/sparc64/dev/psycho.c +++ b/sys/arch/sparc64/dev/psycho.c @@ -1,4 +1,4 @@ -/* $OpenBSD: psycho.c,v 1.39 2004/12/18 03:05:24 brad Exp $ */ +/* $OpenBSD: psycho.c,v 1.40 2005/01/27 21:17:50 miod Exp $ */ /* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */ /* @@ -76,7 +76,7 @@ pci_chipset_tag_t psycho_alloc_chipset(struct psycho_pbm *, int, void psycho_get_bus_range(int, int *); void psycho_get_ranges(int, struct psycho_ranges **, int *); void psycho_set_intr(struct psycho_softc *, int, void *, - u_int64_t *, u_int64_t *); + u_int64_t *, u_int64_t *, const char *); bus_space_tag_t _psycho_alloc_bus_tag(struct psycho_pbm *, const char *, int, int, int); @@ -398,25 +398,27 @@ psycho_attach(struct device *parent, struct device *self, void *aux) */ psycho_set_intr(sc, 15, psycho_ue, psycho_psychoreg_vaddr(sc, ue_int_map), - psycho_psychoreg_vaddr(sc, ue_clr_int)); + psycho_psychoreg_vaddr(sc, ue_clr_int), "ue"); psycho_set_intr(sc, 1, psycho_ce, psycho_psychoreg_vaddr(sc, ce_int_map), - psycho_psychoreg_vaddr(sc, ce_clr_int)); + psycho_psychoreg_vaddr(sc, ce_clr_int), "ce"); psycho_set_intr(sc, 15, psycho_bus_a, psycho_psychoreg_vaddr(sc, pciaerr_int_map), - psycho_psychoreg_vaddr(sc, pciaerr_clr_int)); + psycho_psychoreg_vaddr(sc, pciaerr_clr_int), "bus_a"); #if 0 psycho_set_intr(sc, 15, psycho_powerfail, psycho_psychoreg_vaddr(sc, power_int_map), - psycho_psychoreg_vaddr(sc, power_clr_int)); + psycho_psychoreg_vaddr(sc, power_clr_int), "powerfail"); #endif if (sc->sc_mode == PSYCHO_MODE_PSYCHO) { psycho_set_intr(sc, 15, psycho_bus_b, psycho_psychoreg_vaddr(sc, pciberr_int_map), - psycho_psychoreg_vaddr(sc, pciberr_clr_int)); + psycho_psychoreg_vaddr(sc, pciberr_clr_int), + "bus_b"); psycho_set_intr(sc, 1, psycho_wakeup, psycho_psychoreg_vaddr(sc, pwrmgt_int_map), - psycho_psychoreg_vaddr(sc, pwrmgt_clr_int)); + psycho_psychoreg_vaddr(sc, pwrmgt_clr_int), + "wakeup"); } /* @@ -602,7 +604,7 @@ psycho_print(void *aux, const char *p) void psycho_set_intr(struct psycho_softc *sc, int ipl, void *handler, - u_int64_t *mapper, u_int64_t *clearer) + u_int64_t *mapper, u_int64_t *clearer, const char *suffix) { struct intrhand *ih; @@ -610,12 +612,15 @@ psycho_set_intr(struct psycho_softc *sc, int ipl, void *handler, M_DEVBUF, M_NOWAIT); if (ih == NULL) panic("couldn't malloc intrhand"); + memset(ih, 0, sizeof(struct intrhand)); ih->ih_arg = sc; ih->ih_map = mapper; ih->ih_clr = clearer; ih->ih_fun = handler; ih->ih_pil = (1 << ipl); ih->ih_number = INTVEC(*(ih->ih_map)); + snprintf(ih->ih_name, sizeof(ih->ih_name), + "%s_%s", sc->sc_dev.dv_xname, suffix); DPRINTF(PDB_INTR, ( "\ninstalling handler %p arg %p for %s with number %x pil %u", diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c index b5c811a1ced..df871d30ff6 100644 --- a/sys/arch/sparc64/dev/sbus.c +++ b/sys/arch/sparc64/dev/sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbus.c,v 1.20 2003/06/24 21:54:39 henric Exp $ */ +/* $OpenBSD: sbus.c,v 1.21 2005/01/27 21:17:50 miod Exp $ */ /* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */ /*- @@ -325,12 +325,14 @@ sbus_attach(struct device *parent, struct device *self, void *aux) malloc(sizeof(struct intrhand), M_DEVBUF, M_NOWAIT); if (ih == NULL) panic("couldn't malloc intrhand"); + memset(ih, 0, sizeof(struct intrhand)); 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_number = INTVEC(*(ih->ih_map)); + strlcpy(ih->ih_name, sc->sc_dev.dv_xname, sizeof(ih->ih_name)); intr_establish(ipl, ih); *(ih->ih_map) |= INTMAP_V; |