2013-11-24 13:50:17 -05:00
|
|
|
#include <generated/csr.h>
|
2012-02-05 14:01:28 -05:00
|
|
|
#include <irq.h>
|
2012-02-06 17:53:29 -05:00
|
|
|
#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-06 17:53:29 -05:00
|
|
|
|
2012-02-05 14:01:28 -05:00
|
|
|
irqs = irq_pending() & irq_getmask();
|
2012-02-06 17:53:29 -05:00
|
|
|
|
2012-05-21 13:52:41 -04:00
|
|
|
if(irqs & (1 << UART_INTERRUPT))
|
2012-02-06 17:53:29 -05:00
|
|
|
uart_isr();
|
2012-02-05 14:01:28 -05:00
|
|
|
}
|
2014-05-14 04:24:56 -04: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
|