added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / .unmaintained / m68k-native / exec / enable.s
blobdb1802403f2938d4f68a9b2f3a0bce36ee7d4d8d
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /*****************************************************************************
8 NAME
10 AROS_LH0(void, Enable,
12 LOCATION
13 struct ExecBase *, SysBase, 21, Exec)
15 FUNCTION
16 This function reenables the delivery of interrupts after a call to
17 Disable().
19 INPUTS
21 RESULT
23 NOTES
24 This function preserves all registers.
26 This function may be used from interrupts.
28 EXAMPLE
30 BUGS
32 SEE ALSO
33 Forbid(), Permit(), Disable()
35 INTERNALS
37 HISTORY
39 ******************************************************************************/
41 INTENA = 0xdff09a
42 INTEN = 0x4000
43 SET = 0x8000
45 #include "machine.i"
47 .text
48 .balign 4
49 .globl AROS_SLIB_ENTRY(Enable,Exec)
50 .type AROS_SLIB_ENTRY(Enable,Exec),@function
51 AROS_SLIB_ENTRY(Enable,Exec):
52 /* decrement nesting count and return if there are Disable()s left */
53 subq.b #1,IDNestCnt(a6)
54 bpl end
56 /* reenable interrupts */
57 move.w #INTEN+SET,INTENA
59 /* return if there are no delayed switches pending. */
60 tst.b AttnResched+1(a6)
61 bpl end
63 /* if TDNestCnt is not -1 taskswitches are still forbidden */
64 tst.b TDNestCnt(a6)
65 bpl end
67 /* Unset delayed switch bit and do the delayed switch */
68 bclr #7,0x12b(a6)
69 jsr Switch(a6)
71 /* all done. */
72 end: rts