summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r--sys/arch/hppa/dev/apic.c23
1 files changed, 12 insertions, 11 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