From ec36599e62379bb43d164a039e1e5a5b17bc131c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 7 Apr 2010 11:54:32 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1857 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/chcore_v7m.c | 38 -------------------------------- os/ports/GCC/ARMCMx/chcore_v7m.h | 3 +-- readme.txt | 1 + 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.c b/os/ports/GCC/ARMCMx/chcore_v7m.c index d199afdad..c8b2f3af6 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.c +++ b/os/ports/GCC/ARMCMx/chcore_v7m.c @@ -53,43 +53,6 @@ void SysTickVector(void) { chSysUnlockFromIsr(); } -#if CORTEX_MODEL == CORTEX_M0 -#define PUSH_CONTEXT(sp, prio) { \ - asm volatile ("mrs %0, PSP \n\t" \ - "sub %0, %0, #40 \n\t" \ - "stmia %0!, {r3-r7} \n\t" \ - "sub %0, %0, #20 \n\t" \ - "mov r3, r8 \n\t" \ - "str r3, [%0, #20] \n\t" \ - "mov r3, r9 \n\t" \ - "str r3, [%0, #24] \n\t" \ - "mov r3, r10 \n\t" \ - "str r3, [%0, #28] \n\t" \ - "mov r3, r11 \n\t" \ - "str r3, [%0, #32] \n\t" \ - "mov r3, lr \n\t" \ - "str r3, [%0, #36] \n\t" \ - : "=r" (sp) : "r" (sp), "r" (prio)); \ -} - -#define POP_CONTEXT(sp) { \ - asm volatile ("ldr r3, [%0, #20] \n\t" \ - "mov r8, r3 \n\t" \ - "ldr r3, [%0, #24] \n\t" \ - "mov r9, r3 \n\t" \ - "ldr r3, [%0, #28] \n\t" \ - "mov r10, r3 \n\t" \ - "ldr r3, [%0, #32] \n\t" \ - "mov r11, r3 \n\t" \ - "ldr r3, [%0, #36] \n\t" \ - "mov lr, r3 \n\t" \ - "ldmia %0!, {r3-r7} \n\t" \ - "add %0, %0, #20 \n\t" \ - "msr PSP, %0 \n\t" \ - "msr BASEPRI, r3 \n\t" \ - "bx lr" : "=r" (sp) : "r" (sp)); \ -} -#else /* CORTEX_MODEL != CORTEX_M0 */ #if !defined(CH_CURRP_REGISTER_CACHE) #define PUSH_CONTEXT(sp, prio) { \ asm volatile ("mrs %0, PSP \n\t" \ @@ -117,7 +80,6 @@ void SysTickVector(void) { "bx lr" : "=r" (sp) : "r" (sp)); \ } #endif /* defined(CH_CURRP_REGISTER_CACHE) */ -#endif /* CORTEX_MODEL != CORTEX_M0 */ /** * @brief SVC vector. diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h index b575376ea..150fa41fa 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/chcore_v7m.h @@ -263,7 +263,7 @@ struct intctx { * @param[in] ntp the thread to be switched in * @param[in] otp the thread to be switched out */ -static INLINE Thread *port_switch(Thread *ntp, Thread *otp) { +static INLINE void port_switch(Thread *ntp, Thread *otp) { register Thread *_ntp asm ("r0") = (ntp); register Thread *_otp asm ("r1") = (otp); #if CH_DBG_ENABLE_STACK_CHECK @@ -273,7 +273,6 @@ static INLINE Thread *port_switch(Thread *ntp, Thread *otp) { "b chDbgPanic"); #endif /* CH_DBG_ENABLE_STACK_CHECK */ asm volatile ("svc #0" : : "r" (_otp), "r" (_ntp) : "memory"); - return _otp; } #ifdef __cplusplus diff --git a/readme.txt b/readme.txt index e5f841b8d..f801c28a2 100644 --- a/readme.txt +++ b/readme.txt @@ -57,6 +57,7 @@ ***************************************************************************** *** 1.5.5 *** +- FIX: Removed some "dead" code in the ARMv7-M files. - NEW: LPC13xx support, drivers (Serial, PAL, HAL) and demo. - CHANGE: Renamed LPC111x port and platform in LPC11xx.