summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-07-18 19:27:50 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-07-18 19:27:50 +0000
commit80445331528a5d1b0ce85f095fe27a3b7fdf5a9e (patch)
treeca7d09bddb0a44ead621008d207cb27132864124 /cpukit/score/cpu
parentall built successfully after merge (diff)
downloadrtems-80445331528a5d1b0ce85f095fe27a3b7fdf5a9e.tar.bz2
merged Linux UNIX simulator support (C)
Diffstat (limited to 'cpukit/score/cpu')
-rw-r--r--cpukit/score/cpu/i386/cpu.c3
-rw-r--r--cpukit/score/cpu/unix/cpu.c22
2 files changed, 23 insertions, 2 deletions
diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
index f2859230e2..cf30fd0b94 100644
--- a/cpukit/score/cpu/i386/cpu.c
+++ b/cpukit/score/cpu/i386/cpu.c
@@ -73,7 +73,6 @@ void _CPU_Initialize(
*/
#if __GO32__
-#include <cpu.h>
#include <go32.h>
#include <dpmi.h>
#endif /* __GO32__ */
@@ -89,7 +88,7 @@ void _CPU_ISR_install_raw_handler(
*old_handler = 0; /* XXX not supported */
- handler_info.pm_offset = new_handler;
+ handler_info.pm_offset = (u_long) new_handler;
handler_info.pm_selector = _go32_my_cs();
/* install the IDT entry */
diff --git a/cpukit/score/cpu/unix/cpu.c b/cpukit/score/cpu/unix/cpu.c
index acd53e3fd2..a7e1b3bfce 100644
--- a/cpukit/score/cpu/unix/cpu.c
+++ b/cpukit/score/cpu/unix/cpu.c
@@ -391,6 +391,28 @@ void _CPU_Context_Initialize(
*(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET;
*(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE);
*(addr + FP_OFF) = (unsigned32)(_stack_high);
+
+#elif defined(i386)
+
+ /*
+ * This information was gathered by disassembling setjmp().
+ */
+
+ 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[ 0 ] = jmp_addr;
+ addr[ 1 ] = (unsigned32) stack_ptr;
+ addr[ 2 ] = (unsigned32) stack_ptr;
+
#else
#error "UNKNOWN CPU!!!"
#endif