From 50eb784bfcf15ee3c6b0b53d747db92673395040 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:34 -0800 Subject: Import Upstream version 5e3 --- continue.h | 125 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 65 insertions(+), 60 deletions(-) (limited to 'continue.h') diff --git a/continue.h b/continue.h index 040b4b5..e1703bf 100644 --- a/continue.h +++ b/continue.h @@ -42,12 +42,65 @@ /* "continue.h" Scheme Continuations for C. Author: Aubrey Jaffer. */ +/* If stack is not longword aligned then */ + +/* #define SHORT_ALIGN */ +#ifdef THINK_C +# define SHORT_ALIGN +#endif +#ifdef __MWERKS__ +# ifdef __MC68K__ +# define SHORT_ALIGN +# endif +#endif +#ifdef MSDOS +# ifndef _M_ARM +/* arm processors need DWORD aligned data access */ +# define SHORT_ALIGN +# endif +#endif +#ifdef atarist +# define SHORT_ALIGN +#endif + +#ifdef SHORT_ALIGN +typedef short STACKITEM; +#else +typedef long STACKITEM; +#endif + +/* If stacks grow up then */ + +/* #define STACK_GROWS_UP */ +#ifdef hp9000s800 +# define STACK_GROWS_UP +#endif +#ifdef pyr +# define STACK_GROWS_UP +#endif +#ifdef nosve +# define STACK_GROWS_UP +#endif +#ifdef _UNICOS +# define STACK_GROWS_UP +#endif + +/* James Clark came up with this neat one instruction fix for + continuations on the SPARC. It flushes the register windows so + that all the state of the process is contained in the stack. */ + +#ifdef sparc +# define FLUSH_REGISTER_WINDOWS asm("ta 3") +#else +# define FLUSH_REGISTER_WINDOWS /* empty */ +#endif + #ifdef vax # ifndef CHEAP_CONTINUATIONS - typedef int jump_buf[17]; - extern int setjump(jump_buf env); - extern int longjump(jump_buf env, int ret); +typedef int jump_buf[17]; +extern int setjump(jump_buf env); +extern int longjump(jump_buf env, int ret); # else # include @@ -58,9 +111,9 @@ #else /* ndef vax */ # ifdef _CRAY1 - typedef int jump_buf[112]; - extern int setjump(jump_buf env); - extern int longjump(jump_buf env, int ret); +typedef int jump_buf[112]; +extern int setjump(jump_buf env); +extern int longjump(jump_buf env, int ret); # else /* ndef _CRAY1 */ # ifndef PLAN9 @@ -75,7 +128,7 @@ # define jump_buf jmp_buf # define setjump setjmp # define longjump longjmp -# endif /* ndef HAVE_SIGSETJMP */ +# endif /* ndef SIG_UNBLOCK */ # endif /* ndef _CRAY1 */ #endif /* ndef vax */ @@ -86,37 +139,15 @@ # define CONTINUATION_OTHER int #endif -/* If stack is not longword aligned then */ - -/* #define SHORT_ALIGN */ -#ifdef THINK_C -# define SHORT_ALIGN -#endif -#ifdef __MWERKS__ -# ifdef __MC68K__ -# define SHORT_ALIGN -# endif -#endif -#ifdef MSDOS -# ifndef _M_ARM -/* arm processors need DWORD aligned data access */ -# define SHORT_ALIGN -# endif -#endif -#ifdef atarist -# define SHORT_ALIGN -#endif - -#ifdef SHORT_ALIGN -typedef short STACKITEM; -#else -typedef long STACKITEM; -#endif - struct Continuation {jump_buf jmpbuf; long thrwval; long length; STACKITEM *stkbse; +#ifdef __ia64__ + long *bspbse; + long bsplength; + long rnat; +#endif CONTINUATION_OTHER other; struct Continuation *parent; }; @@ -170,29 +201,3 @@ void throw_to_continuation P((CONTINUATION *cont, long val, #define PTR_GT(x, y) PTR_LT(y, x) #define PTR_LE(x, y) (!PTR_GT(x, y)) #define PTR_GE(x, y) (!PTR_LT(x, y)) - -/* James Clark came up with this neat one instruction fix for - continuations on the SPARC. It flushes the register windows so - that all the state of the process is contained in the stack. */ - -#ifdef sparc -# define FLUSH_REGISTER_WINDOWS asm("ta 3") -#else -# define FLUSH_REGISTER_WINDOWS /* empty */ -#endif - -/* If stacks grow up then */ - -/* #define STACK_GROWS_UP */ -#ifdef hp9000s800 -# define STACK_GROWS_UP -#endif -#ifdef pyr -# define STACK_GROWS_UP -#endif -#ifdef nosve -# define STACK_GROWS_UP -#endif -#ifdef _UNICOS -# define STACK_GROWS_UP -#endif -- cgit v1.2.3