diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2011-11-09 00:15:07 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2011-11-09 00:15:07 +0000 |
commit | a2cbbf1c48a2df3486f3bb6f599a556c6fca68e4 (patch) | |
tree | b3de946fbff5ff121e3f81a04a1d0d3ee43afabd | |
parent | 46083ff49c1e91ed78a905e9e8f374d9a7d7e4be (diff) |
External ampintc interrupts need to add 32 to the interrupt number,
while 'internal' should not. no complaints uwe@ miod@
-rw-r--r-- | sys/arch/beagle/dev/ampintc.c | 15 | ||||
-rw-r--r-- | sys/arch/beagle/dev/amptimer.c | 13 |
2 files changed, 23 insertions, 5 deletions
diff --git a/sys/arch/beagle/dev/ampintc.c b/sys/arch/beagle/dev/ampintc.c index a5a362405bb..6eaf310511c 100644 --- a/sys/arch/beagle/dev/ampintc.c +++ b/sys/arch/beagle/dev/ampintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ampintc.c,v 1.4 2011/11/07 20:25:27 miod Exp $ */ +/* $OpenBSD: ampintc.c,v 1.5 2011/11/09 00:15:06 drahn Exp $ */ /* * Copyright (c) 2007,2009,2011 Dale Rahn <drahn@openbsd.org> * @@ -162,6 +162,8 @@ void ampintc_setipl(int); void ampintc_calc_mask(void); void *ampintc_intr_establish(int, int, int (*)(void *), void *, char *); +void *ampintc_intr_establish_ext(int, int, int (*)(void *), void *, + char *); void ampintc_intr_disestablish(void *); void ampintc_irq_handler(void *); const char *ampintc_intr_string(void *); @@ -279,8 +281,8 @@ ampintc_attach(struct device *parent, struct device *self, void *args) /* insert self as interrupt handler */ arm_set_intr_handler(ampintc_splraise, ampintc_spllower, ampintc_splx, - ampintc_setipl, ampintc_intr_establish, ampintc_intr_disestablish, - ampintc_intr_string, ampintc_irq_handler); + ampintc_setipl, ampintc_intr_establish_ext, + ampintc_intr_disestablish, ampintc_intr_string, ampintc_irq_handler); enable_interrupts(I32_bit); } @@ -515,6 +517,13 @@ ampintc_irq_handler(void *frame) } void * +ampintc_intr_establish_ext(int irqno, int level, int (*func)(void *), + void *arg, char *name) +{ + return ampintc_intr_establish(irqno+32, level, func, arg, name); +} + +void * ampintc_intr_establish(int irqno, int level, int (*func)(void *), void *arg, char *name) { diff --git a/sys/arch/beagle/dev/amptimer.c b/sys/arch/beagle/dev/amptimer.c index 80c5831cfd8..3d0785367d7 100644 --- a/sys/arch/beagle/dev/amptimer.c +++ b/sys/arch/beagle/dev/amptimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amptimer.c,v 1.3 2011/11/06 11:09:21 miod Exp $ */ +/* $OpenBSD: amptimer.c,v 1.4 2011/11/09 00:15:06 drahn Exp $ */ /* * Copyright (c) 2011 Dale Rahn <drahn@openbsd.org> * @@ -79,6 +79,15 @@ void amptimer_cpu_initclocks(void); void amptimer_delay(u_int); void amptimer_setstatclockrate(int stathz); +/* hack - XXXX + * gptimer connects directly to ampintc, not thru the generic + * inteface because it uses an 'internal' interupt + * not a peripheral interrupt. + */ +void *ampintc_intr_establish(int, int, int (*)(void *), void *, char *); + + + struct cfattach amptimer_ca = { sizeof (struct amptimer_softc), amptimer_match, amptimer_attach }; @@ -263,7 +272,7 @@ amptimer_cpu_initclocks() /* establish interrupts */ /* XXX - irq */ - arm_intr_establish(27, IPL_CLOCK, amptimer_intr, + ampintc_intr_establish(27, IPL_CLOCK, amptimer_intr, NULL, "tick"); /* setup timer 0 (hardware timer 2) */ |