home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / config / dummy / exception.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-15  |  584 b   |  29 lines

  1. #include <exec/execbase.h>
  2. #include <clib/exec_protos.h>
  3. #include <machine.h>
  4.  
  5. void exception(struct ExecBase *SysBase)
  6. {
  7.     struct Task *me=SysBase->ThisTask;
  8.     ULONG sig;
  9.     APTR data;
  10.     BYTE idn;
  11.     me->tc_Flags&=~TF_EXCEPT;
  12.     idn=SysBase->IDNestCnt;
  13.     SysBase->IDNestCnt=0;
  14.     for(;;)
  15.     {
  16.         sig=me->tc_SigExcept&me->tc_SigRecvd;
  17.         if(!sig)
  18.             break;
  19.         me->tc_SigExcept^=sig;
  20.         me->tc_SigRecvd ^=sig;
  21.         data=me->tc_ExceptData;
  22.         Enable();
  23.         sig=((ULONG(*)(ULONG,APTR,struct ExecBase*))me->tc_ExceptCode)
  24.             (sig,data,SysBase);
  25.         Disable();
  26.         me->tc_SigExcept|=sig;
  27.     }
  28.     SysBase->IDNestCnt=idn;
  29. }