2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
5 Desc: Examine and/or modify the signals which cause an exception.
11 #include <exec/execbase.h>
12 #include <aros/libcall.h>
13 #include <proto/exec.h>
15 #include "exec_intern.h"
16 #if defined(__AROSEXEC_SMP__)
18 #include "exec_locks.h"
21 /*****************************************************************************
25 AROS_LH2(ULONG
, SetExcept
,
28 AROS_LHA(ULONG
, newSignals
, D0
),
29 AROS_LHA(ULONG
, signalSet
, D1
),
32 struct ExecBase
*, SysBase
, 52, Exec
)
35 Change the mask of signals causing a task exception.
38 newSignals - Set of signals causing the exception.
39 signalSet - Mask of affected signals.
42 Old mask of signals causing a task exception.
51 AllocSignal(), FreeSignal(), Wait(), SetSignal(), Signal()
57 ******************************************************************************/
61 /* Get pointer to current task */
62 struct Task
*thisTask
= GET_THIS_TASK
;
65 /* Protect mask of sent signals and task lists */
67 #if defined(__AROSEXEC_SMP__)
68 EXEC_LOCK_WRITE(&IntETask(thisTask
->tc_UnionETask
.tc_ETask
)->iet_TaskLock
);
72 old
= thisTask
->tc_SigExcept
;
74 /* Change exception mask */
75 thisTask
->tc_SigExcept
= (old
& ~signalSet
) | (newSignals
& signalSet
);
77 /* Does this change include an exception? */
78 if (thisTask
->tc_SigExcept
& thisTask
->tc_SigRecvd
)
80 /* Yes. Set the exception flag. */
81 thisTask
->tc_Flags
|= TF_EXCEPT
;
83 /* And order rescheduling */
86 #if defined(__AROSEXEC_SMP__)
87 EXEC_UNLOCK(&IntETask(thisTask
->tc_UnionETask
.tc_ETask
)->iet_TaskLock
);