2 Copyright © 1995-2017, 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 #include "exec_intern.h"
16 /*****************************************************************************/
23 #include <proto/exec.h>
25 AROS_LH0(void, Disable
,
28 struct ExecBase
*, SysBase
, 20, Exec
)
31 This function will prevent interrupts from occuring (*). You can
32 start the interrupts again with a call to Enable().
34 Note that calls to Disable() nest, and for every call to
35 Disable() you need a matching call to Enable().
39 Using this function is considered very harmful, and it should only
40 ever be used to protect data that could also be accessed in interrupts.
42 It is quite possible to either crash the system, or to prevent
43 normal activities (disk/port i/o) from occuring.
48 Interrupts will be disabled AFTER this call returns.
51 This function preserves all registers.
53 To prevent deadlocks calling Wait() in disabled state breaks
54 the disable - thus interrupts may happen again.
56 As the schedulers pre-emption is interrupt driven,
57 this function has the side effect of disabling
60 (*) On EXECSMP builds, Disable() only aplies to the processor
61 it is called from (and needs to be re-enabled there also)
62 Data which needs to be protected from parallel access will
63 also require a spinlock.
66 In most userspace code, you will not want to use this function.
69 The only architecture that you can rely on the registers being
70 saved is on the Motorola mc68000 family.
73 Forbid(), Permit(), Enable(), Wait()
76 This function must be replaced in the $(KERNEL) or $(ARCH)
77 directories in order to do some work.
79 ******************************************************************************/
85 D(bug("[Exec] Disable()\n");)
92 D(bug("[Exec] Disable: IDNESTCOUNT = %d\n", IDNESTCOUNT_GET
);)