forked from tinygo-org/tinygo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
16c2d84
commit ceeba52
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters