]> gcc.gnu.org Git - gcc.git/commitdiff
gcconfig: Add machine type S390.
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 27 Sep 2002 20:40:06 +0000 (20:40 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Fri, 27 Sep 2002 20:40:06 +0000 (20:40 +0000)
* include/private/gcconfig: Add machine type S390.  Add s390x support.
* include/private/gc_locks.h (GC_test_and_set): Implement for s390.
(GC_compare_and_exchange): Likewise.

From-SVN: r57592

boehm-gc/ChangeLog
boehm-gc/include/private/gc_locks.h
boehm-gc/include/private/gcconfig.h

index 2ab4af7f24eb1195490ce0ee6fe9227b1cef6845..1e39307bfa7d8ac962ef097eeb4a50cf426cef0d 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * include/private/gcconfig: Add machine type S390.  Add s390x support.
+       * include/private/gc_locks.h (GC_test_and_set): Implement for s390.
+       (GC_compare_and_exchange): Likewise.
+
 2002-09-24  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * include/private/gcconfig.h: Fix NetBSD/mips parameters.
index 04d3af986c039a7f6003c4e57e4fc84eaf2ae307..33101f8c2d02726aa03cdc1c13eda08f61777b85 100644 (file)
         }
 #       define GC_TEST_AND_SET_DEFINED
 #    endif /* ARM32 */
+#    ifdef S390
+       inline static int GC_test_and_set(volatile unsigned int *addr) {
+        int ret;
+        __asm__ __volatile__ (
+               "       l       %0,0(%2)\n"
+               "0:     cs      %0,%1,0(%2)\n"
+               "       jl      0b"
+               : "=&d" (ret)
+               : "d" (1), "a" (addr)
+               : "cc", "memory");
+         return ret;
+       }
+#    endif
 #  endif /* __GNUC__ */
 #  if (defined(ALPHA) && !defined(__GNUC__))
 #    define GC_test_and_set(addr) __cxx_test_and_set_atomic(addr, 1)
         }
 #      endif /* 0 */
 #     endif /* IA64 */
+#     if defined(S390)
+#      if !defined(GENERIC_COMPARE_AND_SWAP)
+        inline static GC_bool GC_compare_and_exchange(volatile C_word *addr,
+                                                      GC_word old, GC_word new_val) 
+        {
+          int retval;
+          __asm__ __volatile__ (
+#          ifndef __s390x__
+               "       cs  %1,%2,0(%3)\n"
+#          else
+               "       csg %1,%2,0(%3)\n"
+#         endif
+               "       ipm %0\n"
+               "       srl %0,28\n"
+               : "=&d" (retval), "+d" (old)
+               : "d" (new_val), "a" (addr)
+               : "cc", "memory");
+          return retval == 0;
+       }
+#      endif
+#     endif
 #     if !defined(GENERIC_COMPARE_AND_SWAP)
         /* Returns the original value of *addr.        */
         inline static GC_word GC_atomic_add(volatile GC_word *addr,
index 0f618fecf229b2e2828404ac1446d0d2d04db9d7..432250cf4f690df6829cd75016859323777db456 100644 (file)
 #   define mach_type_known
 # endif
 # if defined(__s390__) && defined(LINUX)
-#    define S370
+#    define S390
 #    define mach_type_known
 # endif
 # if defined(__GNU__)
                    /*                  (CX_UX and DGUX)                */
                    /*             S370       ==> 370-like machine      */
                    /*                  running Amdahl UTS4             */
-                   /*                  or a 390 running LINUX          */
+                   /*             S390       ==> 390-like machine      */
+                   /*                  running LINUX                   */
                    /*             ARM32      ==> Intel StrongARM       */
                    /*             IA64       ==> Intel IPF             */
                    /*                            (e.g. Itanium)        */
 #      define DATAEND (_end)
 #      define HEURISTIC2
 #   endif
+# endif
+
+# ifdef S390
+#   define MACH_TYPE "S390"
+#   define USE_GENERIC_PUSH_REGS
+#   ifndef __s390x__
+#      define ALIGNMENT 4
+#      define CPP_WORDSZ 32
+#   else
+#      define ALIGNMENT 8
+#      define CPP_WORDSZ 64
+#      define HBLKSIZE 4096
+#   endif
 #   ifdef LINUX
 #       define OS_TYPE "LINUX"
-#       define HEURISTIC1
+#       define LINUX_STACKBOTTOM
 #       define DYNAMIC_LOADING
         extern int __data_start[];
 #       define DATASTART ((ptr_t)(__data_start))
+       extern int _end[];
+#      define DATAEND (_end)
+#      define CACHE_LINE_SIZE 256
+#      define GETPAGESIZE() 4096
 #   endif
 # endif
 
This page took 0.070222 seconds and 5 git commands to generate.