*/
/*
- * Copied from gc5.2, files "os_dep.c", "gc_priv.h"and "gcconfig.h",
+ * Copied from gc5.2, files "os_dep.c", "gc_priv.h", "mark.c" and "gcconfig.h",
* and modified for Guile by Marius Vollmer.
*/
typedef GC_word word;
typedef GC_signed_word signed_word;
+typedef int GC_bool;
+# define TRUE 1
+# define FALSE 0
+
+#if defined(__STDC__)
+# include <stdlib.h>
+# if !(defined( sony_news ) )
+# include <stddef.h>
+# endif
+# define VOLATILE volatile
+#else
+# ifdef MSWIN32
+# include <stdlib.h>
+# endif
+# define VOLATILE
+#endif
+
+/* Single argument version, robust against whole program analysis. */
+static void GC_noop1(x)
+word x;
+{
+ static VOLATILE word sink;
+
+ sink = x;
+}
+
/* Machine dependent parameters. Some tuning parameters can be found */
/* near the top of gc_private.h. */
# endif
# if defined(LINUX) && !defined(POWERPC)
+
+# if 0
# include <linux/version.h>
# if (LINUX_VERSION_CODE <= 0x10400)
- /* Ugly hack to get struct sigcontext_struct definition. Required */
+ /* Ugly hack to get struct sigcontext_struct definition. Required */
/* for some early 1.3.X releases. Will hopefully go away soon. */
/* in some later Linux releases, asm/sigcontext.h may have to */
/* be included instead. */
# define __KERNEL__
# include <asm/signal.h>
# undef __KERNEL__
-# else
+# endif
+
+# else
+
/* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
/* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
/* prototypes, so we have to include the top-level sigcontext.h to */
# endif
# endif
-# include <stdio.h>
# include <signal.h>
/* Blatantly OS dependent routines, except for those that are related */
{
int dummy;
ptr_t sp = (ptr_t)(&dummy);
- ptr_t trunc_sp = (ptr_t)((word)sp & ~(GC_page_size - 1));
- word size = GC_get_writable_length(trunc_sp, 0);
-
+ ptr_t trunc_sp;
+ word size;
+ static word GC_page_size = 0;
+ if (!GC_page_size) {
+ SYSTEM_INFO sysinfo;
+ GetSystemInfo(&sysinfo);
+ GC_page_size = sysinfo.dwPageSize;
+ }
+ trunc_sp = (ptr_t)((word)sp & ~(GC_page_size - 1));
+ size = GC_get_writable_length(trunc_sp, 0);
return(trunc_sp + size);
}