runtime: move/refactor some GC-related code

Instead of putting tinygo_scanCurrentStack in scheduler_*.S files, put
them in dedicated files. The function tinygo_scanCurrentStack has
nothing to do with scheduling and so doesn't belong there. Additionally,
while scheduling code is made specific for the Cortex-M, the
tinygo_scanCurrentStack is generic to all ARM targets so this move
removes some duplication there.

Specifically:

  * tinygo_scanCurrentStack is moved out of scheduler_cortexm.S as it
    isn't really part of the scheduler. It is now gc_arm.S.
  * Same for the AVR target.
  * Same for the RISCV target.
  * scheduler_gba.S is removed, using gc_arm.S instead as it only
    contains tinygo_scanCurrentStack.
This commit is contained in:
Ayke van Laethem
2020-09-25 15:59:38 +02:00
committed by Ron Evans
parent 7123941df0
commit bfa29f17da
9 changed files with 70 additions and 86 deletions
+1
View File
@@ -13,6 +13,7 @@
"-Wl,--gc-sections"
],
"extra-files": [
"src/runtime/gc_avr.S",
"src/runtime/scheduler_avr.S"
]
}
+1
View File
@@ -25,6 +25,7 @@
],
"extra-files": [
"src/device/arm/cortexm.s",
"src/runtime/gc_arm.S",
"src/runtime/scheduler_cortexm.S"
],
"gdb": "gdb-multiarch"
+1 -1
View File
@@ -25,7 +25,7 @@
"linkerscript": "targets/gameboy-advance.ld",
"extra-files": [
"targets/gameboy-advance.s",
"src/runtime/scheduler_gba.S"
"src/runtime/gc_arm.S"
],
"gdb": "gdb-multiarch",
"emulator": ["mgba", "-3"]
+1 -1
View File
@@ -18,7 +18,7 @@
],
"extra-files": [
"src/device/riscv/start.S",
"src/runtime/scheduler_tinygoriscv.S",
"src/runtime/gc_riscv.S",
"src/device/riscv/handleinterrupt.S"
],
"gdb": "riscv64-unknown-elf-gdb"