2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include <hardware/intbits.h>
7 #include <exec/interrupts.h>
8 #include <exec/execbase.h>
9 #include <proto/exec.h>
10 #include <aros/asmcall.h>
14 static int sig2inttabl
[NSIG
];
21 sigprocmask(0, &x
, 0);
24 static void signals(int sig
)
28 iv
=&SysBase
->IntVects
[sig2inttabl
[sig
]];
29 AROS_UFC2(void,iv
->iv_Code
,
30 AROS_UFCA(APTR
,iv
->iv_Data
,A1
),
31 AROS_UFCA(struct ExecBase
*,SysBase
,A6
));
34 if(SysBase
->AttnResched
&0x8000)
36 SysBase
->AttnResched
&=~0x8000;
43 static const int sig2int
[][2]=
45 { SIGALRM
, INTB_VERTB
},
47 struct itimerval interval
;
49 struct sigaction sa
={ signals
, ~0ul, 0 };
51 for(i
=0;i
<sizeof(sig2int
)/sizeof(sig2int
[0]);i
++)
53 sig2inttabl
[sig2int
[i
][0]]=sig2int
[i
][1];
54 sigaction(sig2int
[i
][0],&sa
,NULL
);
57 interval
.it_interval
.tv_sec
= interval
.it_value
.tv_sec
= 0;
58 interval
.it_interval
.tv_usec
= interval
.it_value
.tv_usec
= 1000000/50;
60 setitimer (ITIMER_REAL
, &interval
, NULL
);