revert between 56095 -> 55830 in arch
[AROS.git] / arch / .unmaintained / m68k-emul / enable.s
blob4da52dce1232a301ee59adc4789c397ddd804339
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Exec function Enable
6 Lang: english
7 */
9 /******************************************************************************
11 NAME
12 AROS_LH0(void, Enable,
14 LOCATION
15 struct ExecBase *, SysBase, 21, Exec)
17 FUNCTION
19 INPUTS
21 RESULT
23 NOTES
25 EXAMPLE
27 BUGS
29 SEE ALSO
31 INTERNALS
33 HISTORY
35 ******************************************************************************/
37 #include "machine.i"
39 .text
40 .balign 16
41 .globl AROS_SLIB_ENTRY(Enable,Exec)
42 .type AROS_SLIB_ENTRY(Enable,Exec),@function
43 AROS_SLIB_ENTRY(Enable,Exec):
44 #if !UseRegisterArgs
45 /* Preserve all registers */
46 move.l %a6,-(%sp)
48 /* Get SysBase */
49 move.l 8(%sp),%a6
50 #endif
52 /* Decrement and test IDNestCnt */
53 subq.b #1,IDNestCnt(%a6)
54 jbpl .noswch
55 jbsr AROS_CSYMNAME(os_enable)
57 /* return if there are no delayed switches pending. */
58 btst #7,AttnResched+1(%a6)
59 jbeq .noswch
61 /* if TDNestCnt is not -1 taskswitches are still forbidden */
62 tst.b TDNestCnt(%a6)
63 jbpl .noswch
65 /* Unset delayed switch bit and do the delayed switch */
66 bclr #7,AttnResched+1(%a6)
67 #if !UseRegisterArgs
68 move.l %a6,-(%sp)
69 #endif
70 jsr Switch(%a6)
71 #if !UseRegisterArgs
72 addq.w #4,%sp
73 #endif
75 /* all done. */
76 .noswch:
77 #if !UseRegisterArgs
78 move.l (%sp)+,%a6
79 #endif
80 rts