/*
* The following marcos are from the file "armVIC.h" by:
*
* Copyright 2004, R O SoftWare
* No guarantees, warrantees, or promises, implied or otherwise.
* May be used for hobby or commercial purposes provided copyright
* notice remains intact.
* */
/**
* \def ISR_ENTRY
* This MACRO is used upon entry to an ISR.  The current version of
* the gcc compiler for ARM does not produce correct code for
* interrupt routines to operate properly with THUMB code.  The MACRO
* performs the following steps.
* */
#define ISR_ENTRY() asm volatile(" sub   lr, lr,#4\n" \
                                " stmfd sp!,{r0-r12,lr}\n" \
                                " mrs   r1, spsr\n" \
                                " stmfd sp!,{r1}")

/**
* \def ISR_EXIT
* This MACRO is used to exit an ISR.  The current version of the gcc
* compiler for ARM does not produce correct code for interrupt
* routines to operate properly with THUMB code.  The MACRO performs
* the following steps.
* */
#define ISR_EXIT()  asm volatile(" ldmfd sp!,{r1}\n" \
                                " msr   spsr_c,r1\n" \
                                " ldmfd sp!,{r0-r12,pc}^")

