2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
6 /*****************************************************************************
10 AROS_LH1(ULONG, UserState,
13 AROS_LHA(APTR, sysStack, D0)
16 struct ExecBase *, SysBase, 26, Exec)
19 Return to user mode after a call to SuperState().
22 sysStack - The return value from SuperState()
25 The system will be back to normal.
34 SuperState(), Supervisor()
41 ******************************************************************************/
43 #include "aros/m68k/asm.h"
47 .globl AROS_SLIB_ENTRY(UserState,Exec)
49 AROS_SLIB_ENTRY(UserState,Exec):
50 #ifndef DoRegisterCalls
51 move.l 0x4.w,%a6 // Get SysBase
52 move.l 4(%ssp),%d0 // get sysStack
55 * This is how the supervisor stack looks like (later usp)
56 * 0(%ssp) (LONG) - return PC
57 * 4(%ssp) (LONG) - sysStack - only there if not using register passing
59 movem.l %a1-%a2,-4(%ssp)
61 move.l %ssp,%a2 // remember for later
63 move.l %d0,%ssp // load ssp with old ssp
66 move.l %a1,2(%ssp) // store the return PC on ssp exception
67 // frame, keep SR untouched
70 movem.l -4(%a2),%a1-%a2 // restor a1/a2
72 rte // -> should now call return_part below
75 rts // -> should lead me back to where I left off in the