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
+3 -2
View File
@@ -43,5 +43,6 @@ tinygo_longjmp:
#endif
// Note: the code we jump to assumes x0 is set to a non-zero value if we
// jump from here (which is conveniently already the case).
mov sp, x0 // jumpSP
br x1 // jumpPC
ldp x1, x2, [x0] // jumpSP, jumpPC
mov sp, x1
br x2