Re-enabled use of AROS.Boot file due to lack of general enthusiasm for
[tangerine.git] / arch / i386-pc / exec / userstate.c
blobb9796d154d77621cb9a0d0d9da311f5b49b4f693
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: UserState() - Return to normal mode after changing things.
6 Lang: english
7 */
9 /*****************************************************************************
11 NAME */
12 #include <proto/exec.h>
14 AROS_LH1(void, UserState,
16 /* SYNOPSIS */
17 AROS_LHA(APTR, sysStack, D0),
19 /* LOCATION */
20 struct ExecBase *, SysBase, 26, Exec)
22 /* FUNCTION
23 Return to user mode after a call to SuperState().
25 INPUTS
26 sysStack - The return value from SuperState()
28 RESULT
29 The system will be back to normal.
31 NOTES
33 EXAMPLE
35 BUGS
37 SEE ALSO
38 SuperState(), Supervisor()
40 INTERNALS
41 Undo SuperState()
43 HISTORY
45 ******************************************************************************/
47 AROS_LIBFUNC_INIT
49 /* By default there is nothing to do. */
51 __asm__ __volatile
53 "movl %%esp,0x0c(%%eax)\n\t" /* put USP onto exception stack frame */
54 "movl %%eax,%%esp\n\t" /* SSP = SP */
55 "leal 1f,%%eax\n\t"
56 "movl %%eax,(%%esp)\n\t" /* return at this address */
57 "iret\n"
58 "1:"
60 :"a"(sysStack)
63 AROS_LIBFUNC_EXIT
64 } /* UserState() */