-#define portSAVE_CONTEXT_REDUCED() \
- { \
- asm __volatile__( \
- /* "sub r1, #0x28" */ /* Prologue generated by the compiler. */ \
- /* "stq r4, [r1]+0x8" */ \
- /* "mov r6, psr" */ \
- /* "mov r7, rtt" */ \
- /* "std r6, [r1]+0x20" */ \
- /* "std r14, [r1]+0x18" */ \
- /* "std r2, [r1]" */ \
- /* "mov r14, r1" */ \
- "sub r1, #0x1c \n" /* Make space on the stack. */ \
- "stq r8, [r1] \n" /* Store the remaining context registers. */ \
- "std r12, [r1]+0x10 \n" \
- "movhi r2, #16384 \n" /* Set the pointer to the IC. */ \
- "ldub r3, [r2]+2 \n" /* Load the current priority level. */ \
- "st r3, [r1]+0x18 \n" /* Store the current priority level on the stack. */ \
- "ldub r3, [r2]+3 \n" /* Load the interrupt priority level. */ \
- "add r3, #1 \n" /* Increase the priority by one. */ \
- "stb r3, [r2]+2 \n" /* Set the current priority level to be above this one. */ \
- "ld r4, [r0]+short(puxInterruptNestingCount) \n" /*[r0]+short(puxInterruptNestingCount) */ \
- "ld r5, [r4] \n" \
- "add r5, #1 \n" /* Increment the interrupt nesting count. */ \
- "st r5, [r4] \n" \
- "cmp r5, #1 \n" /* Is this the first interrupt? */ \
- "bne.s 12 \n" /* If it is then save the stack pointer to the current TCB? */ \
- "ld r2, [r0]+short(pxCurrentTCB) \n" /* Load the pointer to the TCB. */ \
- "st r1, [r2] \n" /* Save the stack pointer into the TCB. */ \
- "ld r1, [r0]+short(puxTopOfInterruptStack) \n" /* Switch to the dedicated interrupt stack. */ /* [r0]+short(uxInterruptStack) */ \
- "mov r14, r1 \n" /* Compiler expects r14 to be set to the function stack. */ \
- "movhi r2, #3 \n" /* Re-enable interrupts (re-enable breakpoints). */ \
- "mov psr, r2 \n" \
- :::"r2","r3","r4","r5","r15" ); /* Clobber list includes all of the caller saved registers so that they are saved as part of the Interrupt handler pre-amble. */ \
- }
+#define portSAVE_CONTEXT() \
+ asm __volatile__( \
+ "sub r1, #0x1c \n" /* Make space on the stack. */ \
+ "stq r8, [r1] \n" /* Store the remaining context registers. */ \
+ "std r12, [r1]+0x10 \n" \
+ "movhi r2, #16384 \n" /* Set the pointer to the IC. */ \
+ "ldub r3, [r2]+2 \n" /* Load the current interrupt mask. */ \
+ "st r3, [r1]+0x18 \n" /* Store the interrupt mask on the stack. */ \
+ "ld r2, [r0]+short(pxCurrentTCB) \n" /* Load the pointer to the TCB. */ \
+ "st r1, [r2] \n" /* Save the stack pointer into the TCB. */ \
+ "mov r14, r1 \n" /* Compiler expects r14 to be set to the function stack. */ \
+ :::"r2","r3","r4","r5","r15" ); /* Clobber list includes all of the caller saved registers so that they are saved as part of the Interrupt handler pre-amble. */