wip .. provide our bootstrap memory layout in a header for the bootstrap and kernel...
[AROS.git] / arch / all-pc / exec / supervisor.c
blob58a5e7512a6744efcc2c0f1c65c21ba163e6cf3a
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Supervisor() - Execute some code in a privileged environment.
6 Lang: english
7 */
9 #include <aros/libcall.h>
10 #include <exec/execbase.h>
12 #include "kernel_syscall.h"
14 AROS_LH1I(IPTR, Supervisor,
15 AROS_LHA(void *, userFunction, A5),
16 struct ExecBase *, SysBase, 5, Exec)
18 AROS_LIBFUNC_INIT
20 IPTR retval;
22 /* Put function pointer into e(r)dx because on x86-64 it doesn't require additional reload */
23 __asm__ __volatile__ ("int $0x80":"=a"(retval):"a"(SC_SUPERVISOR),"D"(userFunction));
24 return retval;
26 AROS_LIBFUNC_EXIT
27 } /* Supervisor() */