From 80445331528a5d1b0ce85f095fe27a3b7fdf5a9e Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 18 Jul 1995 19:27:50 +0000 Subject: merged Linux UNIX simulator support (C) --- cpukit/score/cpu/i386/cpu.c | 3 +-- cpukit/score/cpu/unix/cpu.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'cpukit/score') 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 #include #include #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 -- cgit v1.2.3