eaf7971ccaeaf64ef21cb0f25cb6cc5d35e4f4af
[AROS.git] / arch / m68k-mac / exec / enable.c
blobeaf7971ccaeaf64ef21cb0f25cb6cc5d35e4f4af
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Enable() - Allow interrupts to occur after Disable().
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <asm/registers.h>
14 #define DEBUG 1
15 #include <aros/debug.h>
17 /*****************************************************************************/
18 #undef Exec
19 #ifdef UseExecstubs
20 # define Exec _Exec
21 #endif
23 /* NAME */
24 #include <proto/exec.h>
26 AROS_LH0(void, Enable,
28 /* LOCATION */
29 struct ExecBase *, SysBase, 21, Exec)
31 /* FUNCTION
32 This function will allow interrupts to occur after they have
33 been disabled by Disable().
35 Note that calls to Disable() nest, and for every call to
36 Disable() you need a matching call to Enable().
38 ***** WARNING *****
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
48 multitasking.
50 INPUTS
51 None.
53 RESULT
54 Interrupts will be enabled again when this call returns.
56 NOTES
57 This function preserves all registers.
59 To prevent deadlocks calling Wait() in disabled state breaks
60 the disable - thus interrupts may happen again.
62 EXAMPLE
63 No you DEFINITATELY don't want to use this function.
65 BUGS
66 The only architecture that you can rely on the registers being
67 saved is on the Motorola mc68000 family.
69 SEE ALSO
70 Forbid(), Permit(), Disable(), Wait()
72 INTERNALS
73 This function must be replaced in the $(KERNEL) or $(ARCH)
74 directories in order to do some work.
76 HISTORY
78 ******************************************************************************/
80 #undef Exec
82 AROS_LIBFUNC_INIT
84 if( --SysBase->IDNestCnt < 0) {
86 * Enable interrupt by allowing all of them.
88 SetSR(0,0x700);
91 AROS_LIBFUNC_EXIT
92 } /* Enable() */