2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 /*****************************************************************************
10 AROS_LH0(void, Disable,
13 struct ExecBase *, SysBase, 20, Exec)
16 This function disables the delivery of all interrupts until a matching
17 call to Enable() is done. This implies a Forbid(). Since the system
18 needs the regular delivery of all interrupts it is forbidden to disable
19 them for longer than ~250 microseconds.
21 THIS CALL IS VERY DANGEROUS!!!
23 Do not use it without thinking very well about it or better do not use
24 it at all. Most of the time you can live without it by using semaphores
27 Calls to Disable() nest, i.e. for each call to Disable() you need one
35 This function preserves all registers.
37 This function may be used from interrupts to disable all higher
38 priority interrupts. Lower priority interrupts are disabled anyway.
40 To prevent deadlocks calling Wait() in disabled state breaks the
41 disable - thus interrupts and taskswitches may happen again.
48 Forbid(), Permit(), Enable(), Wait()
51 For old exec Disable() there exists an assembler macro replacement
52 that is (of course) unportable. Using a Disable() implementation
53 equal to this macro would not only have some impact on Disable()
54 itself but also on other functions (e.g. Signal()).
55 Therefore I decided to drop support for this macro to a certain
56 extent. The difference is only minuscule:
57 If a task uses the assembler macro and activates some higher priority
58 task he cannot expect this task to be awakened immediately at Enable()
59 but only at the next context switch. But I do not think that this
64 ******************************************************************************/
74 .globl AROS_SLIB_ENTRY(Disable,Exec)
75 .type AROS_SLIB_ENTRY(Disable,Exec),@function
76 AROS_SLIB_ENTRY
(Disable
,Exec
):
77 /* disable interrupts */
80 /* increment nesting count and return */
81 addq.
b #1,IDNestCnt(a6)