mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software: factorize exception_handler
This commit is contained in:
parent
edf567a0cd
commit
13e74b8b4f
3 changed files with 18 additions and 15 deletions
|
@ -12,17 +12,3 @@ void isr(void)
|
|||
if(irqs & (1 << UART_INTERRUPT))
|
||||
uart_isr();
|
||||
}
|
||||
|
||||
#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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
MSCDIR=../..
|
||||
include $(MSCDIR)/software/common.mak
|
||||
|
||||
OBJECTS=setjmp-$(CPU).o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o time.o qsort.o strtod.o
|
||||
OBJECTS=setjmp-$(CPU).o exception.o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o time.o qsort.o strtod.o
|
||||
|
||||
all: crt0-$(CPU).o libbase.a libbase-nofloat.a
|
||||
|
||||
|
|
17
software/libbase/exception.c
Normal file
17
software/libbase/exception.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
void isr(void);
|
||||
|
||||
#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
|
Loading…
Reference in a new issue