From: Chris Hanson Date: Wed, 8 Mar 1995 21:36:54 +0000 (+0000) Subject: Add stack hooks for OS/2 stack-overflow detection. Move existing X-Git-Tag: 20090517-FFI~6553 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c89faf2ddc73f32a9ae72257979c9b8247facd3d;p=mit-scheme.git Add stack hooks for OS/2 stack-overflow detection. Move existing overrides of STACK_RESET macro from "stack.h" to "config.h". Change `Stack_Check' macro to use STACK_OVERFLOWED_P macro rather than comparing the stack pointer to `Stack_Bottom', because OS/2 overrides this macro with an unusual definition. --- diff --git a/v7/src/microcode/config.h b/v7/src/microcode/config.h index e169d2c52..843c40e2b 100644 --- a/v7/src/microcode/config.h +++ b/v7/src/microcode/config.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: config.h,v 9.86 1995/01/06 17:41:59 cph Exp $ +$Id: config.h,v 9.87 1995/03/08 21:36:54 cph Exp $ Copyright (c) 1987-95 Massachusetts Institute of Technology @@ -537,7 +537,23 @@ extern void * OS2_commit_heap (unsigned long); #define EXIT_SCHEME_DECLARATIONS extern void OS2_exit_scheme (int) #define EXIT_SCHEME OS2_exit_scheme +extern void OS2_stack_reset (void); +#define STACK_RESET OS2_stack_reset + +extern int OS2_stack_overflowed_p (void); +#define STACK_OVERFLOWED_P OS2_stack_overflowed_p + #endif /* _OS2 */ + +#ifdef DOS386 +extern void EXFUN (dos386_stack_reset, (void)); +#define STACK_RESET dos386_stack_reset +#endif /* DOS386 */ + +#ifdef WINNT +extern void EXFUN (winnt_stack_reset, (void)); +#define STACK_RESET winnt_stack_reset +#endif /* WINNT */ /* These (pdp10, nu) haven't worked in a while. Should be upgraded or flushed some day. */ diff --git a/v7/src/microcode/stack.h b/v7/src/microcode/stack.h index 63af89159..42165dfb7 100644 --- a/v7/src/microcode/stack.h +++ b/v7/src/microcode/stack.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: stack.h,v 9.36 1993/10/14 19:20:58 gjr Exp $ +$Id: stack.h,v 9.37 1995/03/08 21:36:44 cph Exp $ -Copyright (c) 1987-1993 Massachusetts Institute of Technology +Copyright (c) 1987-95 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -34,21 +34,10 @@ MIT in each case. */ /* This file contains macros for manipulating stacks and stacklets. */ -#ifdef DOS386 - extern void EXFUN (dos386_stack_reset, (void)); -# define STACK_RESET() dos386_stack_reset() -#endif /* DOS386 */ - -#ifdef WINNT - extern void EXFUN (winnt_stack_reset, (void)); -# define STACK_RESET() winnt_stack_reset() -#endif /* WINNT */ - #ifndef STACK_RESET # define STACK_RESET() do {} while (0) #endif /* STACK_RESET */ - #ifdef USE_STACKLETS /* @@ -292,11 +281,12 @@ Pushed() #define Stack_Check(P) do \ { \ if ((P) <= Stack_Guard) \ - { \ - if ((P) <= Stack_Bottom) \ - Microcode_Termination (TERM_STACK_OVERFLOW); \ - REQUEST_INTERRUPT (INT_Stack_Overflow); \ - } \ + { \ + extern void EXFUN (stack_death, (CONST char *)); \ + if (STACK_OVERFLOWED_P ()) \ + stack_death ("Stack_Check"); \ + REQUEST_INTERRUPT (INT_Stack_Overflow); \ + } \ } while (0) #define Internal_Will_Push(N) Stack_Check(Stack_Pointer - (N))