1 #include <aros/x86_64/asm.h>
7 .type cpu_SuperState, @function
9 // This is
a SuperState
() helper. It
's called via Supervisor().
10 // Its job is to restore a stack pointer and return to user's code.
12 movq
%rsp
, %rax
// return int handler stack
13 movq
24(%rax
),%rsp
// use user stack
14 pushq
(%rax
) // push return address
16 ret
// return from SuperState
() call
18 .size cpu_SuperState, .-cpu_SuperState
20 .globl AROS_SLIB_ENTRY(UserState, Exec, 26)
21 .type AROS_SLIB_ENTRY(UserState, Exec, 26), @function
23 AROS_SLIB_ENTRY
(UserState
, Exec
, 26):
24 // Supervisor return stack is already in rdi
25 movq
%rsp
, 24(%rdi
) // put USP onto exception stack frame
26 movq
%rdi
, %rsp
// SSP
= SP
27 leaq cpu_UserState
(%rip
), %rax
28 movq
%rax
, (%rsp
) // return at this address
31 .size AROS_SLIB_ENTRY(UserState, Exec, 26), .-AROS_SLIB_ENTRY(UserState, Exec, 26)