fix off-by-1 screen title fill
[AROS.git] / arch / m68k-all / exec / forbid.S
blob8d8be82bb250b970428fa7420c7fcbad3d351f08
1 /*
2     Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3     $Id$
5     Desc: Forbid() - Prevent tasks switches from taking place.
6     Lang: english
7 */
8 /*****************************************************************************/
9 /*  NAME
10 #include <proto/exec.h>
12         AROS_LH0(void, Forbid,
14     LOCATION
15         struct ExecBase *, SysBase, 22, Exec)
17     FUNCTION
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().
30     INPUTS
31         None.
33     RESULT
34         The multitasking state will be disabled AFTER this function
35         returns to the caller.
37     NOTES
38         This function preserves all registers.
40         To prevent deadlocks calling Wait() in forbidden state breaks
41         the forbid - thus taskswitches may happen again.
43     EXAMPLE
44         No you really don't want to use this function.
46     BUGS
47         The only architecture that you can rely on the registers being
48         saved is on the Motorola mc68000 family.
50     SEE ALSO
51         Permit(), Disable(), Enable(), Wait()
53     INTERNALS
54         If you want to preserve all the registers, replace this function
55         in your $(KERNEL) directory. Otherwise this function is
56         satisfactory.
58 ******************************************************************************/
59         #include "aros/m68k/asm.h"
61         .text
62         .balign 4
63         .globl  AROS_SLIB_ENTRY(Forbid,Exec,22)
65 AROS_SLIB_ENTRY(Forbid,Exec,22):
66         addq.b  #1,%a6@(TDNestCnt)
67         rts