mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 06:53:40 +00:00
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:
committed by
Ron Evans
parent
c119721e3b
commit
49e22fe678
@@ -46,6 +46,7 @@ tinygo_scanCurrentStack:
|
||||
.global tinygo_longjmp
|
||||
tinygo_longjmp:
|
||||
// Note: the code we jump to assumes a0 is non-zero, which is already the
|
||||
// case because that's jumpSP (the stack pointer).
|
||||
mv sp, a0 // jumpSP
|
||||
jr a1 // jumpPC
|
||||
// case because that's the defer frame pointer.
|
||||
lw sp, 0(a0) // jumpSP
|
||||
lw a1, REGSIZE(a0) // jumpPC
|
||||
jr a1
|
||||
|
||||
Reference in New Issue
Block a user