litex/software/bios/isr.c

29 lines
489 B
C
Raw Normal View History

#include <generated/csr.h>
2012-02-05 14:01:28 -05:00
#include <irq.h>
#include <uart.h>
2012-02-05 14:01:28 -05:00
2012-02-07 07:02:06 -05:00
void isr(void);
2012-02-05 14:01:28 -05:00
void isr(void)
{
unsigned int irqs;
2012-02-05 14:01:28 -05:00
irqs = irq_pending() & irq_getmask();
2012-05-21 13:52:41 -04:00
if(irqs & (1 << UART_INTERRUPT))
uart_isr();
2012-02-05 14:01:28 -05:00
}
#ifdef __or1k__
#define EXTERNAL_IRQ 0x800
void exception_handler(unsigned long vect, unsigned long *sp);
void exception_handler(unsigned long vect, unsigned long *sp)
{
if ((vect & 0xf00) == EXTERNAL_IRQ) {
isr();
} else {
/* Unhandled exception */
for(;;);
}
}
#endif