Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / arch / all-mingw32 / exec / permit.c
blob54238892526015f8180c79ce9c185ca844980169
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Permit() - Allow tasks switches to occur.
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <aros/atomic.h>
13 #include <aros/debug.h>
14 #include <proto/exec.h>
15 #include <proto/kernel.h>
17 #undef Exec
18 #ifdef UseExecstubs
19 # define Exec _Exec
20 #endif
22 /* NAME */
24 AROS_LH0(void, Permit,
26 /* LOCATION */
27 struct ExecBase *, SysBase, 23, Exec)
29 /* FUNCTION
30 This function will reactivate the task dispatcher after a call
31 to Forbid(). Note that calls to Forbid() nest, and for every
32 call to Forbid() you need a matching call to Permit().
34 INPUTS
35 None.
37 RESULT
38 Multitasking will be re-enabled.
40 NOTES
41 This function preserves all registers.
43 To prevent deadlocks calling Wait() in forbidden state breaks
44 the forbid - thus taskswitches may happen again.
46 EXAMPLE
47 No you really don't want to use this function.
49 BUGS
50 The only architecture that you can rely on the registers being
51 saved is on the Motorola mc68000 family.
53 SEE ALSO
54 Forbid(), Disable(), Enable(), Wait()
56 INTERNALS
57 If you want to preserve all the registers, replace this function
58 in your $(KERNEL) directory. Otherwise this function is
59 satisfactory.
61 HISTORY
63 ******************************************************************************/
64 #undef Exec
66 AROS_LIBFUNC_INIT
69 Task switches are allowed again, if a switch is pending, we
70 should allow it.
73 AROS_ATOMIC_DEC(SysBase->TDNestCnt);
75 if( ( SysBase->TDNestCnt < 0 )
76 && ( SysBase->IDNestCnt < 0 )
77 && ( SysBase->AttnResched & 0x80 ) )
79 /* Haha, you re-enabled multitasking, only to have the rug
80 pulled out from under you feet :)
82 Clear the Switch() pending flag.
85 if (KernelBase && !KrnIsSuper()) KrnSchedule();
88 AROS_LIBFUNC_EXIT
89 } /* Permit() */