parent
79b0533df2
commit
a4b359672c
|
@ -12,13 +12,14 @@
|
|||
#define PREFIX ""
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
asm("\t.global " PREFIX "fastjmp_set\n"
|
||||
"\t.global " PREFIX "fastjmp_jmp\n"
|
||||
"\t.text\n"
|
||||
"\t" PREFIX "fastjmp_set:"
|
||||
R"(
|
||||
"\t" PREFIX "fastjmp_set:" R"(
|
||||
movq 0(%rsp), %rax
|
||||
movq %rsp, %rdx # fixup stack pointer, so it doesn't include the call to fastjmp_set
|
||||
addq $8, %rdx
|
||||
|
@ -33,8 +34,7 @@ asm("\t.global " PREFIX "fastjmp_set\n"
|
|||
xorl %eax, %eax
|
||||
ret
|
||||
)"
|
||||
"\t" PREFIX "fastjmp_jmp:"
|
||||
R"(
|
||||
"\t" PREFIX "fastjmp_jmp:" R"(
|
||||
movl %esi, %eax
|
||||
movq 0(%rdi), %rdx # actually rip
|
||||
movq 8(%rdi), %rbx
|
||||
|
@ -189,4 +189,6 @@ asm(
|
|||
|
||||
#endif
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // __WIN32
|
||||
|
|
Loading…
Reference in New Issue