- Give PCI controllers lower unit numbers than legacy controllers.
[cake.git] / rom / exec / enable.c
bloba2a54031c38fe6aab3db33532af1638031f787df
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 */
8 #include <exec/types.h>
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <aros/atomic.h>
13 /*****************************************************************************/
14 #undef Exec
15 #ifdef UseExecstubs
16 # define Exec _Exec
17 #endif
19 /* NAME */
20 #include <proto/exec.h>
22 AROS_LH0(void, Enable,
24 /* LOCATION */
25 struct ExecBase *, SysBase, 21, Exec)
27 /* FUNCTION
28 This function will allow interrupts to occur after they have
29 been disabled by Disable().
31 Note that calls to Disable() nest, and for every call to
32 Disable() you need a matching call to Enable().
34 ***** WARNING *****
36 Using this function is considered very harmful, and it is
37 not recommended to use this function for ** ANY ** reason.
39 It is quite possible to either crash the system, or to prevent
40 normal activities (disk/port i/o) from occuring.
42 Note: As taskswitching is driven by the interrupts subsystem,
43 this function has the side effect of disabling
44 multitasking.
46 INPUTS
47 None.
49 RESULT
50 Interrupts will be enabled again when this call returns.
52 NOTES
53 This function preserves all registers.
55 To prevent deadlocks calling Wait() in disabled state breaks
56 the disable - thus interrupts may happen again.
58 EXAMPLE
59 No you DEFINITATELY don't want to use this function.
61 BUGS
62 The only architecture that you can rely on the registers being
63 saved is on the Motorola mc68000 family.
65 SEE ALSO
66 Forbid(), Permit(), Disable(), Wait()
68 INTERNALS
69 This function must be replaced in the $(KERNEL) or $(ARCH)
70 directories in order to do some work.
72 ******************************************************************************/
74 #undef Exec
76 AROS_LIBFUNC_INIT
78 /* Only disable interrupts if they are not already disabled. The
79 initial (enabled) value of IDNestCnt is -1
82 AROS_ATOMIC_DEC(SysBase->IDNestCnt);
84 if( SysBase->IDNestCnt < 0)
87 We have to enable interrupts, however some silly person
88 hasn't written the code required to do it yet. They should
89 have created a file in config/$(KERNEL)/exec or
90 config/$(ARCH)/exec called disable.c or disable.s which
91 implements this function.
94 #ifndef __CXREF__
95 #error You have not written the $(KERNEL) interrupt subsystem!
96 #endif
99 AROS_LIBFUNC_EXIT
100 } /* Enable() */