15 X(0) X(1) X(2) X(3) X(4) X(5) X(6) X(7) X(8) X(9) \
16 X(10) X(11) X(12) X(13) X(14) X(15)
21 #define X(IRQ) void irq ## IRQ ## Handler() __attribute__((weak));
26 #define IRQ_HI(IRQ) ( ( ( 1 << IRQ ) && ( 0xFFFF0000 ) ) >> 16 )
34 void _handle_irq(uint32_t * sp)
52 if ((ip & (1 << IRQ) ) && irq ## IRQ ## Handler) { \
54 "ori r15, r0, " STR(1 << IRQ) ";" \
57 irq ## IRQ ## Handler(); \
65 asm volatile (
"wcsr ip, %0" : :
"r"(ip));
71 void _handle_sys_error(uint32_t syserr)
79 uint32_t mask = 1 << irq;
108 asm (
"rcsr %0, im;" :
"=r" (im) );
109 return ( im & (1 << irq) ) != 0;
118 "bi _reset_handler ;"
Defines the configuration of the LM32 SOC for the CLBv2.
Low level routines for LM32, including interrupt handling.
void irqMaskSet(int irq, bool set)
Set/clear the interrupt mask for the specified IRQ.
bool irqMaskGet(int irq)
Returns the current IRQ mask for the specified IRQ.
uint32_t * pState
Program state before IRQ.
void reboot()
Soft reboot the LM32.
volatile bool inIrqContext
Returns whether or not we're in an IRQ context.