summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/unix/cpu.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-07-18 19:58:45 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-07-18 19:58:45 +0000
commit10aed1e3c0697493d4f6aecc308c86d0aabd40fc (patch)
tree8f25b9488d8ab693d5e1796fa8456ce5889069eb /cpukit/score/cpu/unix/cpu.c
parentmerged Linux UNIX simulator support (C) (diff)
downloadrtems-10aed1e3c0697493d4f6aecc308c86d0aabd40fc.tar.bz2
fixed for Linux
Diffstat (limited to '')
-rw-r--r--cpukit/score/cpu/unix/cpu.c37
1 files changed, 24 insertions, 13 deletions
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 <unistd.h>
#include <signal.h>
#include <time.h>
+#include <sys/time.h>
#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: