2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Forbid() - Prevent tasks switches from taking place.
8 /*****************************************************************************/
10 #include <proto/exec.h>
12 AROS_LH0(void, Forbid,
15 struct ExecBase *, SysBase, 22, Exec)
18 Forbid any further taskswitches until a matching call to Permit().
19 Naturally disabling taskswitches means:
21 THIS CALL IS DANGEROUS
23 Do not use it without thinking very well about it or better
24 do not use it at all. Most of the time you can live without
25 it by using semaphores or similar.
27 Calls to Forbid() nest, i.e. for each call to Forbid() you
28 need one call to Permit().
34 The multitasking state will be disabled AFTER this function
35 returns to the caller.
38 This function preserves all registers.
40 To prevent deadlocks calling Wait() in forbidden state breaks
41 the forbid - thus taskswitches may happen again.
44 No you really don't want to use this function.
47 The only architecture that you can rely on the registers being
48 saved is on the Motorola mc68000 family.
51 Permit(), Disable(), Enable(), Wait()
54 If you want to preserve all the registers, replace this function
55 in your $(KERNEL) directory. Otherwise this function is
58 ******************************************************************************/
59 #include "aros/m68k/asm.h"
63 .globl AROS_SLIB_ENTRY(Forbid,Exec,22)
65 AROS_SLIB_ENTRY(Forbid,Exec,22):
66 addq.b #1,%a6@(TDNestCnt)