summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Mohr <manuel.mohr@kit.edu>2013-09-06 10:00:18 +0200
committerManuel Mohr <manuel.mohr@kit.edu>2013-09-06 10:00:18 +0200
commit860c1d90ca4aeb4083b05783f67313f94e7623fe (patch)
tree7df296f677262ee56bc5fe70bbc6a56881f0b2c8
parent4eac2c9a09caa02efb5daaadcde88f6093a7b456 (diff)
Initial steps towards a SPARC/OctoPOS version of bdwgc.
-rw-r--r--Makefile4
-rw-r--r--include/private/gcconfig.h6
-rw-r--r--mach_dep.c16
-rw-r--r--os_dep.c2
4 files changed, 26 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 718b275..f46ecfe 100644
--- a/Makefile
+++ b/Makefile
@@ -90,7 +90,9 @@ ifeq ($(TARGET), sparc-invasic-octopos)
GCC_INCLUDE = $(shell $(CC) --print-file-name=include)
CFLAGS += -fno-stack-protector
- CPPFLAGS += -nostdinc -D__leon__ -I $(OCTOPOS_BASE)/include -isystem $(GCC_INCLUDE)
+ CPPFLAGS += -nostdinc -D__leon__ -D__OCTOPOS__ -I $(OCTOPOS_BASE)/include -isystem $(GCC_INCLUDE)
+
+ EXTRA_OBJECTS = src/sparc_mach_dep.o
endif
BUILDDIR = build/$(TARGET)
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index ea3ad9a..a92922b 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -536,7 +536,11 @@
/* Feel free to add more clauses here */
# if defined(__OCTOPOS__)
# define OCTOPOS
-# define I386
+# if defined(__sparc__)
+# define SPARC
+# else
+# define I386
+# endif
# define mach_type_known
# define GC_OCTOPOS_THREADS
diff --git a/mach_dep.c b/mach_dep.c
index bd0add8..3e578a8 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -186,6 +186,7 @@
#endif /* !USE_ASM_PUSH_REGS */
#if defined(OCTOPOS)
+# if defined(I386)
void GC_push_regs(void)
{
volatile unsigned regs[6];
@@ -202,6 +203,21 @@
}
# define HAVE_PUSH_REGS
+# elif defined(SPARC)
+ __attribute__((noinline, optimize(1)))
+ static void recurse(unsigned count)
+ {
+ if (count > 0)
+ recurse(count - 1);
+ }
+
+ void GC_push_regs(void)
+ {
+ /* Cause window overflow trap. */
+ recurse(7);
+ }
+# define HAVE_PUSH_REGS
+# endif
#endif /* OCTOPOS ASM PUSH REGS */
//FIXME
diff --git a/os_dep.c b/os_dep.c
index 07863f2..16b04f1 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -4466,6 +4466,8 @@ GC_API int GC_CALL GC_get_pages_executable(void)
# include <frame.h>
# elif defined(FREEBSD) || defined(NETBSD)
# include <machine/frame.h>
+# elif defined(__OCTOPOS__)
+ /* do nothing */
# else
# include <sys/frame.h>
# endif