From 10aed1e3c0697493d4f6aecc308c86d0aabd40fc Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 18 Jul 1995 19:58:45 +0000 Subject: fixed for Linux --- cpukit/score/cpu/unix/cpu.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'cpukit/score/cpu/unix/cpu.c') diff --git a/cpukit/score/cpu/unix/cpu.c b/cpukit/score/cpu/unix/cpu.c index a7e1b3bfce..524067703d 100644 --- a/cpukit/score/cpu/unix/cpu.c +++ b/cpukit/score/cpu/unix/cpu.c @@ -24,6 +24,7 @@ #include #include #include +#include #ifndef SA_RESTART #define SA_RESTART 0 @@ -104,12 +105,16 @@ void _CPU_Signal_initialize( void ) sigaction(SIGINT, &act, 0); sigaction(SIGQUIT, &act, 0); sigaction(SIGILL, &act, 0); +#ifdef SIGEMT sigaction(SIGEMT, &act, 0); +#endif sigaction(SIGFPE, &act, 0); sigaction(SIGKILL, &act, 0); sigaction(SIGBUS, &act, 0); sigaction(SIGSEGV, &act, 0); +#ifdef SIGSYS sigaction(SIGSYS, &act, 0); +#endif sigaction(SIGPIPE, &act, 0); sigaction(SIGALRM, &act, 0); sigaction(SIGTERM, &act, 0); @@ -397,21 +402,25 @@ void _CPU_Context_Initialize( /* * This information was gathered by disassembling setjmp(). */ + + { + unsigned32 stack_ptr; + + stack_ptr = _stack_high - CPU_FRAME_SIZE; + + *(addr + EBX_OFF) = 0xFEEDFEED; + *(addr + ESI_OFF) = 0xDEADDEAD; + *(addr + EDI_OFF) = 0xDEAFDEAF; + *(addr + EBP_OFF) = stack_ptr; + *(addr + ESP_OFF) = stack_ptr; + *(addr + RET_OFF) = jmp_addr; - stack_ptr = _stack_high - CPU_FRAME_SIZE; - *(addr + EBX_OFF) = 0xFEEDFEED; - *(addr + ESI_OFF) = 0xDEADDEAD; - *(addr + EDI_OFF) = 0xDEAFDEAF; - *(addr + EBP_OFF) = stack_ptr; - *(addr + ESP_OFF) = stack_ptr; - *(addr + RET_OFF) = jmp_addr; - - - addr = (unsigned32 *) stack_ptr; + addr = (unsigned32 *) stack_ptr; - addr[ 0 ] = jmp_addr; - addr[ 1 ] = (unsigned32) stack_ptr; - addr[ 2 ] = (unsigned32) stack_ptr; + addr[ 0 ] = jmp_addr; + addr[ 1 ] = (unsigned32) stack_ptr; + addr[ 2 ] = (unsigned32) stack_ptr; + } #else #error "UNKNOWN CPU!!!" @@ -582,7 +591,9 @@ void _CPU_Stray_signal(int sig_num) case SIGHUP: case SIGQUIT: case SIGILL: +#ifdef SIGEMT case SIGEMT: +#endif case SIGKILL: case SIGBUS: case SIGSEGV: -- cgit v1.2.3