made configure determine the mapping from os signals to scsh interrupts

This commit is contained in:
mainzelm 2000-12-14 18:32:53 +00:00
parent 5fab63dc0d
commit 812bc338c3
7 changed files with 90 additions and 425 deletions

View File

@ -116,7 +116,7 @@ SCSHOBJS = \
scsh/flock.o scsh/flock1.o \ scsh/flock.o scsh/flock1.o \
scsh/machine/stdio_dep.o \ scsh/machine/stdio_dep.o \
scsh/machine/time_dep1.o \ scsh/machine/time_dep1.o \
scsh/machine/signals1.o \ scsh/signals1.o \
scsh/machine/libansi.o \ scsh/machine/libansi.o \
scsh/network.o scsh/network1.o \ scsh/network.o scsh/network1.o \
scsh/putenv.o \ scsh/putenv.o \

View File

@ -10,10 +10,6 @@ dnl - Bryan O'Sullivan 3/94
dnl Note, this test didn't work correctly on Sun's which take -cckr as a dnl Note, this test didn't work correctly on Sun's which take -cckr as a
dnl synonym for -c. (HCC) dnl synonym for -c. (HCC)
dnl JMG: hack hack hack
dnl AR=${AR-"ar cq"}
define(S48_CFLAG_CKR, [dnl define(S48_CFLAG_CKR, [dnl
if test "z$GCC" = z; then if test "z$GCC" = z; then
AC_MSG_CHECKING([-cckr]) AC_MSG_CHECKING([-cckr])
@ -123,7 +119,43 @@ AC_DEFUN(SCSH_ELF, [
fi fi
rm -f conftest.c a.out rm -f conftest.c a.out
]) ])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_SIG_NRS, [
AC_MSG_RESULT([defining signal constants])
${CC} -o scsh_aux scsh/scsh_aux.c
AC_DEFINE_UNQUOTED(SIGNR_1, `./scsh_aux 1`, scsh interrupt for signal 1)
AC_DEFINE_UNQUOTED(SIGNR_2, `./scsh_aux 2`, scsh interrupt for signal 2)
AC_DEFINE_UNQUOTED(SIGNR_3, `./scsh_aux 3`, scsh interrupt for signal 3)
AC_DEFINE_UNQUOTED(SIGNR_4, `./scsh_aux 4`, scsh interrupt for signal 4)
AC_DEFINE_UNQUOTED(SIGNR_5, `./scsh_aux 5`, scsh interrupt for signal 5)
AC_DEFINE_UNQUOTED(SIGNR_6, `./scsh_aux 6`, scsh interrupt for signal 6)
AC_DEFINE_UNQUOTED(SIGNR_7, `./scsh_aux 7`, scsh interrupt for signal 7)
AC_DEFINE_UNQUOTED(SIGNR_8, `./scsh_aux 8`, scsh interrupt for signal 8)
AC_DEFINE_UNQUOTED(SIGNR_9, `./scsh_aux 9`, scsh interrupt for signal 9)
AC_DEFINE_UNQUOTED(SIGNR_10, `./scsh_aux 10`, scsh interrupt for signal 10)
AC_DEFINE_UNQUOTED(SIGNR_11, `./scsh_aux 11`, scsh interrupt for signal 11)
AC_DEFINE_UNQUOTED(SIGNR_12, `./scsh_aux 12`, scsh interrupt for signal 12)
AC_DEFINE_UNQUOTED(SIGNR_13, `./scsh_aux 13`, scsh interrupt for signal 13)
AC_DEFINE_UNQUOTED(SIGNR_14, `./scsh_aux 14`, scsh interrupt for signal 14)
AC_DEFINE_UNQUOTED(SIGNR_15, `./scsh_aux 15`, scsh interrupt for signal 15)
AC_DEFINE_UNQUOTED(SIGNR_16, `./scsh_aux 16`, scsh interrupt for signal 16)
AC_DEFINE_UNQUOTED(SIGNR_17, `./scsh_aux 17`, scsh interrupt for signal 17)
AC_DEFINE_UNQUOTED(SIGNR_18, `./scsh_aux 18`, scsh interrupt for signal 18)
AC_DEFINE_UNQUOTED(SIGNR_19, `./scsh_aux 19`, scsh interrupt for signal 19)
AC_DEFINE_UNQUOTED(SIGNR_20, `./scsh_aux 20`, scsh interrupt for signal 20)
AC_DEFINE_UNQUOTED(SIGNR_21, `./scsh_aux 21`, scsh interrupt for signal 21)
AC_DEFINE_UNQUOTED(SIGNR_22, `./scsh_aux 22`, scsh interrupt for signal 22)
AC_DEFINE_UNQUOTED(SIGNR_23, `./scsh_aux 23`, scsh interrupt for signal 23)
AC_DEFINE_UNQUOTED(SIGNR_24, `./scsh_aux 24`, scsh interrupt for signal 24)
AC_DEFINE_UNQUOTED(SIGNR_25, `./scsh_aux 25`, scsh interrupt for signal 25)
AC_DEFINE_UNQUOTED(SIGNR_26, `./scsh_aux 26`, scsh interrupt for signal 26)
AC_DEFINE_UNQUOTED(SIGNR_27, `./scsh_aux 27`, scsh interrupt for signal 27)
AC_DEFINE_UNQUOTED(SIGNR_28, `./scsh_aux 28`, scsh interrupt for signal 28)
AC_DEFINE_UNQUOTED(SIGNR_29, `./scsh_aux 29`, scsh interrupt for signal 29)
AC_DEFINE_UNQUOTED(SIGNR_30, `./scsh_aux 30`, scsh interrupt for signal 30)
AC_DEFINE_UNQUOTED(SIGNR_31, `./scsh_aux 31`, scsh interrupt for signal 31)
rm -f scsh_aux
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_LINUX_STATIC_DEBUG, [ AC_DEFUN(SCSH_LINUX_STATIC_DEBUG, [
case "$host" in case "$host" in
@ -162,6 +194,7 @@ AC_INIT(c/scheme48vm.c)
AC_CONFIG_HEADER(c/sysdep.h) AC_CONFIG_HEADER(c/sysdep.h)
AC_CANONICAL_HOST AC_CANONICAL_HOST
S48_PROG_CC S48_PROG_CC
SCSH_SIG_NRS
AC_ISC_POSIX AC_ISC_POSIX
SCSH_LINUX_STATIC_DEBUG SCSH_LINUX_STATIC_DEBUG
dnl set the cross-compile flag before we try anything. dnl set the cross-compile flag before we try anything.

View File

@ -1,136 +0,0 @@
/* Need to turn off synchronous error signals (SIGPIPE, SIGSYS). */
#include "../scsh_aux.h"
/* Make sure our exports match up w/the implementation: */
#include "../signals1.h"
/* This table converts Unix signal numbers to S48/scsh interrupt numbers.
** If the signal doesn't have an interrupt number, the entry is -1.
** (Only asynchronous signals have interrupt numbers.)
**
** Note that we bake into this table the integer values of the signals --
** i.e., we assume that SIGHUP=1, SIGALRM=15, etc. So this definition is
** very system-dependent.
*/
const int sig2int[] = {
-1, /* 0 is not a signal */
scshint_hup, /* SIGHUP */
scshint_keyboard, /* SIGINT */
scshint_quit, /* SIGQUIT */
-1, /* SIGILL */
-1, /* SIGTRAP */
-1, /* SIGABRT & SIGIOT */
-1, /* SIGEMT */
-1, /* SIGFPE */
-1, /* SIGKILL */
-1, /* SIGBUS */
-1, /* SIGSEGV */
-1, /* SIGSYS */
-1, /* SIGPIPE */
scshint_alarm, /* SIGALRM */
scshint_term, /* SIGTERM */
scshint_urg, /* SIGURG */
-1, /* SIGSTOP */
scshint_tstp, /* SIGTSTP */
scshint_cont, /* SIGCONT */
scshint_chld, /* SIGCHLD */
-1, /* scshint_ttyin, /* SIGTTIN */
-1, /* scshint_ttou, /* SIGTTOU */
scshint_io, /* SIGIO */
scshint_xcpu, /* SIGXCPU */
scshint_xfsz, /* SIGXFSZ */
-1, /* SIGMSG */
scshint_winch, /* SIGWINCH */
scshint_pwr, /* SIGPWR */
scshint_usr1, /* SIGUSR1 */
scshint_usr2, /* SIGUSR2 */
scshint_prof, /* SIGPROF */
-1, /* SIGDANGER */
scshint_vtalrm, /* SIGVTALRM */
-1, /* SIGMIGRATE */
-1, /* SIGPRE */
-1, /* SIGVIRT */
-1, /* SIGALRM1 */
-1 /* SIGWAITING */
};
const int max_sig = 39; /* SIGWAITING */
/*
scshint_alarm
scshint_keyboard
scshint_memory_shortage
scshint_chld
scshint_cont
scshint_hup
scshint_quit
scshint_term
scshint_tstp
scshint_usr1
scshint_usr2
scshint_info
scshint_io
scshint_poll
scshint_prof
scshint_pwr
scshint_urg
scshint_vtalrm
scshint_winch
scshint_xcpu
scshint_xfsz
SIGALRM
SIGCHLD
SIGCONT
SIGHUP
SIGINFO
SIGINT
SIGIO
SIGPROF
SIGQUIT
SIGTERM
SIGTSTP
SIGTTIN
SIGTTOU
SIGURG
SIGUSR1
SIGUSR2
SIGVTALRM
SIGWINCH
SIGXCPU
SIGXFSZ
SIGHUP 1
SIGINT 2
SIGQUIT 3
SIGILL 4
SIGTRAP 5
SIGABRT 6
SIGIOT SIGABRT
SIGEMT 7
SIGFPE 8
SIGKILL 9
SIGBUS 10
SIGSEGV 11
SIGSYS 12
SIGPIPE 13
SIGALRM 14
SIGTERM 15
SIGURG 16
SIGSTOP 17
SIGTSTP 18
SIGCONT 19
SIGCHLD 20
SIGTTIN 21
SIGTTOU 22
SIGIO 23
SIGXCPU 24
SIGXFSZ 25
SIGVTALRM 26
SIGPROF 27
SIGWINCH 28
SIGINFO 29
SIGUSR1 30
SIGUSR2 31
*/

View File

@ -1,129 +0,0 @@
/* Need to turn off synchronous error signals (SIGPIPE, SIGSYS). */
#include "../scsh_aux.h"
/* Make sure our exports match up w/the implementation: */
#include "../signals1.h"
/* This table converts Unix signal numbers to S48/scsh interrupt numbers.
** If the signal doesn't have an interrupt number, the entry is -1.
** (Only asynchronous signals have interrupt numbers.)
**
** Note that we bake into this table the integer values of the signals --
** i.e., we assume that SIGHUP=1, SIGALRM=15, etc. So this definition is
** very system-dependent.
*/
const int sig2int[] = {
-1, /* 0 is not a signal */
scshint_hup, /* SIGHUP */
scshint_keyboard, /* SIGINT */
scshint_quit, /* SIGQUIT */
-1, /* SIGILL */
-1, /* SIGTRAP */
-1, /* SIGABRT & SIGIOT */
-1, /* SIGEMT */
-1, /* SIGFPE */
-1, /* SIGKILL */
-1, /* SIGBUS */
-1, /* SIGSEGV */
-1, /* SIGSYS */
-1, /* SIGPIPE */
scshint_alarm, /* SIGALRM */
scshint_term, /* SIGTERM */
scshint_urg, /* SIGURG */
-1, /* SIGSTOP */
scshint_tstp, /* SIGTSTP */
scshint_cont, /* SIGCONT */
scshint_chld, /* SIGCHLD */
-1, /* scshint_ttyin, /* SIGTTIN */
-1, /* scshint_ttou, /* SIGTTOU */
scshint_io, /* SIGIO */
scshint_xcpu, /* SIGXCPU */
scshint_xfsz, /* SIGXFSZ */
scshint_vtalrm, /* SIGVTALRM */
scshint_prof, /* SIGPROF */
scshint_winch, /* SIGWINCH */
scshint_info, /* SIGINFO */
scshint_usr1, /* SIGUSR1 */
scshint_usr2 /* SIGUSR2 */
};
const int max_sig = 31; /* SIGUSR2 */
/*
scshint_alarm
scshint_keyboard
scshint_memory_shortage
scshint_chld
scshint_cont
scshint_hup
scshint_quit
scshint_term
scshint_tstp
scshint_usr1
scshint_usr2
scshint_info
scshint_io
scshint_poll
scshint_prof
scshint_pwr
scshint_urg
scshint_vtalrm
scshint_winch
scshint_xcpu
scshint_xfsz
SIGALRM
SIGCHLD
SIGCONT
SIGHUP
SIGINFO
SIGINT
SIGIO
SIGPROF
SIGQUIT
SIGTERM
SIGTSTP
SIGTTIN
SIGTTOU
SIGURG
SIGUSR1
SIGUSR2
SIGVTALRM
SIGWINCH
SIGXCPU
SIGXFSZ
SIGHUP 1
SIGINT 2
SIGQUIT 3
SIGILL 4
SIGTRAP 5
SIGABRT 6
SIGIOT SIGABRT
SIGEMT 7
SIGFPE 8
SIGKILL 9
SIGBUS 10
SIGSEGV 11
SIGSYS 12
SIGPIPE 13
SIGALRM 14
SIGTERM 15
SIGURG 16
SIGSTOP 17
SIGTSTP 18
SIGCONT 19
SIGCHLD 20
SIGTTIN 21
SIGTTOU 22
SIGIO 23
SIGXCPU 24
SIGXFSZ 25
SIGVTALRM 26
SIGPROF 27
SIGWINCH 28
SIGINFO 29
SIGUSR1 30
SIGUSR2 31
*/

View File

@ -1,52 +0,0 @@
/* This is bogus -- currently unchanged from the bsd file. */
/* Need to turn off synchronous error signals (SIGPIPE, SIGSYS). */
#include "../scsh_aux.h"
/* Make sure our exports match up w/the implementation: */
#include "../signals1.h"
/* This table converts Unix signal numbers to S48/scsh interrupt numbers.
** If the signal doesn't have an interrupt number, the entry is -1.
** (Only asynchronous signals have interrupt numbers.)
**
** Note that we bake into this table the integer values of the signals --
** i.e., we assume that SIGHUP=1, SIGALRM=15, etc. So this definition is
** very system-dependent.
*/
const int sig2int[] = {
-1, /* 0 is not a signal */
scshint_hup, /* SIGHUP */
scshint_keyboard, /* SIGINT */
scshint_quit, /* SIGQUIT */
-1, /* SIGILL */
-1, /* SIGTRAP */
-1, /* SIGABRT & SIGIOT */
-1, /* SIGBUS */
-1, /* SIGFPE */
-1, /* SIGKILL */
scshint_usr1, /* SIGUSR1 */
-1, /* SIGSEGV */
scshint_usr2, /* SIGUSR2 */
-1, /* SIGPIPE */
scshint_alarm, /* SIGALRM */
scshint_term, /* SIGTERM */
-1, /* SIGTKFLT (x86 coprocessor stack fault) */
scshint_chld, /* SIGCHLD */
scshint_cont, /* SIGCONT */
-1, /* SIGSTOP */
scshint_tstp, /* SIGTSTP */
-1, /* scshint_ttyin, /* SIGTTIN */
-1, /* scshint_ttou, /* SIGTTOU */
scshint_urg, /* SIGURG */
scshint_xcpu, /* SIGXCPU */
scshint_xfsz, /* SIGXFSZ */
scshint_vtalrm, /* SIGVTALRM */
scshint_prof, /* SIGPROF */
scshint_winch, /* SIGWINCH */
scshint_io, /* SIGIO aka SIGPOLL*/
scshint_pwr, /* SIGPWR */
-1 /* SIGPWR */
};
const int max_sig = 31; /* SIGUNUSED */

51
scsh/signals1.c Normal file
View File

@ -0,0 +1,51 @@
/* Need to turn off synchronous error signals (SIGPIPE, SIGSYS). */
#include <sysdep.h>
#include "scsh_aux.h"
/* Make sure our exports match up w/the implementation: */
#include "signals1.h"
/* This table converts Unix signal numbers to S48/scsh interrupt numbers.
** If the signal doesn't have an interrupt number, the entry is -1.
** (Only asynchronous signals have interrupt numbers.)
**
** Note that we bake into this table the integer values of the signals --
** i.e., we assume that SIGHUP=1, SIGALRM=15, etc. So this definition is
** very system-dependent.
*/
const int sig2int[] = {
-1, /* 0 is not a signal */
SIGNR_1,
SIGNR_2,
SIGNR_3,
SIGNR_4,
SIGNR_5,
SIGNR_6,
SIGNR_7,
SIGNR_8,
SIGNR_9,
SIGNR_10,
SIGNR_11,
SIGNR_12,
SIGNR_13,
SIGNR_14,
SIGNR_15,
SIGNR_16,
SIGNR_17,
SIGNR_18,
SIGNR_19,
SIGNR_20,
SIGNR_21,
SIGNR_22,
SIGNR_23,
SIGNR_24,
SIGNR_25,
SIGNR_26,
SIGNR_27,
SIGNR_28,
SIGNR_29,
SIGNR_30,
SIGNR_31
};
const int max_sig = 31; /* SIGUNUSED */

View File

@ -1,102 +0,0 @@
/* Need to turn off synchronous error signals (SIGPIPE, SIGSYS). */
#include "../scsh_aux.h"
/* Make sure our exports match up w/the implementation: */
#include "../signals1.h"
/* This table converts Unix signal numbers to S48/scsh interrupt numbers.
** If the signal doesn't have an interrupt number, the entry is -1.
** (Only asynchronous signals have interrupt numbers.)
**
** Note that we bake into this table the integer values of the signals --
** i.e., we assume that SIGHUP=1, SIGALRM=15, etc. So this definition is
** very system-dependent.
*/
const int sig2int[] = {
-1, /* 0 is not a signal */
scshint_hup, /* 1: SIGHUP */
scshint_keyboard, /* 2: SIGINT */
scshint_quit, /* 3: SIGQUIT */
-1, /* 4: SIGILL */
-1, /* 5: SIGTRAP */
-1, /* 6: SIGABRT SIGIOT*/
-1, /* 7: SIGEMT */
-1, /* 8: SIGFPE */
-1, /* 9: SIGKILL */
-1, /* 10: SIGBUS */
-1, /* 11: SIGSEGV */
-1, /* 12: SIGSYS */
-1, /* 13: SIGPIPE */
scshint_alarm, /* 14: SIGALRM */
scshint_term, /* 15: SIGTERM */
scshint_usr1, /* 16: SIGUSR1 */
scshint_usr2, /* 17: SIGUSR2 */
scshint_chld, /* 18: SIGCHLD SIGCHD */
scshint_pwr, /* 19: SIGPWR */
scshint_winch, /* 20: SIGWINCH */
scshint_urg, /* 21: SIGURG */
scshint_io, /* 22: SIGIO SIGPOLL */
-1, /* 23: SIGSTOP */
scshint_tstp, /* 24: SIGTSTP */
scshint_cont, /* 25: SIGCONT */
-1, /* 26: SIGTTIN */ /* scshint_ttyin */
-1, /* 27: SIGTTOU */ /* scshint_ttyou */
scshint_vtalrm, /* 28: SIGVTALRM */
scshint_prof, /* 29: SIGPROF */
scshint_xcpu, /* 30: SIGXCPU */
scshint_xfsz /* 31: SIGXFSZ */
-1, /* 32: SIGWAITING */
-1, /* 33: SIGLWP */
-1, /* 34: SIGFREEZE */
-1, /* 35: SIGTHAW */
-1, /* 36: SIGCANCEL */
};
const int max_sig = 36; /* SIGXFSZ */
/*
scshint_alarm
scshint_keyboard
scshint_memory_shortage
scshint_chld
scshint_cont
scshint_hup
scshint_quit
scshint_term
scshint_tstp
scshint_usr1
scshint_usr2
scshint_info
scshint_io
scshint_poll
scshint_prof
scshint_pwr
scshint_urg
scshint_vtalrm
scshint_winch
scshint_xcpu
scshint_xfsz
scshint_alarm
scshint_chld
scshint_cont
scshint_hup
scshint_info
scshint_io
scshint_keyboard
scshint_memory_shortage
scshint_poll
scshint_prof
scshint_pwr
scshint_quit
scshint_term
scshint_tstp
scshint_urg
scshint_usr1
scshint_usr2
scshint_vtalrm
scshint_winch
scshint_xcpu
scshint_xfsz
*/