added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / .unmaintained / m68k-native / exec / initcore.c
blob64e54336c7d155739f9be0af0fd0cd7d44e1b7df
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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>
11 #include <signal.h>
12 #include <sys/time.h>
14 static int sig2inttabl[NSIG];
15 char supervisor;
17 void disable(void)
19 sigset_t x = -1;
21 sigprocmask(0, &x, 0);
24 static void signals(int sig)
26 struct IntVector *iv;
27 supervisor++;
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));
32 disable();
33 supervisor--;
34 if(SysBase->AttnResched&0x8000)
36 SysBase->AttnResched&=~0x8000;
37 Dispatch();
41 void InitCore(void)
43 static const int sig2int[][2]=
45 { SIGALRM, INTB_VERTB },
47 struct itimerval interval;
48 int i;
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);