Home | History | Annotate | Line # | Download | only in footbridge
footbridge_irqhandler.c revision 1.18
      1  1.18     ad /*	$NetBSD: footbridge_irqhandler.c,v 1.18 2007/12/03 15:33:18 ad Exp $	*/
      2   1.1  chris 
      3   1.1  chris /*
      4   1.7  chris  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
      5   1.1  chris  * All rights reserved.
      6   1.1  chris  *
      7   1.7  chris  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
      8   1.7  chris  *
      9   1.1  chris  * Redistribution and use in source and binary forms, with or without
     10   1.1  chris  * modification, are permitted provided that the following conditions
     11   1.1  chris  * are met:
     12   1.1  chris  * 1. Redistributions of source code must retain the above copyright
     13   1.1  chris  *    notice, this list of conditions and the following disclaimer.
     14   1.1  chris  * 2. Redistributions in binary form must reproduce the above copyright
     15   1.1  chris  *    notice, this list of conditions and the following disclaimer in the
     16   1.1  chris  *    documentation and/or other materials provided with the distribution.
     17   1.1  chris  * 3. All advertising materials mentioning features or use of this software
     18   1.1  chris  *    must display the following acknowledgement:
     19   1.7  chris  *	This product includes software developed for the NetBSD Project by
     20   1.7  chris  *	Wasabi Systems, Inc.
     21   1.7  chris  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22   1.7  chris  *    or promote products derived from this software without specific prior
     23   1.7  chris  *    written permission.
     24   1.1  chris  *
     25   1.7  chris  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26   1.7  chris  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27   1.7  chris  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28   1.7  chris  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29   1.7  chris  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30   1.7  chris  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31   1.7  chris  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32   1.7  chris  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33   1.7  chris  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34   1.7  chris  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35   1.7  chris  * POSSIBILITY OF SUCH DAMAGE.
     36   1.1  chris  */
     37   1.1  chris 
     38   1.6  chris #ifndef ARM_SPL_NOINLINE
     39   1.6  chris #define	ARM_SPL_NOINLINE
     40   1.6  chris #endif
     41   1.6  chris 
     42   1.6  chris #include <sys/cdefs.h>
     43  1.18     ad __KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.18 2007/12/03 15:33:18 ad Exp $");
     44   1.6  chris 
     45   1.1  chris #include "opt_irqstats.h"
     46   1.1  chris 
     47   1.1  chris #include <sys/param.h>
     48   1.1  chris #include <sys/systm.h>
     49   1.1  chris #include <sys/malloc.h>
     50   1.1  chris #include <uvm/uvm_extern.h>
     51   1.1  chris 
     52   1.2   matt #include <machine/intr.h>
     53   1.1  chris #include <machine/cpu.h>
     54   1.6  chris #include <arm/footbridge/dc21285mem.h>
     55   1.6  chris #include <arm/footbridge/dc21285reg.h>
     56   1.6  chris 
     57   1.6  chris #include <dev/pci/pcivar.h>
     58   1.6  chris 
     59   1.6  chris #include "isa.h"
     60   1.6  chris #if NISA > 0
     61   1.6  chris #include <dev/isa/isavar.h>
     62   1.6  chris #endif
     63   1.6  chris 
     64   1.6  chris /* Interrupt handler queues. */
     65   1.6  chris static struct intrq footbridge_intrq[NIRQ];
     66   1.6  chris 
     67   1.6  chris /* Interrupts to mask at each level. */
     68   1.6  chris int footbridge_imask[NIPL];
     69   1.6  chris 
     70   1.6  chris /* Software copy of the IRQs we have enabled. */
     71  1.14  perry volatile uint32_t intr_enabled;
     72   1.1  chris 
     73   1.6  chris /* Current interrupt priority level */
     74  1.14  perry volatile int current_spl_level;
     75   1.1  chris 
     76   1.6  chris /* Interrupts pending */
     77  1.14  perry volatile int footbridge_ipending;
     78   1.3  chris 
     79   1.6  chris void footbridge_intr_dispatch(struct clockframe *frame);
     80   1.1  chris 
     81   1.6  chris const struct evcnt *footbridge_pci_intr_evcnt __P((void *, pci_intr_handle_t));
     82   1.1  chris 
     83   1.6  chris void footbridge_do_pending(void);
     84   1.1  chris 
     85   1.6  chris static const uint32_t si_to_irqbit[SI_NQUEUES] =
     86   1.6  chris 	{ IRQ_SOFTINT,
     87   1.6  chris 	  IRQ_RESERVED0,
     88   1.6  chris 	  IRQ_RESERVED1,
     89   1.6  chris 	  IRQ_RESERVED2 };
     90   1.1  chris 
     91   1.6  chris #define	SI_TO_IRQBIT(si)	(1U << si_to_irqbit[(si)])
     92   1.1  chris 
     93   1.6  chris /*
     94   1.6  chris  * Map a software interrupt queue to an interrupt priority level.
     95   1.6  chris  */
     96   1.6  chris static const int si_to_ipl[SI_NQUEUES] = {
     97   1.6  chris 	IPL_SOFTCLOCK,		/* SI_SOFTCLOCK */
     98  1.18     ad 	IPL_SOFTBIO,		/* SI_SOFTBIO */
     99   1.6  chris 	IPL_SOFTNET,		/* SI_SOFTNET */
    100   1.6  chris 	IPL_SOFTSERIAL,		/* SI_SOFTSERIAL */
    101   1.6  chris };
    102   1.6  chris 
    103   1.6  chris const struct evcnt *
    104   1.6  chris footbridge_pci_intr_evcnt(pcv, ih)
    105   1.6  chris 	void *pcv;
    106   1.6  chris 	pci_intr_handle_t ih;
    107   1.6  chris {
    108   1.6  chris 	/* XXX check range is valid */
    109   1.6  chris #if NISA > 0
    110   1.6  chris 	if (ih >= 0x80 && ih <= 0x8f) {
    111   1.6  chris 		return isa_intr_evcnt(NULL, (ih & 0x0f));
    112   1.6  chris 	}
    113   1.6  chris #endif
    114   1.6  chris 	return &footbridge_intrq[ih].iq_ev;
    115   1.6  chris }
    116   1.6  chris 
    117  1.14  perry static inline void
    118   1.6  chris footbridge_enable_irq(int irq)
    119   1.6  chris {
    120   1.6  chris 	intr_enabled |= (1U << irq);
    121   1.6  chris 
    122   1.6  chris 	footbridge_set_intrmask();
    123   1.1  chris }
    124   1.1  chris 
    125  1.14  perry static inline void
    126   1.6  chris footbridge_disable_irq(int irq)
    127   1.1  chris {
    128   1.6  chris 	intr_enabled &= ~(1U << irq);
    129   1.6  chris 	footbridge_set_intrmask();
    130   1.1  chris }
    131   1.1  chris 
    132   1.1  chris /*
    133   1.6  chris  * NOTE: This routine must be called with interrupts disabled in the CPSR.
    134   1.1  chris  */
    135   1.6  chris static void
    136   1.6  chris footbridge_intr_calculate_masks(void)
    137   1.1  chris {
    138   1.6  chris 	struct intrq *iq;
    139   1.6  chris 	struct intrhand *ih;
    140   1.6  chris 	int irq, ipl;
    141   1.6  chris 
    142   1.6  chris 	/* First, figure out which IPLs each IRQ has. */
    143   1.6  chris 	for (irq = 0; irq < NIRQ; irq++) {
    144   1.6  chris 		int levels = 0;
    145   1.6  chris 		iq = &footbridge_intrq[irq];
    146   1.6  chris 		footbridge_disable_irq(irq);
    147   1.6  chris 		for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
    148   1.6  chris 		     ih = TAILQ_NEXT(ih, ih_list))
    149   1.6  chris 			levels |= (1U << ih->ih_ipl);
    150   1.6  chris 		iq->iq_levels = levels;
    151   1.6  chris 	}
    152   1.1  chris 
    153   1.6  chris 	/* Next, figure out which IRQs are used by each IPL. */
    154   1.6  chris 	for (ipl = 0; ipl < NIPL; ipl++) {
    155   1.6  chris 		int irqs = 0;
    156   1.6  chris 		for (irq = 0; irq < NIRQ; irq++) {
    157   1.6  chris 			if (footbridge_intrq[irq].iq_levels & (1U << ipl))
    158   1.6  chris 				irqs |= (1U << irq);
    159   1.6  chris 		}
    160   1.6  chris 		footbridge_imask[ipl] = irqs;
    161   1.6  chris 	}
    162   1.1  chris 
    163   1.6  chris 	/* IPL_NONE must open up all interrupts */
    164   1.6  chris 	footbridge_imask[IPL_NONE] = 0;
    165   1.1  chris 
    166   1.6  chris 	/*
    167   1.6  chris 	 * Initialize the soft interrupt masks to block themselves.
    168   1.6  chris 	 */
    169   1.6  chris 	footbridge_imask[IPL_SOFTCLOCK] = SI_TO_IRQBIT(SI_SOFTCLOCK);
    170  1.18     ad 	footbridge_imask[IPL_SOFTBIO] = SI_TO_IRQBIT(SI_SOFTBIO);
    171   1.6  chris 	footbridge_imask[IPL_SOFTNET] = SI_TO_IRQBIT(SI_SOFTNET);
    172   1.6  chris 	footbridge_imask[IPL_SOFTSERIAL] = SI_TO_IRQBIT(SI_SOFTSERIAL);
    173   1.1  chris 
    174   1.6  chris 	/*
    175  1.16    wiz 	 * Enforce a hierarchy that gives "slow" device (or devices with
    176   1.6  chris 	 * limited input buffer space/"real-time" requirements) a better
    177   1.6  chris 	 * chance at not dropping data.
    178   1.6  chris 	 */
    179  1.18     ad 	footbridge_imask[IPL_SOFTBIO] |= footbridge_imask[IPL_SOFTCLOCK];
    180  1.18     ad 	footbridge_imask[IPL_SOFTNET] |= footbridge_imask[IPL_SOFTBIO];
    181  1.18     ad 	footbridge_imask[IPL_SOFTSERIAL] |= footbridge_imask[IPL_SOFTNET];
    182  1.18     ad 	footbridge_imask[IPL_VM] |= footbridge_imask[IPL_SOFTSERIAL];
    183  1.18     ad 	footbridge_imask[IPL_SCHED] |= footbridge_imask[IPL_VM];
    184  1.18     ad 	footbridge_imask[IPL_HIGH] |= footbridge_imask[IPL_SCHED];
    185   1.1  chris 
    186   1.1  chris 	/*
    187   1.6  chris 	 * Calculate the ipl level to go to when handling this interrupt
    188   1.6  chris 	 */
    189   1.6  chris 	for (irq = 0; irq < NIRQ; irq++) {
    190   1.6  chris 		int irqs = (1U << irq);
    191   1.6  chris 		iq = &footbridge_intrq[irq];
    192   1.6  chris 		if (TAILQ_FIRST(&iq->iq_list) != NULL)
    193   1.6  chris 			footbridge_enable_irq(irq);
    194   1.6  chris 		for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
    195   1.6  chris 		     ih = TAILQ_NEXT(ih, ih_list))
    196   1.6  chris 			irqs |= footbridge_imask[ih->ih_ipl];
    197   1.6  chris 		iq->iq_mask = irqs;
    198   1.1  chris 	}
    199   1.6  chris }
    200   1.6  chris 
    201   1.6  chris int
    202   1.6  chris _splraise(int ipl)
    203   1.6  chris {
    204   1.6  chris     return (footbridge_splraise(ipl));
    205   1.6  chris }
    206   1.1  chris 
    207   1.6  chris /* this will always take us to the ipl passed in */
    208   1.6  chris void
    209   1.6  chris splx(int new)
    210   1.6  chris {
    211   1.6  chris     footbridge_splx(new);
    212   1.6  chris }
    213   1.1  chris 
    214   1.6  chris int
    215   1.6  chris _spllower(int ipl)
    216   1.6  chris {
    217   1.6  chris     return (footbridge_spllower(ipl));
    218   1.1  chris }
    219   1.1  chris 
    220  1.15    mrg void
    221   1.6  chris footbridge_do_pending(void)
    222   1.6  chris {
    223   1.6  chris 	static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED;
    224   1.6  chris 	uint32_t new, oldirqstate;
    225   1.1  chris 
    226   1.6  chris 	if (__cpu_simple_lock_try(&processing) == 0)
    227   1.6  chris 		return;
    228   1.1  chris 
    229   1.6  chris 	new = current_spl_level;
    230   1.6  chris 
    231   1.6  chris 	oldirqstate = disable_interrupts(I32_bit);
    232   1.1  chris 
    233  1.18     ad #ifdef __HAVE_FAST_SOFTINTS
    234   1.6  chris #define	DO_SOFTINT(si)							\
    235   1.6  chris 	if ((footbridge_ipending & ~new) & SI_TO_IRQBIT(si)) {		\
    236   1.6  chris 		footbridge_ipending &= ~SI_TO_IRQBIT(si);		\
    237   1.6  chris 		current_spl_level |= footbridge_imask[si_to_ipl[(si)]];	\
    238   1.6  chris 		restore_interrupts(oldirqstate);			\
    239   1.6  chris 		softintr_dispatch(si);					\
    240   1.6  chris 		oldirqstate = disable_interrupts(I32_bit);		\
    241   1.6  chris 		current_spl_level = new;				\
    242   1.1  chris 	}
    243   1.6  chris 	DO_SOFTINT(SI_SOFTSERIAL);
    244   1.6  chris 	DO_SOFTINT(SI_SOFTNET);
    245   1.6  chris 	DO_SOFTINT(SI_SOFTCLOCK);
    246   1.6  chris 	DO_SOFTINT(SI_SOFT);
    247  1.18     ad #endif
    248   1.6  chris 	__cpu_simple_unlock(&processing);
    249   1.1  chris 
    250   1.6  chris 	restore_interrupts(oldirqstate);
    251   1.6  chris }
    252   1.1  chris 
    253   1.1  chris 
    254   1.6  chris /* called from splhigh, so the matching splx will set the interrupt up.*/
    255   1.6  chris void
    256   1.6  chris _setsoftintr(int si)
    257   1.6  chris {
    258   1.6  chris 	int oldirqstate;
    259   1.1  chris 
    260   1.6  chris 	oldirqstate = disable_interrupts(I32_bit);
    261   1.6  chris 	footbridge_ipending |= SI_TO_IRQBIT(si);
    262   1.6  chris 	restore_interrupts(oldirqstate);
    263   1.1  chris 
    264   1.6  chris 	/* Process unmasked pending soft interrupts. */
    265   1.6  chris 	if ((footbridge_ipending & INT_SWMASK) & ~current_spl_level)
    266   1.6  chris 		footbridge_do_pending();
    267   1.1  chris }
    268   1.1  chris 
    269   1.6  chris void
    270   1.6  chris footbridge_intr_init(void)
    271   1.6  chris {
    272   1.6  chris 	struct intrq *iq;
    273   1.6  chris 	int i;
    274   1.6  chris 
    275   1.6  chris 	intr_enabled = 0;
    276   1.6  chris 	current_spl_level = 0xffffffff;
    277   1.6  chris 	footbridge_ipending = 0;
    278   1.6  chris 	footbridge_set_intrmask();
    279   1.6  chris 
    280   1.6  chris 	for (i = 0; i < NIRQ; i++) {
    281   1.6  chris 		iq = &footbridge_intrq[i];
    282   1.6  chris 		TAILQ_INIT(&iq->iq_list);
    283   1.6  chris 
    284   1.6  chris 		sprintf(iq->iq_name, "irq %d", i);
    285   1.6  chris 		evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
    286   1.6  chris 		    NULL, "footbridge", iq->iq_name);
    287   1.6  chris 	}
    288   1.6  chris 
    289   1.6  chris 	footbridge_intr_calculate_masks();
    290   1.6  chris 
    291   1.6  chris 	/* Enable IRQ's, we don't have any FIQ's*/
    292   1.6  chris 	enable_interrupts(I32_bit);
    293   1.6  chris }
    294   1.1  chris 
    295   1.1  chris void *
    296  1.12     he footbridge_intr_claim(int irq, int ipl, const char *name, int (*func)(void *), void *arg)
    297   1.1  chris {
    298   1.6  chris 	struct intrq *iq;
    299   1.6  chris 	struct intrhand *ih;
    300   1.6  chris 	u_int oldirqstate;
    301   1.6  chris 
    302   1.6  chris 	if (irq < 0 || irq > NIRQ)
    303   1.6  chris 		panic("footbridge_intr_establish: IRQ %d out of range", irq);
    304   1.1  chris 
    305   1.1  chris 	ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
    306   1.6  chris 	if (ih == NULL)
    307   1.6  chris 	{
    308   1.6  chris 		printf("No memory");
    309   1.6  chris 		return (NULL);
    310   1.6  chris 	}
    311   1.6  chris 
    312   1.6  chris 	ih->ih_func = func;
    313   1.6  chris 	ih->ih_arg = arg;
    314   1.6  chris 	ih->ih_ipl = ipl;
    315   1.6  chris 	ih->ih_irq = irq;
    316   1.6  chris 
    317   1.6  chris 	iq = &footbridge_intrq[irq];
    318   1.1  chris 
    319   1.6  chris 	iq->iq_ist = IST_LEVEL;
    320   1.1  chris 
    321   1.6  chris 	oldirqstate = disable_interrupts(I32_bit);
    322   1.6  chris 
    323   1.6  chris 	TAILQ_INSERT_TAIL(&iq->iq_list, ih, ih_list);
    324   1.6  chris 
    325   1.6  chris 	footbridge_intr_calculate_masks();
    326   1.6  chris 
    327   1.6  chris 	/* detach the existing event counter and add the new name */
    328   1.6  chris 	evcnt_detach(&iq->iq_ev);
    329   1.6  chris 	evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
    330   1.6  chris 			NULL, "footbridge", name);
    331   1.6  chris 
    332   1.6  chris 	restore_interrupts(oldirqstate);
    333   1.6  chris 
    334   1.1  chris 	return(ih);
    335   1.1  chris }
    336   1.1  chris 
    337   1.6  chris void
    338   1.6  chris footbridge_intr_disestablish(void *cookie)
    339   1.6  chris {
    340   1.6  chris 	struct intrhand *ih = cookie;
    341   1.6  chris 	struct intrq *iq = &footbridge_intrq[ih->ih_irq];
    342   1.6  chris 	int oldirqstate;
    343   1.6  chris 
    344   1.6  chris 	/* XXX need to free ih ? */
    345   1.6  chris 	oldirqstate = disable_interrupts(I32_bit);
    346   1.1  chris 
    347   1.6  chris 	TAILQ_REMOVE(&iq->iq_list, ih, ih_list);
    348   1.6  chris 
    349   1.6  chris 	footbridge_intr_calculate_masks();
    350   1.6  chris 
    351   1.6  chris 	restore_interrupts(oldirqstate);
    352   1.6  chris }
    353   1.6  chris 
    354   1.6  chris static uint32_t footbridge_intstatus(void);
    355   1.6  chris 
    356   1.6  chris static inline uint32_t footbridge_intstatus()
    357   1.6  chris {
    358  1.14  perry     return ((volatile uint32_t*)(DC21285_ARMCSR_VBASE))[IRQ_STATUS>>2];
    359   1.6  chris }
    360   1.6  chris 
    361   1.6  chris /* called with external interrupts disabled */
    362   1.6  chris void
    363   1.6  chris footbridge_intr_dispatch(struct clockframe *frame)
    364   1.1  chris {
    365   1.6  chris 	struct intrq *iq;
    366   1.6  chris 	struct intrhand *ih;
    367   1.6  chris 	int oldirqstate, pcpl, irq, ibit, hwpend;
    368   1.6  chris 
    369   1.6  chris 	pcpl = current_spl_level;
    370   1.6  chris 
    371   1.6  chris 	hwpend = footbridge_intstatus();
    372   1.6  chris 
    373   1.6  chris 	/*
    374   1.6  chris 	 * Disable all the interrupts that are pending.  We will
    375   1.6  chris 	 * reenable them once they are processed and not masked.
    376   1.6  chris 	 */
    377   1.6  chris 	intr_enabled &= ~hwpend;
    378   1.6  chris 	footbridge_set_intrmask();
    379   1.1  chris 
    380   1.6  chris 	while (hwpend != 0) {
    381   1.6  chris 		int intr_rc = 0;
    382   1.6  chris 		irq = ffs(hwpend) - 1;
    383   1.6  chris 		ibit = (1U << irq);
    384   1.6  chris 
    385   1.6  chris 		hwpend &= ~ibit;
    386   1.6  chris 
    387   1.6  chris 		if (pcpl & ibit) {
    388   1.6  chris 			/*
    389   1.6  chris 			 * IRQ is masked; mark it as pending and check
    390   1.6  chris 			 * the next one.  Note: the IRQ is already disabled.
    391   1.6  chris 			 */
    392   1.6  chris 			footbridge_ipending |= ibit;
    393   1.6  chris 			continue;
    394   1.6  chris 		}
    395   1.6  chris 
    396   1.6  chris 		footbridge_ipending &= ~ibit;
    397   1.6  chris 
    398   1.6  chris 		iq = &footbridge_intrq[irq];
    399   1.6  chris 		iq->iq_ev.ev_count++;
    400   1.6  chris 		uvmexp.intrs++;
    401   1.6  chris 		current_spl_level |= iq->iq_mask;
    402   1.6  chris 		oldirqstate = enable_interrupts(I32_bit);
    403   1.6  chris 		for (ih = TAILQ_FIRST(&iq->iq_list);
    404   1.6  chris 			((ih != NULL) && (intr_rc != 1));
    405   1.6  chris 		     ih = TAILQ_NEXT(ih, ih_list)) {
    406   1.6  chris 			intr_rc = (*ih->ih_func)(ih->ih_arg ? ih->ih_arg : frame);
    407   1.6  chris 		}
    408   1.6  chris 		restore_interrupts(oldirqstate);
    409   1.6  chris 
    410   1.6  chris 		current_spl_level = pcpl;
    411   1.6  chris 
    412   1.6  chris 		/* Re-enable this interrupt now that's it's cleared. */
    413   1.6  chris 		intr_enabled |= ibit;
    414   1.6  chris 		footbridge_set_intrmask();
    415  1.10   matt 
    416  1.11    wiz 		/* also check for any new interrupts that may have occurred,
    417  1.10   matt 		 * that we can handle at this spl level */
    418  1.10   matt 		hwpend |= (footbridge_ipending & ICU_INT_HWMASK) & ~pcpl;
    419   1.1  chris 	}
    420   1.6  chris 
    421  1.10   matt 	/* Check for pendings soft intrs. */
    422  1.10   matt         if ((footbridge_ipending & INT_SWMASK) & ~current_spl_level) {
    423  1.10   matt 	    /*
    424  1.10   matt 	     * XXX this feels the wrong place to enable irqs, as some
    425  1.10   matt 	     * soft ints are higher priority than hardware irqs
    426  1.10   matt 	     */
    427  1.10   matt                 oldirqstate = enable_interrupts(I32_bit);
    428  1.10   matt                 footbridge_do_pending();
    429  1.10   matt                 restore_interrupts(oldirqstate);
    430  1.10   matt         }
    431   1.1  chris }
    432