mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 05:53:39 +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
@@ -37,11 +37,11 @@ tinygo_longjmp:
|
||||
.global _tinygo_longjmp
|
||||
_tinygo_longjmp:
|
||||
#endif
|
||||
// Note: the code we jump to assumes rax is non-zero so we have to load it
|
||||
// with some value here.
|
||||
movq $1, %rax
|
||||
movq %rdi, %rsp // jumpSP
|
||||
jmpq *%rsi // jumpPC
|
||||
// Note: the code we jump to assumes rax is set to a non-zero value if we
|
||||
// jump from here, so we use rax as the temporary value for jumpPC.
|
||||
movq 0(%rdi), %rsp // jumpSP
|
||||
movq 8(%rdi), %rax // jumpPC
|
||||
jmpq *%rax
|
||||
|
||||
|
||||
#ifdef __MACH__ // Darwin
|
||||
|
||||
Reference in New Issue
Block a user