diff --git a/ports/ARM7/chcore.h b/ports/ARM7/chcore.h index 2917428f3..d03d6aaba 100644 --- a/ports/ARM7/chcore.h +++ b/ports/ARM7/chcore.h @@ -94,6 +94,8 @@ extern void chSysUnlock(void); #define WorkingArea(s, n) ULONG32 s[UserStackSize(n) >> 2]; #ifdef THUMB +#define chSysSwitchI chSysSwitchI_thumb + #define chSysIRQEnterI() { \ asm(".code 32 \n\t" \ "stmfd sp!, {r0-r3, r12, lr} \n\t" \ @@ -107,6 +109,8 @@ extern void chSysUnlock(void); "bx r0 \n\t"); \ } #else /* !THUMB */ +#define chSysSwitchI chSysSwitchI_arm + #define chSysIRQEnterI() { \ asm("stmfd sp!, {r0-r3, r12, lr} \n\t"); \ } @@ -116,10 +120,6 @@ extern void chSysUnlock(void); } #endif /* !THUMB */ -#ifdef THUMB -#define chSysSwitchI chSysSwitchI_thumb -#endif /* THUMB */ - /* It requires zero bytes, but better be safe.*/ #define IDLE_THREAD_STACK_SIZE 8 void _IdleThread(void *p) __attribute__((noreturn)); diff --git a/ports/ARM7/chsys.s b/ports/ARM7/chsys.s index 770edaaec..d1de7d100 100644 --- a/ports/ARM7/chsys.s +++ b/ports/ARM7/chsys.s @@ -75,8 +75,8 @@ chSysSwitchI_thumb: // Jumps into chSysSwitchI in ARM mode #endif .code 32 -.global chSysSwitchI -chSysSwitchI: +.global chSysSwitchI_arm +chSysSwitchI_arm: #ifdef CH_CURRP_REGISTER_CACHE stmfd sp!, {r4, r5, r6, r8, r9, r10, r11, lr} str sp, [r0, #16] @@ -112,8 +112,8 @@ chSysSwitchI: * | R2 | | External context: IRQ handler frame * | R1 | | * | R0 | | - * | LR_IRQ | | (user code return address) - * | SPSR | -+ (user code status) + * | PC | | (user code return address) + * | PSR_USR | -+ (user code status) * | .... | <- mk_DoRescheduleI() stack frame, optimize it for space * | LR | -+ (system code return address) * | R11 | | diff --git a/readme.txt b/readme.txt index 8d15bd76d..3c437155a 100644 --- a/readme.txt +++ b/readme.txt @@ -102,7 +102,7 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet. behavior). Note: This option brings a small overhead when sending a message regardless if in FIFO or priority order, if you dont need priority ordering for your - messages it is better to keep disabled the feature in chconf.h. + messages it is better to keep the feature disabled in chconf.h. - Added to the ARM demos load scripts the capability to load code in RAM instead flash, the function must be marked as: __attribute__((section(".ramtext")))