disable debug.
[AROS.git] / arch / m68k-amiga / exec / disable.S
blob37187692a035f829eadae6e117efe5e70581b6ac
1 /*
2     Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3     $Id$
5     Desc: Disable() - Stop interrupts from occurring.
6     Lang: english
7 */
8 /*****************************************************************************
10     NAME
11 #include <proto/exec.h>
13         AROS_LH0(void, Disable,
15     LOCATION
16         struct ExecBase *, SysBase, 20, Exec)
18     FUNCTION
19         This function will prevent interrupts from occuring. You can
20         start the interrupts again with a call to Enable().
22         Note that calls to Disable() nest, and for every call to
23         Disable() you need a matching call to Enable().
25         ***** WARNING *****
27         Using this function is considered very harmful, and it is
28         not recommended to use this function for ** ANY ** reason.
30         It is quite possible to either crash the system, or to prevent
31         normal activities (disk/port i/o) from occuring.
33         Note: As taskswitching is driven by the interrupts subsystem,
34               this function has the side effect of disabling
35               multitasking.
37     INPUTS
39     RESULT
40         Interrupts will be disabled AFTER this call returns.
42     NOTES
43         This function preserves all registers.
45         To prevent deadlocks calling Wait() in disabled state breaks
46         the disable - thus interrupts may happen again.
48     EXAMPLE
49         No you DEFINITELY don't want to use this function.
51     BUGS
52         The only architecture that you can rely on the registers being
53         saved is on the Motorola mc68000 family.
55     SEE ALSO
56         Forbid(), Permit(), Enable(), Wait()
58     INTERNALS
59         This function must be replaced in the $(KERNEL) or $(ARCH)
60         directories in order to do some work.
62 ******************************************************************************/
63 #include "aros/m68k/asm.h"
65         .text
66         .balign 4
67         .globl  AROS_SLIB_ENTRY(Disable,Exec,20)
69 AROS_SLIB_ENTRY(Disable,Exec,20):
70         /* As we said above: ALL registers must be preserved! */
71         move.w  #0x4000,0xdff09a
72         addq.b  #1,IDNestCnt(%a6)
73         rts