2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Disable() - Stop interrupts from occurring.
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <aros/atomic.h>
14 /*****************************************************************************/
21 #include <proto/exec.h>
23 AROS_LH0(void, Disable
,
26 struct ExecBase
*, SysBase
, 20, Exec
)
29 This function will prevent interrupts from occuring. You can
30 start the interrupts again with a call to Enable().
32 Note that calls to Disable() nest, and for every call to
33 Disable() you need a matching call to Enable().
37 Using this function is considered very harmful, and it is
38 not recommended to use this function for ** ANY ** reason.
40 It is quite possible to either crash the system, or to prevent
41 normal activities (disk/port i/o) from occuring.
43 Note: As taskswitching is driven by the interrupts subsystem,
44 this function has the side effect of disabling
50 Interrupts will be disabled AFTER this call returns.
53 This function preserves all registers.
55 To prevent deadlocks calling Wait() in disabled state breaks
56 the disable - thus interrupts may happen again.
59 No you DEFINITELY don't want to use this function.
62 The only architecture that you can rely on the registers being
63 saved is on the Motorola mc68000 family.
66 Forbid(), Permit(), Enable(), Wait()
69 This function must be replaced in the $(KERNEL) or $(ARCH)
70 directories in order to do some work.
72 ******************************************************************************/
78 /* Only disable interrupts if they are not already disabled. The
79 initial (enabled) value of IDNestCnt is -1
82 AROS_ATOMIC_INC(SysBase
->IDNestCnt
);
85 We have to disable interrupts, however some silly person
86 hasn't written the code required to do it yet. They should
87 have created a file in config/$(KERNEL)/exec or
88 config/$(ARCH)/exec called disable.c or disable.s which
89 implements this function.
92 #error You have not written the $(KERNEL) interrupt subsystem!