/* -*-C-*-
-$Id: cmpint.c,v 1.66 1993/09/01 22:10:59 gjr Exp $
+$Id: cmpint.c,v 1.67 1993/09/07 21:45:53 gjr Exp $
Copyright (c) 1989-1993 Massachusetts Institute of Technology
/* Macro imports */
#include <stdio.h>
+#include <stdlib.h>
#include "oscond.h" /* Identify the operating system */
#include "ansidecl.h" /* Macros to support ANSI declarations */
#include "dstack.h" /* Dynamic-stack support */
{
RETURN_TO_C (PRIM_APPLY);
}
+\f
+#if (COMPILER_PROCESSOR_TYPE != COMPILER_I386_TYPE)
+
+# define RETURN_FROM_PRIMITIVE() \
+ RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ()))
+
+#else /* i386 */
+
+static utility_result
+ EXFUN (compiler_interrupt_common, (SCHEME_ADDR, SCHEME_OBJECT));
+
+# define RETURN_FROM_PRIMITIVE() do \
+{ \
+ if (((long) Free) >= ((long) (Registers[REGBLOCK_MEMTOP]))) \
+ return (compiler_interrupt_common (0, Val)); \
+ else \
+ RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ())); \
+} while (0)
+
+#endif /* i386 */
/*
comutil_primitive_apply is used to invoked a C primitive.
{
PRIMITIVE_APPLY (Val, primitive);
POP_PRIMITIVE_FRAME (PRIMITIVE_ARITY (primitive));
- RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ()));
+ RETURN_FROM_PRIMITIVE ();
}
/*
{
PRIMITIVE_APPLY (Val, primitive);
POP_PRIMITIVE_FRAME (((long) Regs[REGBLOCK_LEXPR_ACTUALS]));
- RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ()));
+ RETURN_FROM_PRIMITIVE ();
}
\f
/*
return (comutil_primitive_apply ((tramp_data[0]), 0, 0, 0));
}
+extern SCHEME_OBJECT EXFUN (compiler_var_error,
+ (SCHEME_OBJECT, SCHEME_OBJECT));
+\f
/* The linker either couldn't find a binding or the binding was
unassigned, unbound, or a deep-bound (parallel processor) fluid.
This must report the correct name of the missing variable and the
/* -*-C-*-
-$Id: cmpint.c,v 1.66 1993/09/01 22:10:59 gjr Exp $
+$Id: cmpint.c,v 1.67 1993/09/07 21:45:53 gjr Exp $
Copyright (c) 1989-1993 Massachusetts Institute of Technology
/* Macro imports */
#include <stdio.h>
+#include <stdlib.h>
#include "oscond.h" /* Identify the operating system */
#include "ansidecl.h" /* Macros to support ANSI declarations */
#include "dstack.h" /* Dynamic-stack support */
{
RETURN_TO_C (PRIM_APPLY);
}
+\f
+#if (COMPILER_PROCESSOR_TYPE != COMPILER_I386_TYPE)
+
+# define RETURN_FROM_PRIMITIVE() \
+ RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ()))
+
+#else /* i386 */
+
+static utility_result
+ EXFUN (compiler_interrupt_common, (SCHEME_ADDR, SCHEME_OBJECT));
+
+# define RETURN_FROM_PRIMITIVE() do \
+{ \
+ if (((long) Free) >= ((long) (Registers[REGBLOCK_MEMTOP]))) \
+ return (compiler_interrupt_common (0, Val)); \
+ else \
+ RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ())); \
+} while (0)
+
+#endif /* i386 */
/*
comutil_primitive_apply is used to invoked a C primitive.
{
PRIMITIVE_APPLY (Val, primitive);
POP_PRIMITIVE_FRAME (PRIMITIVE_ARITY (primitive));
- RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ()));
+ RETURN_FROM_PRIMITIVE ();
}
/*
{
PRIMITIVE_APPLY (Val, primitive);
POP_PRIMITIVE_FRAME (((long) Regs[REGBLOCK_LEXPR_ACTUALS]));
- RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ()));
+ RETURN_FROM_PRIMITIVE ();
}
\f
/*
return (comutil_primitive_apply ((tramp_data[0]), 0, 0, 0));
}
+extern SCHEME_OBJECT EXFUN (compiler_var_error,
+ (SCHEME_OBJECT, SCHEME_OBJECT));
+\f
/* The linker either couldn't find a binding or the binding was
unassigned, unbound, or a deep-bound (parallel processor) fluid.
This must report the correct name of the missing variable and the