aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-02-02 21:25:04 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-02-02 21:25:04 +0000
commita5070b8e577dee21b30c7ef6918133344787f997 (patch)
tree9fb3323d9b91ca1c022396ead6413cc0c59b4c0a
parente515bcf581c92643c21eb6ed53ba0d0b1604fe4b (diff)
downloadChibiOS-a5070b8e577dee21b30c7ef6918133344787f997.tar.gz
ChibiOS-a5070b8e577dee21b30c7ef6918133344787f997.tar.bz2
ChibiOS-a5070b8e577dee21b30c7ef6918133344787f997.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1559 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/ports/GCC/ARM7/chcoreasm.s4
-rw-r--r--os/ports/GCC/AVR/chcore.c22
-rw-r--r--os/ports/GCC/SIMIA32/chcore.c4
3 files changed, 7 insertions, 23 deletions
diff --git a/os/ports/GCC/ARM7/chcoreasm.s b/os/ports/GCC/ARM7/chcoreasm.s
index 93a8ceb2a..e172e3455 100644
--- a/os/ports/GCC/ARM7/chcoreasm.s
+++ b/os/ports/GCC/ARM7/chcoreasm.s
@@ -115,8 +115,8 @@ _port_switch_arm:
#endif /* !THUMB_PRESENT */
#else /* !CH_CURRP_REGISTER_CACHE */
stmfd sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
- str sp, [r0, #16]
- ldr sp, [r1, #16]
+ str sp, [r0, #12]
+ ldr sp, [r1, #12]
#ifdef THUMB_PRESENT
ldmfd sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
bx lr
diff --git a/os/ports/GCC/AVR/chcore.c b/os/ports/GCC/AVR/chcore.c
index e99c2b970..6662b5199 100644
--- a/os/ports/GCC/AVR/chcore.c
+++ b/os/ports/GCC/AVR/chcore.c
@@ -59,33 +59,17 @@ void port_switch(Thread *otp, Thread *ntp) {
asm volatile ("push r28");
asm volatile ("push r29");
- /* This is required because the context offset changes if CH_USE_DYNAMIC
- is activated.*/
-#if CH_USE_DYNAMIC
asm volatile ("movw r30, r24");
asm volatile ("in r0, 0x3d");
- asm volatile ("std Z+8, r0");
+ asm volatile ("std Z+6, r0");
asm volatile ("in r0, 0x3e");
- asm volatile ("std Z+9, r0");
-
- asm volatile ("movw r30, r22");
- asm volatile ("ldd r0, Z+8");
- asm volatile ("out 0x3d, r0");
- asm volatile ("ldd r0, Z+9");
- asm volatile ("out 0x3e, r0");
-#else /* !CH_USE_DYNAMIC */
- asm volatile ("movw r30, r24");
- asm volatile ("in r0, 0x3d");
asm volatile ("std Z+7, r0");
- asm volatile ("in r0, 0x3e");
- asm volatile ("std Z+8, r0");
asm volatile ("movw r30, r22");
- asm volatile ("ldd r0, Z+7");
+ asm volatile ("ldd r0, Z+6");
asm volatile ("out 0x3d, r0");
- asm volatile ("ldd r0, Z+8");
+ asm volatile ("ldd r0, Z+7");
asm volatile ("out 0x3e, r0");
-#endif /* !CH_USE_DYNAMIC */
asm volatile ("pop r29");
asm volatile ("pop r28");
diff --git a/os/ports/GCC/SIMIA32/chcore.c b/os/ports/GCC/SIMIA32/chcore.c
index 6fe0725dd..2cacd7b65 100644
--- a/os/ports/GCC/SIMIA32/chcore.c
+++ b/os/ports/GCC/SIMIA32/chcore.c
@@ -46,8 +46,8 @@ static void __dummy(Thread *otp, Thread *ntp) {
"push %esi \n\t" \
"push %edi \n\t" \
"push %ebx \n\t" \
- "movl %esp, 16(%ecx) \n\t" \
- "movl 16(%edx), %esp \n\t" \
+ "movl %esp, 12(%ecx) \n\t" \
+ "movl 12(%edx), %esp \n\t" \
"pop %ebx \n\t" \
"pop %edi \n\t" \
"pop %esi \n\t" \