mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
runtime, internal/task: refactor to simplify stack switching
The Cortex-M target isn't much changed, but much of the logic for the AVR stack switcher that was previously in assembly has now been moved to Go to make it more maintainable and in fact smaller in code size. Three functions (tinygo_getCurrentStackPointer, tinygo_switchToTask, tinygo_switchToScheduler) have been changed to one: tinygo_swapTask. This reduction in assembly code should make the code more maintainable and should make it easier to port stack switching to other architectures. I've also moved the assembly files to src/internal/task, which seems like a more appropriate location to me.
This commit is contained in:
committed by
Ron Evans
parent
bb58783158
commit
abb09e869e
+2
-2
@@ -13,7 +13,7 @@
|
||||
"-Wl,--gc-sections"
|
||||
],
|
||||
"extra-files": [
|
||||
"src/runtime/gc_avr.S",
|
||||
"src/runtime/scheduler_avr.S"
|
||||
"src/internal/task/task_stack_avr.S",
|
||||
"src/runtime/gc_avr.S"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
],
|
||||
"extra-files": [
|
||||
"src/device/arm/cortexm.s",
|
||||
"src/runtime/gc_arm.S",
|
||||
"src/runtime/scheduler_cortexm.S"
|
||||
"src/internal/task/task_stack_cortexm.S",
|
||||
"src/runtime/gc_arm.S"
|
||||
],
|
||||
"gdb": "gdb-multiarch"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user