+1999-07-19 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * config.h: Updates for GNU/Linux/sparc. Use HEURISTIC2 on
+ Solaris7/sparc, since HEURISTIC1 does not work.
+ * os_dep.c: Updates for GNU/Linux/sparc.
+ * misc.c (GC_init_inner): Likewise.
+ From gc-boehm 4.14.
+
1999-07-19 Tom Tromey <tromey@cygnus.com>
* config.h (MPROTECT_VDB): Don't define on Linux.
# define LINUX
# define mach_type_known
# endif
+# if (defined(linux) || defined(__linux__)) && \
+ (defined(sparc) || defined(__sparc__))
+# define SPARC
+# define LINUX
+# define mach_type_known
+# endif
# if defined(__alpha) || defined(__alpha__)
# define ALPHA
# if defined(linux) || defined(__linux__)
# define HEAP_START DATAEND
# endif
# define PROC_VDB
-# define HEURISTIC1
+/* HEURISTIC1 reportedly no longer works under 2.7. Thus we */
+/* switched to HEURISTIC2, eventhough it creates some debugging */
+/* issues. */
+# define HEURISTIC2
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
/* getpagesize() appeared to be missing from at least one */
# define STACKBOTTOM ((ptr_t) 0xdfff0000)
# endif
# define DYNAMIC_LOADING
+# ifdef LINUX
+# define OS_TYPE "LINUX"
+# ifdef __ELF__
+# define DATASTART GC_data_start
+# else
+ Linux Sparc non elf ?
+# endif
+ extern int _end;
+# define DATAEND (&_end)
+# define SVR4
+# define STACKBOTTOM ((ptr_t) 0xf0000000)
+# endif
# endif
# ifdef I386
# define THREADS
# endif
-# if defined(SPARC)
+# if defined(SPARC) && !defined(LINUX)
# define SAVE_CALL_CHAIN
# define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
/* include assembly code to do it well. */
# if defined(LINUX) && defined(ALPHA)
GC_init_linuxalpha();
# endif
+# if defined(LINUX) && defined(SPARC)
+ GC_init_linuxsparc();
+# endif
# ifdef SOLARIS_THREADS
GC_thr_init();
/* We need dirty bits in order to find live stack sections. */
# define NEED_FIND_LIMIT
# endif
-# if defined(LINUX) && (defined(POWERPC) || defined(ALPHA))
+# if defined(LINUX) && (defined(POWERPC) || defined(ALPHA) || defined(SPARC))
# define NEED_FIND_LIMIT
# endif
}
#endif
+#if defined(LINUX) && defined(SPARC)
+ ptr_t GC_data_start;
+
+ void GC_init_linuxsparc()
+ {
+ extern ptr_t GC_find_limit();
+ extern char **_environ;
+ /* This may need to be environ, without the underscore, for */
+ /* some versions. */
+ GC_data_start = GC_find_limit((ptr_t)&_environ, FALSE);
+ }
+#endif
+
# ifdef ECOS
# ifndef ECOS_GC_MEMORY_SIZE
* Call stack save code for debugging.
* Should probably be in mach_dep.c, but that requires reorganization.
*/
-#if defined(SPARC)
+#if defined(SPARC) && !defined(LINUX)
# if defined(SUNOS4)
# include <machine/frame.h>
# else