2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Supervisor() - Execute some code in a priviledged environment.
9 /*****************************************************************************
12 #include <proto/exec.h>
14 AROS_LH1(ULONG
, Supervisor
,
17 AROS_LHA(ULONG_FUNC
, userFunction
, A5
),
20 struct ExecBase
*, SysBase
, 5, Exec
)
23 Supervisor will allow a short priviledged instruction sequence to
24 be called from user mode. This has very few uses, and it is probably
25 better to use any system supplied method to do anything.
27 The function supplied will be called as if it was a system interrupt,
28 notably this means that you must *NOT* make any system calls or
29 use any system data structures, and on certain systems you must
30 use special methods to leave the code.
32 The code will not be passed any parameters.
35 userFunc - The address of the code you want called in supervisor
39 The code will be called.
42 This function has completely different effects on different
43 processors and architectures.
45 Currently defined effects are:
48 -------------------------------------------------------------------
49 i386 (under emulation) None
50 m68k (native) Runs the process in supervisor mode.
51 The process must end with an RTE
52 instruction. It should save any
53 registers which is uses.
54 m68k (under emulation)
59 You can very easily make the system unusable with this function.
60 In fact it is recommended that you do not use it at all.
63 SuperState(), UserState()
66 You can do what you want with this function, even ignoring it if
67 you don't think it makes any sense. But it could be quite useful
68 to make it run something under different protection levels.
70 You should trust that the programmer know what they are doing :-)
74 ******************************************************************************/
79 __asm__
__volatile__ (