runtime: load sp and pc inside tinygo_longjmp

This is a small change to make it easier to support architectures that
need to restore more than just the sp and pc registers. In particular,
it is needed for the AVR architecture that needs to restore the frame
pointer (Y register).
This commit is contained in:
Ayke van Laethem
2022-06-17 01:28:14 +02:00
committed by Ron Evans
parent c119721e3b
commit 49e22fe678
7 changed files with 24 additions and 19 deletions
+2
View File
@@ -40,6 +40,8 @@ tinygo_longjmp:
.cfi_startproc
// Note: the code we jump to assumes r0 is set to a non-zero value if we
// jump from here (which is conveniently already the case).
ldm r0, {r0, r1}
mov sp, r0 // jumpSP
mov pc, r1 // jumpPC
.cfi_endproc