2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
5 Desc: Exception - Perform a task exception.
8 #include <exec/execbase.h>
9 #include <aros/asmcall.h>
10 #include <exec_platform.h>
12 /*****i*************************************************************************
15 #include <proto/exec.h>
17 AROS_LH0(void, Exception
,
20 struct ExecBase
*, SysBase
, 11, Exec
)
23 Exception handler. This function is called by the dispatcher if
24 a task exception has occured. It is called in the Disable()'d
25 state so that all signals are still unchanged.
27 TF_EXCEPT is still set and must be reset by task route.
29 The exception code is called with the following parameters:
31 A1 - Task->tc_ExceptData
32 D0 - Mask of Flags which caused task exception.
40 This function is private. Do not call it from any program.
50 Unlike in AmigaOS task function is called in user mode.
52 ******************************************************************************/
56 struct Task
*task
= FindTask (NULL
);
60 task
->tc_Flags
&= ~TF_EXCEPT
;
62 nestCnt
= IDNESTCOUNT_GET
;
65 while ((flags
= (task
->tc_SigExcept
& task
->tc_SigRecvd
)))
67 task
->tc_SigExcept
^= flags
;
68 task
->tc_SigRecvd
^= flags
;
72 /* Call the Exception */
73 if(task
->tc_ExceptCode
)
75 task
->tc_SigExcept
|= AROS_UFC3(ULONG
, task
->tc_ExceptCode
,
76 AROS_UFCA(APTR
, task
->tc_ExceptData
, A1
),
77 AROS_UFCA(ULONG
, flags
, D0
),
78 AROS_UFCA(struct ExecBase
*, SysBase
, A6
));
84 IDNESTCOUNT_SET(nestCnt
);