git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1559 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
e515bcf581
commit
a5070b8e57
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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" \
|
||||
|
|
Loading…
Reference in New Issue