2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 /*****************************************************************************
10 AROS_LH0(void, Forbid,
13 struct ExecBase *, SysBase, 22, Exec)
16 Forbid any further taskswitches until a matching call to Permit().
17 Naturally disabling taskswitches means:
19 THIS CALL IS DANGEROUS
21 Do not use it without thinking very well about it or better do not use
22 it at all. Most of the time you can live without it by using semaphores
25 Calls to Forbid() nest, i.e. for each call to Forbid() you need one
33 This function preserves all registers.
35 To prevent deadlocks calling Wait() in forbidden state breaks the
36 firbid - thus taskswitches may happen again.
43 Permit(), Disable(), Enable(), Wait()
49 ******************************************************************************/
55 .globl AROS_SLIB_ENTRY(Forbid,Exec)
56 .type AROS_SLIB_ENTRY(Forbid,Exec),@function
57 AROS_SLIB_ENTRY
(Forbid
,Exec
):
58 /* increment nesting count and return
59 this seems to be a very unspectacular call and a good job for a C
60 routine - but nothing in C can guarantee to preserve all registers
61 and to increment atomically - so better use this simple assembly
67 lbz scr
,TDNestCnt
(base
)
69 stb scr
,TDNestCnt
(base
)