attempt to fix SuperState/UserState
[AROS.git] / arch / arm-raspi / exec / userstate.c
blob1d272f36cb2b540d9facddea0d444434aac9f74d
1 /*
2 Copyright © 2013, 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, superSP, D0),
19 /* LOCATION */
20 struct ExecBase *, SysBase, 26, Exec)
22 /* FUNCTION
23 Return to user mode after a call to SuperState().
25 INPUTS
26 superSP - 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 ******************************************************************************/
45 AROS_LIBFUNC_INIT
47 asm volatile (
48 " mov r0, sp \n"
49 " mov sp, %[superSP] \n"
50 " cps %[mode_user] \n"
51 " mov sp, r0 \n"
52 : : [superSP] "X" (superSP), [mode_user] "I" (CPUMODE_USER));
54 AROS_LIBFUNC_EXIT
55 } /* UserState() */