Add stack hooks for OS/2 stack-overflow detection. Move existing
authorChris Hanson <org/chris-hanson/cph>
Wed, 8 Mar 1995 21:36:54 +0000 (21:36 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 8 Mar 1995 21:36:54 +0000 (21:36 +0000)
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.

v7/src/microcode/config.h
v7/src/microcode/stack.h

index e169d2c52dda604bb3f479128fe60e7cea8b89dc..843c40e2b701e37ca959991da3d29139cd871746 100644 (file)
@@ -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 */
 \f
 /* These (pdp10, nu) haven't worked in a while.
    Should be upgraded or flushed some day.  */
index 63af89159f2a0db258b3c5a3052932ee687675b7..42165dfb78ba4eb232d86e4689322385e606bbec 100644 (file)
@@ -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. */
 \f
-#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))