move VMWare SVGA driver to generic location
[AROS.git] / rom / exec / exception.c
blob57f9c79ab7072b955d3481190df3b8347f5295b1
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Exception - Perform a task exception.
6 Lang: english
7 */
8 #include <exec/execbase.h>
9 #include <aros/asmcall.h>
11 /*****i*************************************************************************
13 NAME */
14 #include <proto/exec.h>
16 AROS_LH0(void, Exception,
18 /* LOCATION */
19 struct ExecBase *, SysBase, 11, Exec)
21 /* FUNCTION
22 Exception handler. This function is called by the dispatcher if
23 a task exception has occured. It is called in the Disable()'d
24 state so that all signals are still unchanged.
26 TF_EXCEPT is still set and must be reset by this route.
28 The exception code is called with the following parameters:
30 A1 - Task->tc_ExceptData
31 D0 - Mask of Flags which caused this exception.
32 A6 - SysBase
34 INPUTS
36 RESULT
38 NOTES
39 Exec internal function.
41 EXAMPLE
43 BUGS
45 SEE ALSO
46 Dispatch()
48 INTERNALS
50 ******************************************************************************/
52 AROS_LIBFUNC_INIT
54 struct Task * this = FindTask (NULL);
55 BYTE nestCnt;
56 ULONG flags;
58 this->tc_Flags &= ~TF_EXCEPT;
60 nestCnt = SysBase->IDNestCnt;
61 SysBase->IDNestCnt = 0;
63 while ((flags = (this->tc_SigExcept & this->tc_SigRecvd)))
65 flags ^= this->tc_SigExcept;
66 flags ^= this->tc_SigRecvd;
68 Enable ();
70 /* Call the Exception with the new AROS ASMCALL macros */
71 if( this->tc_ExceptCode != NULL)
73 this->tc_SigExcept = AROS_UFC3(ULONG, this->tc_ExceptCode,
74 AROS_UFCA(APTR, this->tc_ExceptData, A1),
75 AROS_UFCA(ULONG, flags, D0),
76 AROS_UFCA(struct ExecBase *, SysBase, A6));
78 else
81 We don't have an exception handler, we shouldn't have
82 any exceptions. Clear them.
85 this->tc_SigExcept = 0;
87 Disable ();
90 SysBase->IDNestCnt = nestCnt;
92 AROS_LIBFUNC_EXIT
93 } /* Exception */