1 #include <aros/i386/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 movl
%esp
, %eax
// return int handler stack
13 movl
12(%eax
),%esp
// use user stack
14 pushl
(%eax
) // push return address
15 ret
// return from SuperState
() call
17 .size cpu_SuperState, .-cpu_SuperState
19 .globl AROS_SLIB_ENTRY(UserState, Exec, 26)
20 .type AROS_SLIB_ENTRY(UserState, Exec, 26), @function
22 AROS_SLIB_ENTRY
(UserState
, Exec
, 26):
23 popl
%ecx
// Get return address
24 movl
(%esp
), %eax
// Get supervisor return stack
25 movl
%ecx
, (%eax
) // Set return address
26 movl
%esp
, 12(%eax
) // Set USP in exception stack frame
27 movl
%eax
, %esp
// SSP
= SP
28 iret
// Exit from interrupt
30 .size AROS_SLIB_ENTRY(UserState, Exec, 26), .-AROS_SLIB_ENTRY(UserState, Exec, 26)