This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC2000 nested Interrupts /Realview

Dear People,

I am interested to use the Nested Interrupt in Software in a simple way shown in Examples, but in current RealView Tools it is not possible to access the Registers SP, LR, PSR via Inline Assembly with Assembler Macros.
Macros for GCC and legacy Keil Tools:

// Macros for Interrupt Nesting
#define IENABLE
__asm { MRS LR, SPSR }
__asm { STMFD SP!, {LR} }
__asm { MSR CPSR_c, #0x1F }
__asm { STMFD SP!, {LR} }

#define IDISABLE
__asm { LDMFD SP!, {LR} }
__asm { MSR CPSR_c, #0x92 }
__asm { LDMFD SP!, {LR} }
__asm { MSR SPSR_cxsf, LR }

Instead of the Macros, Mr. Dietmar Wengler developed the following Assembler Functions for Embedded Assembler:

nested_irq_enable:
STMFD SP!, {R0}
MOV R0, LR
MRS LR, SPSR
STMFD SP!, {LR}
MSR CPSR_c, #0x1F
STMFD SP!, {LR}
BX R0

nested_irq_disable:
MOV R0, LR
LDMFD SP!, {LR}
MSR CPSR_c, #0x92
LDMFD SP!, {LR}
MSR SPSR_cxsf, LR
MOV LR, R0
LDMFD SP!, {R0}
BX LR

could you tell me how can i the call the nested_irq_enable and the nested_irq_disable in the c-Code. I use the Realview Compiler.

Thanks.