diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/dev/apic.c | 23 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/intr.c | 5 |
2 files changed, 16 insertions, 12 deletions
diff --git a/sys/arch/hppa/dev/apic.c b/sys/arch/hppa/dev/apic.c index 0c58d0fd445..0b88d7740f9 100644 --- a/sys/arch/hppa/dev/apic.c +++ b/sys/arch/hppa/dev/apic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apic.c,v 1.13 2011/04/23 22:20:22 kettenis Exp $ */ +/* $OpenBSD: apic.c,v 1.14 2011/05/01 21:59:39 kettenis Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -175,29 +175,30 @@ apic_intr_establish(void *v, pci_intr_handle_t ih, return NULL; } + cnt = malloc(sizeof(struct evcount), M_DEVBUF, M_NOWAIT); + if (!cnt) { + free(aiv, M_DEVBUF); + return (NULL); + } + aiv->sc = sc; aiv->ih = ih; aiv->handler = handler; aiv->arg = arg; aiv->next = NULL; - aiv->cnt = NULL; - if (apic_intr_list[irq]) { - cnt = malloc(sizeof(struct evcount), M_DEVBUF, M_NOWAIT); - if (!cnt) { - free(aiv, M_DEVBUF); - return (NULL); - } + aiv->cnt = cnt; + + evcount_attach(cnt, name, NULL); - evcount_attach(cnt, name, NULL); + if (apic_intr_list[irq]) { biv = apic_intr_list[irq]; while (biv->next) biv = biv->next; biv->next = aiv; - aiv->cnt = cnt; return (arg); } - if ((iv = cpu_intr_establish(pri, irq, apic_intr, aiv, name))) { + if ((iv = cpu_intr_establish(pri, irq, apic_intr, aiv, NULL))) { ent0 = (31 - irq) & APIC_ENT0_VEC; ent0 |= apic_get_int_ent0(sc, line); #if 0 diff --git a/sys/arch/hppa/hppa/intr.c b/sys/arch/hppa/hppa/intr.c index a703a9dd7f8..87720c8eea4 100644 --- a/sys/arch/hppa/hppa/intr.c +++ b/sys/arch/hppa/hppa/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.38 2011/03/24 10:52:22 kettenis Exp $ */ +/* $OpenBSD: intr.c,v 1.39 2011/05/01 21:59:38 kettenis Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -229,6 +229,9 @@ cpu_intr_establish(int pri, int irq, int (*handler)(void *), void *arg, ev->share = iv->share, iv->share = ev; free(cnt, M_DEVBUF); iv->cnt = NULL; + } else if (name == NULL) { + free(cnt, M_DEVBUF); + iv->cnt = NULL; } else evcount_attach(cnt, name, NULL); |