From 71d96829f870ed9ea5602b94e37ef060c9152c51 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 18 Apr 1998 05:32:48 +0000 Subject: [PATCH] Define WINNT_RAW_ADDRESSES -- alternative isn't used any longer and has a small time penalty. --- v7/src/microcode/cmpauxmd/i386.m4 | 8 +++----- v7/src/microcode/config.h | 12 ++++++++++-- v7/src/microcode/nttrap.c | 14 +++++++++++++- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/v7/src/microcode/cmpauxmd/i386.m4 b/v7/src/microcode/cmpauxmd/i386.m4 index 4b64e58e7..254f4a6aa 100644 --- a/v7/src/microcode/cmpauxmd/i386.m4 +++ b/v7/src/microcode/cmpauxmd/i386.m4 @@ -1,8 +1,8 @@ ### -*-Midas-*- ### -### $Id: i386.m4,v 1.47 1997/05/05 06:59:35 cph Exp $ +### $Id: i386.m4,v 1.48 1998/04/18 05:32:48 cph Exp $ ### -### Copyright (c) 1992-97 Massachusetts Institute of Technology +### Copyright (c) 1992-98 Massachusetts Institute of Technology ### ### This material was developed by the Scheme project at the ### Massachusetts Institute of Technology, Department of @@ -407,7 +407,7 @@ allocate_space(Registers,eval(REGBLOCK_SIZE_IN_OBJECTS*4)) ') ') -IF_WIN32(`use_external_data(EVR(winnt_address_delta))') +ifdef(`HACK_SEGMENT_REGS',`use_external_data(EVR(winnt_address_delta))') define_data(i387_presence) allocate_longword(i387_presence) @@ -418,8 +418,6 @@ allocate_longword(C_Stack_Pointer) define_data(C_Frame_Pointer) allocate_longword(C_Frame_Pointer) -IF_WIN32(`define(HACK_SEGMENT_REGS,1)') - ifdef(`HACK_SEGMENT_REGS',` define_data(Scheme_Transfer_Address) diff --git a/v7/src/microcode/config.h b/v7/src/microcode/config.h index f1505e0fb..40b24ff8c 100644 --- a/v7/src/microcode/config.h +++ b/v7/src/microcode/config.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: config.h,v 9.97 1996/12/16 04:53:17 cph Exp $ +$Id: config.h,v 9.98 1998/04/18 05:31:11 cph Exp $ -Copyright (c) 1987-96 Massachusetts Institute of Technology +Copyright (c) 1987-98 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -446,6 +446,14 @@ extern void * linux_heap_malloc (unsigned long); #define HEAP_FREE(address) #endif +/* !WINNT_RAW_ADDRESSES is useful only for Windows 3.1, which we no + longer support -- so define it always. */ +#ifdef WINNT +#ifndef WINNT_RAW_ADDRESSES +#define WINNT_RAW_ADDRESSES +#endif +#endif + #if defined(WINNT) && !defined(WINNT_RAW_ADDRESSES) /* This kludge exists because of Win32s which allocates diff --git a/v7/src/microcode/nttrap.c b/v7/src/microcode/nttrap.c index 323c73769..d10b7a111 100644 --- a/v7/src/microcode/nttrap.c +++ b/v7/src/microcode/nttrap.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: nttrap.c,v 1.15 1998/02/01 05:35:33 cph Exp $ +$Id: nttrap.c,v 1.16 1998/04/18 05:31:50 cph Exp $ Copyright (c) 1992-98 Massachusetts Institute of Technology @@ -50,6 +50,7 @@ extern int EXFUN (TellUserEx, (int, char *, ...)); extern void EXFUN (NT_initialize_traps, (void)); extern void EXFUN (NT_restore_traps, (void)); +#ifndef WINNT_RAW_ADDRESSES extern unsigned short Scheme_Code_Segment_Selector, Scheme_Data_Segment_Selector, @@ -58,6 +59,7 @@ extern unsigned short C_Data_Segment_Selector, C_Extra_Segment_Selector, C_Stack_Segment_Selector; +#endif extern DWORD C_Stack_Pointer, @@ -394,9 +396,12 @@ DEFUN (display_exception_information, (info, context, flags), bufptr += (sprintf (bufptr, "\ncontext->Eip = 0x%lx.", context->Eip)); bufptr += (sprintf (bufptr, "\ncontext->Esp = 0x%lx.", context->Esp)); bufptr += (sprintf (bufptr, "\nStack_Pointer = 0x%lx.", Stack_Pointer)); +#ifndef WINNT_RAW_ADDRESSES bufptr += (sprintf (bufptr, "\nwinnt_address_delta = 0x%lx.", winnt_address_delta)); +#endif bufptr += (sprintf (bufptr, "\nadj (Stack_Pointer) = 0x%lx.", (ADDR_TO_SCHEME_ADDR (Stack_Pointer)))); +#ifndef WINNT_RAW_ADDRESSES bufptr += (sprintf (bufptr, "\nCS = 0x%04x;\tC CS = 0x%04x;\tS CS = 0x%04x.", context->SegCs, C_Code_Segment_Selector, @@ -416,6 +421,7 @@ DEFUN (display_exception_information, (info, context, flags), context->SegSs, C_Stack_Segment_Selector, Scheme_Stack_Segment_Selector)); +#endif } #endif /* W32_TRAP_DEBUG */ @@ -668,12 +674,14 @@ DEFUN (continue_from_trap, (code, context), Stack_Pointer, context->Esp)); scheme_sp = (context->Esp); } +#ifndef WINNT_RAW_ADDRESSES else if (context->SegSs == Scheme_Stack_Segment_Selector) { IFVERBOSE (TellUserEx (MB_OKCANCEL, "continue_from_trap: SS = Scheme SS.")); scheme_sp = ((long) (SCHEME_ADDR_TO_ADDR (context->Esp))); } +#endif else { IFVERBOSE (TellUserEx (MB_OKCANCEL, "continue_from_trap: SS unknown!")); @@ -685,12 +693,14 @@ DEFUN (continue_from_trap, (code, context), IFVERBOSE (TellUserEx (MB_OKCANCEL, "continue_from_trap: CS = C CS.")); the_pc = (context->Eip & PC_VALUE_MASK); } +#ifndef WINNT_RAW_ADDRESSES else if (context->SegCs == Scheme_Code_Segment_Selector) { IFVERBOSE (TellUserEx (MB_OKCANCEL, "continue_from_trap: CS = Scheme CS")); /* Assume in Scheme. Of course, it could be in a builtin. */ the_pc = ((long) (SCHEME_ADDR_TO_ADDR (context->Eip & PC_VALUE_MASK))); } +#endif else { IFVERBOSE (TellUserEx (MB_OKCANCEL, "continue_from_trap: CS unknown")); @@ -879,10 +889,12 @@ pc_in_hyperspace: if (pc_in_scheme && (! (win32_under_win32s_p ()))) { +#ifndef WINNT_RAW_ADDRESSES context->SegCs = C_Code_Segment_Selector; context->SegDs = C_Data_Segment_Selector; context->SegEs = C_Extra_Segment_Selector; context->SegSs = C_Stack_Segment_Selector; +#endif context->Esp = C_Stack_Pointer; context->Ebp = C_Frame_Pointer; if (pc_in_scheme) -- 2.25.1