Listtree.mcc: use internal inherited class of NListtree
[AROS.git] / arch / m68k-mac / exec / supervisor.S
blob7184459e63636c99ef84ce4fc496edbdf8c124a0
1 /*
2     Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3     $Id$
4 */
6 /*****************************************************************************
7  
8     NAME
9  
10         AROS_LH1(ULONG, Supervisor,
12     SYNOPSIS
13         AROS_LHA(ULONG_FUNC, userFunction, A5),
15     LOCATION
16         struct ExecBase *, SysBase, 5, Exec)
18     FUNCTION
19         Call a routine in supervisor mode. This routine runs on the
20         supervisor stack and must end with a "rte". No registers are spilled,
21         i.e. Supervisor() effectively works like a function call.
23     INPUTS
24         userFunction - address of the function to be called.
26     RESULT
27         whatever the function left in the registers
29     NOTES
30         This function is CPU dependent.
32     EXAMPLE
34     BUGS
35         Context switches that happen during the duration of this call are lost.
37     SEE ALSO
39     INTERNALS
41     HISTORY
43 ******************************************************************************/
45         #include "aros/m68k/asm.h"
47         .text
48         .balign 4
49         .globl  AROS_SLIB_ENTRY(Supervisor,Exec,5)
51 AROS_SLIB_ENTRY(Supervisor,Exec,5):
52 #ifndef DoRegisterCalls
53         move.l  4(%sp),%a5 // Get the userFunction pointer
54 #endif
55         move.l  %d7,-(%sp)
56         move.l  #8,%d7     // #8 => call _sys_trap1_Supervisor
57         trap    #1
58         move.l  (%sp)+,%d7
59         rts
61         .globl _sys_trap1_Supervisor
62 _sys_trap1_Supervisor:
63         jmp     (%a5)