runtime: copy stack scan assembly for GBA
The GC stack scanning code was implemented in the Cortex-M assembly, which meant that it was not available on the GBA which is pre-cortex. This change adds a copy of the relevant code into a new asembly file which is used on the GBA.
Этот коммит содержится в:
родитель
16c2d84c49
коммит
ceeba528e7
2 изменённых файлов: 21 добавлений и 1 удалений
19
src/runtime/scheduler_gba.S
Обычный файл
19
src/runtime/scheduler_gba.S
Обычный файл
|
@ -0,0 +1,19 @@
|
||||||
|
.section .text.tinygo_scanCurrentStack
|
||||||
|
.global tinygo_scanCurrentStack
|
||||||
|
.type tinygo_scanCurrentStack, %function
|
||||||
|
tinygo_scanCurrentStack:
|
||||||
|
// Save callee-saved registers onto the stack.
|
||||||
|
mov r0, r8
|
||||||
|
mov r1, r9
|
||||||
|
mov r2, r10
|
||||||
|
mov r3, r11
|
||||||
|
push {r0-r3, lr}
|
||||||
|
push {r4-r7}
|
||||||
|
|
||||||
|
// Scan the stack.
|
||||||
|
mov r0, sp
|
||||||
|
bl tinygo_scanstack
|
||||||
|
|
||||||
|
// Restore stack state and return.
|
||||||
|
add sp, #32
|
||||||
|
pop {pc}
|
|
@ -25,7 +25,8 @@
|
||||||
],
|
],
|
||||||
"linkerscript": "targets/gameboy-advance.ld",
|
"linkerscript": "targets/gameboy-advance.ld",
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
"targets/gameboy-advance.s"
|
"targets/gameboy-advance.s",
|
||||||
|
"src/runtime/scheduler_gba.S"
|
||||||
],
|
],
|
||||||
"gdb": "gdb-multiarch",
|
"gdb": "gdb-multiarch",
|
||||||
"emulator": ["mgba", "-3"]
|
"emulator": ["mgba", "-3"]
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче