Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / arch / i386-pc / exec / setexcept.c
blobb2a2b38867ea6de93cb10bf8aeb5d57b89775bdf
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Examine and/or modify the signals which cause an exception.
6 Lang: english
7 */
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH2(ULONG, SetExcept,
19 /* SYNOPSIS */
20 AROS_LHA(ULONG, newSignals, D0),
21 AROS_LHA(ULONG, signalSet, D1),
23 /* LOCATION */
24 struct ExecBase *, SysBase, 52, Exec)
26 /* FUNCTION
27 Change the mask of signals causing a task exception.
29 INPUTS
30 newSignals - Set of signals causing the exception.
31 signalSet - Mask of affected signals.
33 RESULT
34 Old mask of signals causing a task exception.
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 AllocSignal(), FreeSignal(), Wait(), SetSignal(), Signal()
45 INTERNALS
47 HISTORY
49 ******************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct Task *me;
54 ULONG old;
56 /* Get pointer to current task */
57 me=SysBase->ThisTask;
59 /* Protect mask of sent signals and task lists */
60 Disable();
62 /* Get returncode */
63 old=me->tc_SigExcept;
65 /* Change exception mask */
66 me->tc_SigExcept=(old&~signalSet)|(newSignals&signalSet);
68 /* Does this change include an exception? */
69 if(me->tc_SigExcept&me->tc_SigRecvd)
71 /* Yes. Set the exception flag. */
72 me->tc_Flags|=TF_EXCEPT;
74 /* Are taskswitches allowed? (Don't count own Disable() here) */
75 if(SysBase->TDNestCnt>=0||SysBase->IDNestCnt>0)
76 /* No. Store it for later. */
77 SysBase->AttnResched|=0x80;
78 else
80 /* Switches are allowed. Force a rescedule. */
82 // me->tc_Node.ln_Pred->ln_Succ = me->tc_Node.ln_Succ;
83 // me->tc_Node.ln_Succ->ln_Pred = me->tc_Node.ln_Pred;
85 Reschedule(me);
88 Enable();
90 return old;
91 AROS_LIBFUNC_EXIT