2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
5 Desc: SuperState() - Switch the processor into a higher plane.
9 #include <aros/config.h>
10 #include <aros/debug.h>
12 #include "exec_intern.h"
14 /*****************************************************************************
17 #include <proto/exec.h>
19 AROS_LH0(APTR
, SuperState
,
22 struct ExecBase
*, SysBase
, 25, Exec
)
25 Enter supervisor mode (like Supervisor()), but return on the user
26 stack. This will mean that the user stack variables are still there.
27 A call to UserState() will end this mode.
33 The old supervisor stack. This must be passed to UserState(). If the
34 processor was already in supervisor mode, then this function will
35 return NULL. In that case do NOT call UserState().
38 This is not a good function to use, it has limited scope, and will
39 probably be even less useful in the future.
44 You can easily cause your system to cease operating normally.
47 Supervisor(), UserState()
50 For extra details see Supervisor().
52 ******************************************************************************/
56 #if (AROS_FLAVOUR & AROS_FLAVOUR_STANDALONE)
58 * This part works only on native AROS.
59 * Hosted ports are running in a virtual machine with only single privilege
60 * level available, so this function will simply return NULL.
61 * cpu_SuperState() is an architecture-specific helper code written in asm.
64 int super
= KrnIsSuper();
66 D(bug("[SuperState] Current supervisor mode: %d\n", super
));
70 APTR ssp
= (APTR
)Supervisor(cpu_SuperState
);
72 D(bug("[SuperState] Saved SP 0x%p\n", ssp
));