added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / .unmaintained / m68k-native / exec / permit.s
blob4ea304e1469f93039f77b4ecd33034a6192d41da
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /*****************************************************************************
8 NAME
10 AROS_LH0(void, Permit,
12 LOCATION
13 struct ExecBase *, SysBase, 23, Exec)
15 FUNCTION
16 This function activates the dispatcher again after a call to Permit().
18 INPUTS
20 RESULT
22 NOTES
23 This function preserves all registers.
25 EXAMPLE
27 BUGS
29 SEE ALSO
30 Forbid(), Disable(), Enable()
32 INTERNALS
34 HISTORY
36 ******************************************************************************/
38 #include "machine.i"
40 .text
41 .balign 4
42 .globl AROS_SLIB_ENTRY(Permit,Exec)
43 .type AROS_SLIB_ENTRY(Permit,Exec),@function
44 AROS_SLIB_ENTRY(Permit,Exec):
45 /* decrement nesting count and return if there are Forbid()s left */
46 subq.b #1,TDNestCnt(a6)
47 bpl end
49 /* return if there are no delayed switches pending. */
50 tst.b AttnResched+1(a6)
51 bpl end
53 /* if IDNestCnt is not -1 taskswitches are still forbidden */
54 tst.b IDNestCnt(a6)
55 bpl end
57 /* Unset delayed switch bit and do the delayed switch */
58 bclr #7,AttnResched+1(a6)
59 jsr Switch(a6)
61 /* all done. */
62 end: rts