aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config.gcc82
-rw-r--r--gcc/config/a29k/rtems.h36
-rw-r--r--gcc/config/arm/rtems-elf.h37
-rw-r--r--gcc/config/h8300/rtems.h37
-rw-r--r--gcc/config/mips/rtems.h34
-rw-r--r--gcc/gthr-rtems.h120
7 files changed, 354 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b765085..90fddae 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2000-12-06 Joel Sherrill <joel@OARcorp.com>
+
+ * config.gcc (a29k*-*-rtems*, arm*-*-rtems*, c4x-*-rtems*,
+ h8300-*-rtems*, hppa1.1-*-rtems, *mips*-*-rtems*): New targets.
+ * config.gcc (*-rtems*): Add support for gthr-rtems.h.
+ * gthr-rtems.h, config/a29k/rtems.h, config/arm/rtems-elf.h,
+ config/h8300/rtems.h, config/mips/rtems.h: New files.
+
2000-12-06 Mark Kettenis <kettenis@gnu.org>
* config.gcc: Reorganize handling of *-*-gnu*, to share target
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 71be47c..2175bc9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -319,6 +319,13 @@ a29k-*-udi | a29k-*-coff)
tm_file="${tm_file} dbxcoff.h a29k/udi.h"
tmake_file=a29k/t-a29kbare
;;
+a29k*-*-rtems*)
+ tm_file=a29k/rtems.h
+ tmake_file="a29k/t-a29kbare t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
+ ;;
a29k-wrs-vxworks*)
tm_file="${tm_file} dbxcoff.h a29k/udi.h a29k/vx29k.h"
tmake_file=a29k/t-vx29k
@@ -476,6 +483,14 @@ alpha*-dec-vms*)
xm_file="${xm_file} alpha/xm-vms.h"
tmake_file="alpha/t-alpha alpha/t-vms alpha/t-ieee"
;;
+arm*-*-rtems*)
+ tm_file=arm/rtems-elf.h
+ tmake_file="arm/t-arm-elf t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
+ extra_parts="crtinit.o crtfini.o"
+ ;;
arc-*-elf*)
extra_parts="crtinit.o crtfini.o"
;;
@@ -603,6 +618,14 @@ c38-convex-*)
target_cpu_default=16
use_collect2=yes
;;
+c4x-*-rtems*)
+ cpu_type=c4x
+ tmake_file="c4x/t-c4x t-rtems"
+ tm_file=c4x/rtems.h
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
+ ;;
c4x-*)
cpu_type=c4x
float_format=c4x
@@ -629,6 +652,14 @@ fr30-*-elf)
tmake_file=fr30/t-fr30
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
;;
+h8300-*-rtems*)
+ tmake_file="h8300/t-h8300 t-rtems"
+ tm_file=h8300/rtems.h
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
+ float_format=i32
+ ;;
h8300-*-*)
float_format=i32
;;
@@ -647,6 +678,14 @@ hppa*-*-openbsd*)
target_cpu_default="MASK_PA_11"
tmake_file=pa/t-openbsd
;;
+hppa1.1-*-rtems*)
+ tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h pa/rtems.h"
+ xm_file=pa/xm-papro.h
+ tmake_file="pa/t-pro t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
+ ;;
hppa1.1-*-pro*)
target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
tm_file="${tm_file} pa/pa32-regs.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h"
@@ -1203,17 +1242,26 @@ i[34567]86-go32-rtems*)
xm_file=i386/xm-go32.h
tm_file=i386/go32-rtems.h
tmake_file="i386/t-go32 t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
i[34567]86-*-rtemscoff*)
cpu_type=i386
tm_file=i386/rtems.h
tmake_file="i386/t-i386bare t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
i[34567]86-*-rtems*|i[34567]86-*-rtemself*)
cpu_type=i386
tm_file=i386/rtemself.h
extra_parts="crtbegin.o crtend.o crti.o crtn.o"
tmake_file="i386/t-rtems-i386 i386/t-crtstuff t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
xm_file="xm-alloca.h ${xm_file} i386/xm-sco5.h"
@@ -1527,6 +1575,9 @@ i960-*-rtems)
tmake_file="i960/t-960bare t-rtems"
tm_file="${tm_file} dbxcoff.h i960/rtems.h"
use_collect2=yes
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
i960-*-*) # Default i960 environment.
use_collect2=yes
@@ -2004,12 +2055,18 @@ m68k-*-rtemscoff*)
tm_file=m68k/rtems.h
extra_headers=math-68881.h
float_format=m68k
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
m68k-*-rtemself*|m68k-*-rtems*)
tmake_file="m68k/t-m68kbare t-rtems m68k/t-crtstuff"
tm_file=m68k/rtemself.h
extra_headers=math-68881.h
float_format=m68k
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
m88k-dg-dgux*)
case $machine in
@@ -2538,6 +2595,16 @@ mips64orion-*-elf*)
mips64orion-*-rtems*)
tm_file="mips/elforion.h mips/elf64.h mips/rtems64.h"
tmake_file="mips/t-elf t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
+ ;;
+mips*-*-rtems*)
+ tm_file="mips/elf.h mips/rtems.h"
+ tmake_file="mips/t-elf t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
mipstx39el-*-elf*)
tm_file="mips/r3900.h mips/elfl.h mips/abi64.h"
@@ -2693,6 +2760,9 @@ powerpc-*-rtems*)
tm_file="rs6000/sysv4.h rs6000/eabi.h rs6000/rtems.h"
tmake_file="rs6000/t-ppcgas t-rtems rs6000/t-ppccomm"
extra_headers=ppc-asm.h
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
powerpc-*-linux*libc1)
tm_file="rs6000/sysv4.h rs6000/linux.h"
@@ -2847,11 +2917,17 @@ sh-*-rtemself*)
tmake_file="sh/t-sh sh/t-elf t-rtems"
tm_file="sh/sh.h sh/elf.h sh/rtemself.h"
float_format=sh
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
sh-*-rtems*)
tmake_file="sh/t-sh t-rtems"
tm_file="sh/sh.h sh/rtems.h"
float_format=sh
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
sh-*-linux*)
tm_file="sh/sh.h sh/elf.h sh/linux.h"
@@ -2941,6 +3017,9 @@ sparc-*-lynxos*)
sparc-*-rtemsaout*)
tmake_file="sparc/t-sparcbare t-rtems"
tm_file=sparc/rtems.h
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
sparc-*-rtems*|sparc-*-rtemself*)
tm_file="sparc/rtemself.h"
@@ -2948,6 +3027,9 @@ sparc-*-rtems*|sparc-*-rtemself*)
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
#float_format=i128
float_format=i64
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
;;
sparcv9-*-solaris2*)
if test x$gnu_ld = xyes
diff --git a/gcc/config/a29k/rtems.h b/gcc/config/a29k/rtems.h
new file mode 100644
index 0000000..e2adcc8
--- /dev/null
+++ b/gcc/config/a29k/rtems.h
@@ -0,0 +1,36 @@
+/* Definitions for rtems targeting a AMD A29K using COFF.
+ Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Contributed by Joel Sherrill (joel@OARcorp.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "a29k/a29k.h"
+
+/* Specify predefined symbols in preprocessor. */
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-D_AM29K -D_AM29000 -D_EPI -Drtems -D__rtems__ \
+ -Asystem(rtems) -Acpu(a29k) -Amachine(a29k)"
+
+/* Generate calls to memcpy, memcmp and memset. */
+#ifndef TARGET_MEM_FUNCTIONS
+#define TARGET_MEM_FUNCTIONS
+#endif
+
+/* Get machine-independent configuration parameters for RTEMS. */
+#include <rtems.h>
diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h
new file mode 100644
index 0000000..23a1a32
--- /dev/null
+++ b/gcc/config/arm/rtems-elf.h
@@ -0,0 +1,37 @@
+/* Definitions for RTEMS based ARM systems using ELF
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Run-time Target Specification. */
+#define TARGET_VERSION fputs (" (ARM/ELF RTEMS)", stderr);
+
+#define HAS_INIT_SECTION
+
+#include "unknown-elf.h"
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Darm -Darm_elf -Drtems -D__rtems__ -D__ELF__ \
+ -Asystem(rtems) -Acpu(arm) -Amachine(arm)"
+
+/*#undef INVOKE_main*/
+
+/* Get machine-independent configuration parameters for RTEMS. */
+#include <rtems.h>
+
+
diff --git a/gcc/config/h8300/rtems.h b/gcc/config/h8300/rtems.h
new file mode 100644
index 0000000..1ac2de9
--- /dev/null
+++ b/gcc/config/h8300/rtems.h
@@ -0,0 +1,37 @@
+/* Definitions for rtems targeting a H8
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Contributed by Joel Sherrill (joel@OARcorp.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "h8300/h8300.h"
+
+/* Specify predefined symbols in preprocessor. */
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Dh8300 \
+ -D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L \
+ -Drtems -D__rtems__ -Asystem(rtems) -Acpu(h8300) -Amachine(h8300)"
+
+/* Generate calls to memcpy, memcmp and memset. */
+#ifndef TARGET_MEM_FUNCTIONS
+#define TARGET_MEM_FUNCTIONS
+#endif
+
+/* Get machine-independent configuration parameters for RTEMS. */
+#include <rtems.h>
diff --git a/gcc/config/mips/rtems.h b/gcc/config/mips/rtems.h
new file mode 100644
index 0000000..23463d7
--- /dev/null
+++ b/gcc/config/mips/rtems.h
@@ -0,0 +1,34 @@
+/* Definitions for rtems targeting a MIPS using ELF.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Joel Sherrill (joel@OARcorp.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Specify predefined symbols in preprocessor. */
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Dmips -DMIPSEB -D_mips -D_MIPSEB \
+ -Drtems -D__rtems__ -Asystem(rtems)"
+
+/* Generate calls to memcpy, memcmp and memset. */
+#ifndef TARGET_MEM_FUNCTIONS
+#define TARGET_MEM_FUNCTIONS
+#endif
+
+/* Get machine-independent configuration parameters for RTEMS. */
+#include <rtems.h>
diff --git a/gcc/gthr-rtems.h b/gcc/gthr-rtems.h
new file mode 100644
index 0000000..05400c5
--- /dev/null
+++ b/gcc/gthr-rtems.h
@@ -0,0 +1,120 @@
+/* RTEMS threads compatibily routines for libgcc2 and libobjc.
+ by: Rosimildo da Silva( rdasilva@connecttel.com ) */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* As a special exception, if you link this library with other files,
+ some of which are compiled with GCC, to produce an executable,
+ this library does not by itself cause the resulting executable
+ to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#ifndef __gthr_rtems_h
+#define __gthr_rtems_h
+
+
+#define __GTHREADS 1
+
+#define __GTHREAD_ONCE_INIT 0
+#define __GTHREAD_MUTEX_INIT_FUNCTION rtems_gxx_mutex_init
+
+/* avoid depedency on rtems specific headers */
+typedef void *__gthread_key_t;
+typedef int __gthread_once_t;
+typedef void *__gthread_mutex_t;
+
+/*
+ * External functions provided by RTEMS. They are very similar to their POSIX
+ * counterparts. A "Wrapper API" is being use to avoid dependency on any RTEMS
+ * header files.
+ */
+
+/* generic per task variables */
+extern int rtems_gxx_once (__gthread_once_t *once, void (*func) ());
+extern int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *));
+extern int rtems_gxx_key_dtor (__gthread_key_t key, void *ptr);
+extern int rtems_gxx_key_delete (__gthread_key_t key);
+extern void *rtems_gxx_getspecific (__gthread_key_t key);
+extern int rtems_gxx_setspecific (__gthread_key_t key, const void *ptr);
+
+/* mutex support */
+extern void rtems_gxx_mutex_init (__gthread_mutex_t *mutex);
+extern int rtems_gxx_mutex_lock (__gthread_mutex_t *mutex);
+extern int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex);
+extern int rtems_gxx_mutex_unlock (__gthread_mutex_t *mutex);
+
+
+/* Wrapper calls */
+static inline int
+__gthread_once (__gthread_once_t *once, void (*func) ())
+{
+ return rtems_gxx_once( once, func );
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
+{
+ return rtems_gxx_key_create( key, dtor );
+}
+
+static inline int
+__gthread_key_dtor (__gthread_key_t key, void *ptr)
+{
+ return rtems_gxx_key_dtor(key, ptr);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t key)
+{
+ return rtems_gxx_key_delete (key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t key)
+{
+ return rtems_gxx_getspecific (key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t key, const void *ptr)
+{
+ return rtems_gxx_setspecific (key, ptr);
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *mutex)
+{
+ return rtems_gxx_mutex_lock (mutex);
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *mutex)
+{
+ return rtems_gxx_mutex_trylock (mutex);
+}
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *mutex)
+{
+ return rtems_gxx_mutex_unlock( mutex );
+}
+
+#endif /* __gthr_rtems_h */