dtpic.mui: added MUI4 attributes. (Only attribute
[AROS.git] / arch / .unmaintained / dummy / disable.c
blob6a15a44802a2feda362eb8b61eb968ece3a528be
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Exec function Disable
6 Lang: english
7 */
8 #define timeval sys_timeval
9 #include <signal.h>
10 #undef timeval
11 #include <exec/execbase.h>
13 void disable (void);
15 /******************************************************************************
17 NAME */
18 #include <proto/exec.h>
20 AROS_LH0(void, Disable,
22 /* LOCATION */
23 struct ExecBase *, SysBase, 20, Exec)
25 /* FUNCTION
26 This function disables the delivery of all interrupts until a
27 matching call to Enable() is done. This implies a Forbid(). Since
28 the system needs the regular delivery of all interrupts it is
29 forbidden to disable them for longer than ~250 microseconds.
31 THIS CALL IS VERY DANGEROUS!!!
33 Do not use it without thinking very well about it or better do not
34 use it at all. Most of the time you can live without it by using
35 semaphores or similar.
37 Calls to Disable() nest, i.e. for each call to Disable() you need
38 one call to Enable().
41 INPUTS
42 None.
44 RESULT
45 None.
47 NOTES
48 You should not use this function as a cheap way to avoid
49 using a semaphore.
51 If you can, use Forbid() instead.
53 This function preserves all registers.
55 This function may be used from interrupts to disable all higher
56 priority interrupts. Lower priority interrupts are disabled anyway.
58 To prevent deadlocks calling Wait() in disabled state breaks the
59 disable - thus interrupts and taskswitches may happen again.
61 EXAMPLE
63 BUGS
65 SEE ALSO
66 Enable(), Forbid(), Permit(), Wait()
68 INTERNALS
70 HISTORY
72 ******************************************************************************/
74 disable ();
76 SysBase->IDNestCnt ++;
77 } /* Disable */
79 void disable (void)
81 sigset_t set;
83 sigfillset (&set);
85 sigprocmask (SIG_BLOCK, &set, NULL);
86 } /* disable */