32 #define _IRQ_HANDLER(IRQ) \
33 irq ## IRQ ## Handler()
47 #define IRQ_HANDLER(IRQ) _IRQ_HANDLER(IRQ)
64 asm volatile (
"mvi r15, 0;"
75 static inline __attribute__ ((always_inline)) void
__irqEnable()
77 asm volatile (
"mvi r15, 1;"
84 static inline bool __isIrqEnable()
89 asm volatile (
"rcsr %0, ie ;"
93 return (r & 0x1) != 0;
161 __asm__(
"rcsr %0, cc" :
"=r" (cc));
172 extern uint32_t _end;
173 extern const uint8_t _ram_offset;
174 extern const uint8_t _ram_size;
175 extern const uint8_t _rom_offset;
176 extern const uint8_t _rom_end;
177 extern const uint8_t _rom_size;
186 return (uint32_t)&_ram_size;
196 uint32_t end = (uint32_t)&_end;
197 uint32_t start = (uint32_t)&_ram_offset;
209 return (uint32_t)&_rom_size;
220 uint32_t start = (uint32_t)&_rom_offset;
221 uint32_t end = (uint32_t)&_rom_end;
static uint32_t romUsed()
Get the ROM used by code, variables and constants.
static void __irqEnable()
Enabled IRQ's on a global level.
static uint32_t ramUsed()
Get the RAM used by variables (excluding stack).
static void __irqDisable()
Disables IRQ's on a global level.
static uint32_t cycCount()
Returns the value of the cycle counter.
void irqMaskSet(int irq, bool set)
Set/clear the interrupt mask for the specified IRQ.
static uint32_t romSize()
Get the of the ROM.
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.
static void __nop()
No-operation.
static uint32_t ramSize()
Get the of the RAM.