Test initialisation of MUIA_List_AdjustWidth and MUIA_List_AdjustHeight, and
[AROS.git] / arch / .unmaintained / ppc-native / exec / forbid.s
blob2f9b8262e9608c849ccaa9008c4f733cbbae9822
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /*****************************************************************************
8 NAME
10 AROS_LH0(void, Forbid,
12 LOCATION
13 struct ExecBase *, SysBase, 22, Exec)
15 FUNCTION
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
23 or similar.
25 Calls to Forbid() nest, i.e. for each call to Forbid() you need one
26 call to Enable().
28 INPUTS
30 RESULT
32 NOTES
33 This function preserves all registers.
35 To prevent deadlocks calling Wait() in forbidden state breaks the
36 firbid - thus taskswitches may happen again.
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 Permit(), Disable(), Enable(), Wait()
45 INTERNALS
47 HISTORY
49 ******************************************************************************/
51 #include "machine.i"
53 .text
54 .balign 4
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
62 routine
64 subr
65 push scr
67 lbz scr,TDNestCnt(base)
68 addi scr,scr,1
69 stb scr,TDNestCnt(base)
71 pop scr
72 rts