2 Copyright © 1995-2010, 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>
13 #include <proto/kernel.h>
15 #include "exec_intern.h"
17 /*****************************************************************************/
24 #include <proto/exec.h>
26 AROS_LH0(void, Disable
,
29 struct ExecBase
*, SysBase
, 20, Exec
)
32 This function will prevent interrupts from occuring. You can
33 start the interrupts again with a call to Enable().
35 Note that calls to Disable() nest, and for every call to
36 Disable() you need a matching call to Enable().
40 Using this function is considered very harmful, and it is
41 not recommended to use this function for ** ANY ** reason.
43 It is quite possible to either crash the system, or to prevent
44 normal activities (disk/port i/o) from occuring.
46 Note: As taskswitching is driven by the interrupts subsystem,
47 this function has the side effect of disabling
53 Interrupts will be disabled AFTER this call returns.
56 This function preserves all registers.
58 To prevent deadlocks calling Wait() in disabled state breaks
59 the disable - thus interrupts may happen again.
62 No you DEFINITELY don't want to use this function.
65 The only architecture that you can rely on the registers being
66 saved is on the Motorola mc68000 family.
69 Forbid(), Permit(), Enable(), Wait()
72 This function must be replaced in the $(KERNEL) or $(ARCH)
73 directories in order to do some work.
75 ******************************************************************************/
84 #ifdef AROS_NO_ATOMIC_OPERATIONS
85 /* Generic atomic operations in aros/atomic.h rely on Disable()/Enable() themselves,
86 so we have to take care about it here. Otherwise we fall into endless loop.
87 It is strongly recommended to implement real atomic operations in assembler.
88 The same is done in Enable() */
91 AROS_ATOMIC_INC(SysBase
->IDNestCnt
);