diff options
author | Joel Bodenmann <joel@embedded.pro> | 2016-12-12 20:02:34 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@embedded.pro> | 2016-12-12 20:02:34 +0100 |
commit | 0ab0e28bdba00297618b6ed1358970b8745e43ed (patch) | |
tree | 9434c6b20c87fb2e577f464ff289d03dc42781a6 | |
parent | d80bd18157a5550642fa5eec8d09700b6e70833a (diff) | |
download | uGFX-0ab0e28bdba00297618b6ed1358970b8745e43ed.tar.gz uGFX-0ab0e28bdba00297618b6ed1358970b8745e43ed.tar.bz2 uGFX-0ab0e28bdba00297618b6ed1358970b8745e43ed.zip |
Cleaning up raw32 thread context switching functions (use consistent coding style)
-rw-r--r-- | src/gos/gos_x_threads_cortexm01.h | 20 | ||||
-rw-r--r-- | src/gos/gos_x_threads_cortexm347.h | 20 | ||||
-rw-r--r-- | src/gos/gos_x_threads_cortexm47fp.h | 20 |
3 files changed, 30 insertions, 30 deletions
diff --git a/src/gos/gos_x_threads_cortexm01.h b/src/gos/gos_x_threads_cortexm01.h index 8a44bd35..b646d083 100644 --- a/src/gos/gos_x_threads_cortexm01.h +++ b/src/gos/gos_x_threads_cortexm01.h @@ -83,9 +83,9 @@ static __asm void _gfxStartThread(thread *oldt, thread *newt) { // Calculate where to generate the new context // newt->cxt = (char *)newt + newt->size; - ldr r2,[r1,#__cpp(offsetof(thread,size))] - add r2,r2,r1 - str r2,[r1,#__cpp(offsetof(thread,cxt))] + ldr r2,[r1,#__cpp(offsetof(thread,size))] + add r2,r2,r1 + str r2,[r1,#__cpp(offsetof(thread,cxt))] // Save the old context push {r4, r5, r6, r7, lr} @@ -101,13 +101,13 @@ // Run the users function - we save some code because gfxThreadExit() never returns // gfxThreadExit(_gfxCurrentThread->fn(_gfxCurrentThread->param)); - LDR r2,__cpp(&_gfxCurrentThread) - LDR r2,[r2,#0] - LDR r0,[r2,#__cpp(offsetof(thread,param))] - LDR r1,[r2,#__cpp(offsetof(thread,fn))] - BLX r1 - MOV r4,r0 - BL gfxThreadExit + ldr r2,__cpp(&_gfxCurrentThread) + ldr r2,[r2,#0] + ldr r0,[r2,#__cpp(offsetof(thread,param))] + ldr r1,[r2,#__cpp(offsetof(thread,fn))] + blx r1 + mov r4,r0 + bl gfxThreadExit } #else diff --git a/src/gos/gos_x_threads_cortexm347.h b/src/gos/gos_x_threads_cortexm347.h index 03c13052..13893d3d 100644 --- a/src/gos/gos_x_threads_cortexm347.h +++ b/src/gos/gos_x_threads_cortexm347.h @@ -59,9 +59,9 @@ static __asm void _gfxStartThread(thread *oldt, thread *newt) { // Calculate where to generate the new context // newt->cxt = (char *)newt + newt->size; - ldr r2,[r1,#__cpp(offsetof(thread,size))] - add r2,r2,r1 - str r2,[r1,#__cpp(offsetof(thread,cxt))] + ldr r2,[r1,#__cpp(offsetof(thread,size))] + add r2,r2,r1 + str r2,[r1,#__cpp(offsetof(thread,cxt))] // Save the old context push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -72,13 +72,13 @@ // Run the users function - we save some code because gfxThreadExit() never returns // gfxThreadExit(_gfxCurrentThread->fn(_gfxCurrentThread->param)); - LDR r2,__cpp(&_gfxCurrentThread) - LDR r2,[r2,#0] - LDR r0,[r2,#__cpp(offsetof(thread,param))] - LDR r1,[r2,#__cpp(offsetof(thread,fn))] - BLX r1 - MOV r4,r0 - BL gfxThreadExit + ldr r2,__cpp(&_gfxCurrentThread) + ldr r2,[r2,#0] + ldr r0,[r2,#__cpp(offsetof(thread,param))] + ldr r1,[r2,#__cpp(offsetof(thread,fn))] + blx r1 + mov r4,r0 + bl gfxThreadExit } #else diff --git a/src/gos/gos_x_threads_cortexm47fp.h b/src/gos/gos_x_threads_cortexm47fp.h index 9767ac9a..2ee98eaf 100644 --- a/src/gos/gos_x_threads_cortexm47fp.h +++ b/src/gos/gos_x_threads_cortexm47fp.h @@ -63,9 +63,9 @@ static __asm void _gfxStartThread(thread *oldt, thread *newt) { // Calculate where to generate the new context // newt->cxt = (char *)newt + newt->size; - ldr r2,[r1,#__cpp(offsetof(thread,size))] - add r2,r2,r1 - str r2,[r1,#__cpp(offsetof(thread,cxt))] + ldr r2,[r1,#__cpp(offsetof(thread,size))] + add r2,r2,r1 + str r2,[r1,#__cpp(offsetof(thread,cxt))] // Save the old context push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -77,13 +77,13 @@ // Run the users function - we save some code because gfxThreadExit() never returns // gfxThreadExit(_gfxCurrentThread->fn(_gfxCurrentThread->param)); - LDR r2,__cpp(&_gfxCurrentThread) - LDR r2,[r2,#0] - LDR r0,[r2,#__cpp(offsetof(thread,param))] - LDR r1,[r2,#__cpp(offsetof(thread,fn))] - BLX r1 - MOV r4,r0 - BL gfxThreadExit + ldr r2,__cpp(&_gfxCurrentThread) + ldr r2,[r2,#0] + ldr r0,[r2,#__cpp(offsetof(thread,param))] + ldr r1,[r2,#__cpp(offsetof(thread,fn))] + blx r1 + mov r4,r0 + bl gfxThreadExit } #else |