summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc <devnull@localhost>1998-04-16 22:56:27 +0000
committerwtc <devnull@localhost>1998-04-16 22:56:27 +0000
commit7420b134daf6b01978c4bb5762d11043d29d226c (patch)
treee7bcbb81af73af9b5c4e7f57f3396499e1b495a6
parent901f5e9c02a5f01773b0a63ddd77d59ddb5c97dc (diff)
downloadnspr-hg-7420b134daf6b01978c4bb5762d11043d29d226c.tar.gz
Ported to Linux/m68k. The patches were kindly provided by
Jes Sorensen <Jes.Sorensen@cern.ch>.
-rw-r--r--config/Linux.mk11
-rw-r--r--pr/include/md/_linux.cfg46
-rw-r--r--pr/include/md/_linux.h18
3 files changed, 74 insertions, 1 deletions
diff --git a/config/Linux.mk b/config/Linux.mk
index 9b088fdd..e9ae9524 100644
--- a/config/Linux.mk
+++ b/config/Linux.mk
@@ -72,6 +72,17 @@ endif
ifeq ($(CPU_ARCH),x86)
PLATFORM_FLAGS += -mno-486 -DLINUX1_2 -Di386
endif
+ifeq ($(CPU_ARCH),m68k)
+#
+# gcc on Linux/m68k either has a bug or triggers a code-sequence
+# bug in the 68060 which causes gcc to crash. The simplest way to
+# avoid this is to enable a minimum level of optimization.
+#
+ifndef BUILD_OPT
+OPTIMIZER += -O
+endif
+PLATFORM_FLAGS += -m68020-40 -DLINUX1_2
+endif
ifeq ($(OS_RELEASE),2.0)
PLATFORM_FLAGS += -DLINUX2_0
diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg
index 5d0be4de..a269025c 100644
--- a/pr/include/md/_linux.cfg
+++ b/pr/include/md/_linux.cfg
@@ -116,7 +116,51 @@
#define PR_BYTES_PER_WORD_LOG2 3
#define PR_BYTES_PER_DWORD_LOG2 3
-#else
+#elif defined(__mc68000__)
+
+#undef IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 4
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 4
+#define PR_BYTES_PER_DWORD 8
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 32
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 32
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 5
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 5
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 2
+#define PR_ALIGN_OF_LONG 2
+#define PR_ALIGN_OF_INT64 2
+#define PR_ALIGN_OF_FLOAT 2
+#define PR_ALIGN_OF_DOUBLE 2
+#define PR_ALIGN_OF_POINTER 2
+
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#else /* x86 */
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
index 30649ebb..03b526e3 100644
--- a/pr/include/md/_linux.h
+++ b/pr/include/md/_linux.h
@@ -31,6 +31,8 @@
#define _PR_SI_ARCHITECTURE "ppc"
#elif defined(__alpha)
#define _PR_SI_ARCHITECTURE "alpha"
+#elif defined(__mc68000__)
+#define _PR_SI_ARCHITECTURE "m68k"
#else
#define _PR_SI_ARCHITECTURE "x86"
#endif
@@ -97,6 +99,22 @@ extern void _MD_CleanupBeforeExit(void);
/* XXX not sure if this is correct, or maybe it should be 17? */
#define PR_NUM_GCREGS 9
+#elif defined(__mc68000__)
+/* m68k based Linux */
+
+/*
+ * On the m68k, glibc still uses the old style sigjmp_buf, even
+ * in glibc 2.0.7.
+ */
+#if defined(__GLIBC__) && __GLIBC__ >= 2
+#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__sp
+#else
+#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__sp
+#endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
+
+/* XXX not sure if this is correct, or maybe it should be 17? */
+#define PR_NUM_GCREGS 9
+
#else
/* Intel based Linux */
#if defined(__GLIBC__) && __GLIBC__ >= 2