2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
5 Desc: Examine and/or modify the signals which cause an exception.
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 #include "exec_intern.h"
14 #if defined(__AROSEXEC_SMP__)
18 /*****************************************************************************
22 AROS_LH2(ULONG
, SetExcept
,
25 AROS_LHA(ULONG
, newSignals
, D0
),
26 AROS_LHA(ULONG
, signalSet
, D1
),
29 struct ExecBase
*, SysBase
, 52, Exec
)
32 Change the mask of signals causing a task exception.
35 newSignals - Set of signals causing the exception.
36 signalSet - Mask of affected signals.
39 Old mask of signals causing a task exception.
48 AllocSignal(), FreeSignal(), Wait(), SetSignal(), Signal()
54 ******************************************************************************/
58 /* Get pointer to current task */
59 struct Task
*ThisTask
= GET_THIS_TASK
;
62 /* Protect mask of sent signals and task lists */
63 #if defined(__AROSEXEC_SMP__)
64 EXEC_SPINLOCK_LOCK(&IntETask(ThisTask
->tc_UnionETask
.tc_ETask
)->iet_TaskLock
, SPINLOCK_MODE_WRITE
);
69 old
= ThisTask
->tc_SigExcept
;
71 /* Change exception mask */
72 ThisTask
->tc_SigExcept
= (old
& ~signalSet
) | (newSignals
& signalSet
);
74 /* Does this change include an exception? */
75 if (ThisTask
->tc_SigExcept
& ThisTask
->tc_SigRecvd
)
77 /* Yes. Set the exception flag. */
78 ThisTask
->tc_Flags
|= TF_EXCEPT
;
80 /* And order rescheduling */
83 #if defined(__AROSEXEC_SMP__)
84 EXEC_SPINLOCK_UNLOCK(&IntETask(ThisTask
->tc_UnionETask
.tc_ETask
)->iet_TaskLock
);