summaryrefslogtreecommitdiffstats
path: root/continue.h
diff options
context:
space:
mode:
Diffstat (limited to 'continue.h')
-rw-r--r--continue.h131
1 files changed, 68 insertions, 63 deletions
diff --git a/continue.h b/continue.h
index 2b412cd..316ba46 100644
--- a/continue.h
+++ b/continue.h
@@ -42,12 +42,68 @@
/* "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
+#ifdef __hppa__
+# 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 <setjmp.h>
@@ -58,9 +114,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 +131,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 +142,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,32 +204,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
-#ifdef __hppa__
-# define STACK_GROWS_UP
-#endif