Back to index

plt-scheme  4.2.1
schmach.h
Go to the documentation of this file.
00001 /* Sparc fix borrowed from SCM, so here's the copyright:  */
00002 /* Scheme implementation intended for JACAL.
00003    Copyright (C) 1990, 1991, 1992, 1993, 1994 Aubrey Jaffer. */
00004 /* James Clark came up with this neat one instruction fix for
00005    continuations on the SPARC.  It flushes the register windows so
00006    that all the state of the process is contained in the stack. */
00007 #ifdef FLUSH_SPARC_REGISTER_WINDOWS
00008 #define FLUSH_REGISTER_WINDOWS asm("ta 3")
00009 #else
00010 #define FLUSH_REGISTER_WINDOWS /* empty */
00011 #endif
00012 
00013 /* If stack is not longword aligned then */
00014 
00015 /* #define SHORT_ALIGN */
00016 #ifdef THINK_C
00017 #define SHORT_ALIGN
00018 #endif
00019 #ifdef MSDOS
00020 #define SHORT_ALIGN
00021 #endif
00022 #ifdef atarist
00023 #define SHORT_ALIGN
00024 #endif
00025 
00026 /* If stacks grow up then */
00027 
00028  /* STACK_GROWS_UP means that deeper stack values have higher
00029      numbered addresses.
00030     STACK_GROWS_DOWN means that deeper stack values have lower
00031      numbered addresses. This is usually the case (Sparc and
00032      Intel platforms, for example, use this). */
00033 
00034 #if STACK_DIRECTION > 0
00035 # define STACK_GROWS_UP
00036 #else
00037 # define STACK_GROWS_DOWN
00038 #endif
00039 
00040 #ifdef STACK_GROWS_UP
00041 # define STK_COMP(a,b) ((a) > (b))
00042 # define STK_DIFF(a, b) ((a) - (b))
00043 #else
00044 # define STK_COMP(a,b) ((a) < (b))
00045 # define STK_DIFF(a, b) ((b) - (a))
00046 #endif
00047 
00048 #ifdef SHORT_ALIGN
00049 typedef short stack_val;
00050 #else
00051 typedef long stack_val;
00052 #endif
00053 
00054 #ifndef STACK_SAFETY_MARGIN
00055 # define STACK_SAFETY_MARGIN 50000
00056 #endif