[BACK]Return to gc6.5-risa.diff CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000

File: [local] / OpenXM_contrib2 / asir2000 / Attic / gc6.5-risa.diff (download)

Revision 1.3, Wed Feb 13 10:24:24 2008 UTC (16 years, 3 months ago) by ohara
Branch: MAIN
Changes since 1.2: +134 -7 lines

Some patches are imported from the FreeBSD ports system.
Now Risa/Asir can be built on FreeBSD/amd64.

diff -u -r gc6.5/alloc.c gc6.5-risa/alloc.c
--- gc6.5/alloc.c	2005-05-21 03:12:59.000000000 +0900
+++ gc6.5-risa/alloc.c	2005-07-11 17:57:51.000000000 +0900
@@ -110,6 +110,7 @@
 GC_bool GC_dont_expand = 0;
 
 word GC_free_space_divisor = 3;
+word GC_free_space_numerator = 1;
 
 extern GC_bool GC_collection_in_progress();
 		/* Collection is in progress, or was abandoned.	*/
@@ -174,9 +175,9 @@
 				   /* use a bit more of large empty heap */
 			       + total_root_size);
     if (TRUE_INCREMENTAL) {
-        return scan_size / (2 * GC_free_space_divisor);
+        return scan_size * GC_free_space_numerator / (2 * GC_free_space_divisor);
     } else {
-        return scan_size / GC_free_space_divisor;
+        return scan_size * GC_free_space_numerator / GC_free_space_divisor;
     }
 }
 
@@ -492,6 +493,7 @@
 #   if defined(REGISTER_LIBRARIES_EARLY)
         GC_cond_register_dynamic_libraries();
 #   endif
+	GC_timerstart();
     STOP_WORLD();
     IF_THREADS(GC_world_stopped = TRUE);
 #   ifdef CONDPRINT
@@ -526,6 +528,7 @@
 		    GC_deficit = i; /* Give the mutator a chance. */
                     IF_THREADS(GC_world_stopped = FALSE);
 	            START_WORLD();
+				GC_timerstop();
 	            return(FALSE);
 	    }
 	    if (GC_mark_some((ptr_t)(&dummy))) break;
@@ -560,6 +563,7 @@
     
     IF_THREADS(GC_world_stopped = FALSE);
     START_WORLD();
+	GC_timerstop();
 #   ifdef PRINTTIMES
 	GET_TIME(current_time);
 	GC_printf1("World-stopped marking took %lu msecs\n",
@@ -640,6 +644,7 @@
 	GET_TIME(start_time);
 	finalize_time = start_time;
 #   endif
+	GC_timerstart();
 
 #   ifdef GATHERSTATS
         GC_mem_found = 0;
@@ -757,6 +762,7 @@
 	           MS_TIME_DIFF(finalize_time,start_time),
 	           MS_TIME_DIFF(done_time,finalize_time));
 #   endif
+	GC_timerstop();
 }
 
 /* Externally callable routine to invoke full, stop-world collection */
@@ -971,6 +977,9 @@
         if (GC_collect_at_heapsize < GC_heapsize /* wrapped */)
 	  GC_collect_at_heapsize = (word)(-1);
 #     endif
+#if defined(VISUAL_LIB)
+    SendHeapSize();
+#endif
     return(TRUE);
 }
 
@@ -1067,6 +1076,22 @@
     
     if (sz == 0) return(0);
 
+#if defined(VISUAL)
+    {
+#include <signal.h>
+        extern int recv_intr;
+        if ( recv_intr ) {
+            if ( recv_intr == 1 ) {
+                recv_intr = 0;
+                int_handler();
+            } else {
+                recv_intr = 0;
+                ox_usr1_handler(0);
+            }
+        }
+    }
+#endif
+
     while (*flh == 0) {
       ENTER_GC();
       /* Do our share of marking work */
diff -u -r gc6.5/configure gc6.5-risa/configure
--- gc6.5/configure	2005-05-17 08:28:32.000000000 +0900
+++ gc6.5-risa/configure	2005-07-11 17:59:33.000000000 +0900
@@ -9531,7 +9531,7 @@
 _ACEOF
 
 cat >>confdefs.h <<\_ACEOF
-#define NO_SIGNALS 1
+##define NO_SIGNALS 1
 _ACEOF
 
 cat >>confdefs.h <<\_ACEOF
diff -u -r gc6.5/include/private/gcconfig.h gc6.5-risa/include/private/gcconfig.h
--- gc6.5/include/private/gcconfig.h	2005-05-21 05:48:29.000000000 +0900
+++ gc6.5-risa/include/private/gcconfig.h	2005-07-11 18:18:53.000000000 +0900
@@ -61,9 +61,16 @@
 # endif
 
 /* Determine the machine type: */
+/* T.Saito */
+# if defined(FREEBSD) && defined(__amd64__)
+#    define X86_64
+#    define mach_type_known
+# endif
+
+/* Determine the machine type: */
 # if defined(__arm__) || defined(__thumb__)
 #    define ARM32
-#    if !defined(LINUX) && !defined(NETBSD)
+#    if !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD)
 #      define NOSYS
 #      define mach_type_known
 #    endif
@@ -342,10 +349,22 @@
 #    define X86_64
 #    define mach_type_known
 # endif
+# if defined(__FreeBSD__) && defined(__amd64__)
+#    define X86_64
+#    define mach_type_known
+# endif
 # if defined(FREEBSD) && defined(__sparc__)
 #    define SPARC
 #    define mach_type_known
-#endif
+# endif
+# if defined(FREEBSD) && defined(__powerpc__)
+#    define POWERPC
+#    define mach_type_known
+# endif
+# if defined(FREEBSD) && defined(__arm__)
+#    define ARM32
+#    define mach_type_known
+# endif
 # if defined(bsdi) && (defined(i386) || defined(__i386__))
 #    define I386
 #    define BSDI
@@ -860,6 +879,16 @@
 #     define DATASTART GC_data_start
 #     define DYNAMIC_LOADING
 #   endif
+#   ifdef FREEBSD
+#   define ALIGNMENT 4
+#       define OS_TYPE "FREEBSD"
+#       ifdef __ELF__
+#           define DYNAMIC_LOADING
+#       endif
+#	define HEURISTIC2
+	extern char etext[];
+#	define SEARCH_FOR_DATA_START
+#   endif
 #   ifdef NOSYS
 #     define ALIGNMENT 4
 #     define OS_TYPE "NOSYS"
@@ -1862,6 +1891,17 @@
 #	endif
 #       define USE_GENERIC_PUSH_REGS
 #   endif
+#   ifdef FREEBSD
+#   define ALIGNMENT 4
+#       define OS_TYPE "FREEBSD"
+#       ifdef __ELF__
+#           define DYNAMIC_LOADING
+#       endif
+#       define HEURISTIC2
+	extern char etext[];
+#       define SEARCH_FOR_DATA_START
+#   endif
+		   
 #   ifdef LINUX
 #       define OS_TYPE "LINUX"
 #       define LINUX_STACKBOTTOM
@@ -1943,6 +1983,28 @@
 #      define USE_GENERIC_PUSH_REGS
 #      define DYNAMIC_LOADING
 #   endif
+#   ifdef FREEBSD /* T.Saito */
+#       define OS_TYPE "FREEBSD"
+#       ifndef GC_FREEBSD_THREADS
+#           define MPROTECT_VDB
+#       endif
+#       define SIG_SUSPEND SIGUSR1
+#       define SIG_THR_RESTART SIGUSR2
+#       define FREEBSD_STACKBOTTOM
+#       ifdef __ELF__
+#           define DYNAMIC_LOADING
+#       endif
+	extern int _etext[];
+        extern char etext[];
+	extern char edata[];
+	extern char end[];
+        extern char * GC_FreeBSDGetDataStart();
+#	define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
+#	define NEED_FIND_LIMIT
+#	define DATAEND (GC_find_limit (DATASTART, TRUE))
+#	define DATASTART2 ((ptr_t)(&edata))
+#	define DATAEND2 ((ptr_t)(&end))
+#   endif /* end T.Saito */
 # endif
  
 # ifdef SH4
@@ -2038,6 +2100,17 @@
 	extern char etext[];
 #	define SEARCH_FOR_DATA_START
 #   endif
+#   ifdef FREEBSD
+#       define OS_TYPE "FREEBSD"
+#       define SIG_SUSPEND SIGUSR1
+#       define SIG_THR_RESTART SIGUSR2
+#       ifdef __ELF__
+#           define DYNAMIC_LOADING
+#       endif
+#	define HEURISTIC2
+	extern char etext[];
+#	define SEARCH_FOR_DATA_START
+#   endif
 #   ifdef SOLARIS
 #	define OS_TYPE "SOLARIS"
 #	define ELF_CLASS ELFCLASS64
diff -u -r gc6.5/reclaim.c gc6.5-risa/reclaim.c
--- gc6.5/reclaim.c	2004-11-23 02:58:18.000000000 +0900
+++ gc6.5-risa/reclaim.c	2005-07-11 18:01:16.000000000 +0900
@@ -1030,7 +1030,8 @@
 	
 	GET_TIME(start_time);
 #   endif
-    
+    GC_timerstart();
+
     for (kind = 0; kind < GC_n_kinds; kind++) {
     	ok = &(GC_obj_kinds[kind]);
     	rlp = ok -> ok_reclaim_list;
@@ -1052,6 +1053,7 @@
             }
         }
     }
+    GC_timerstop();
 #   ifdef PRINTTIMES
 	GET_TIME(done_time);
 	GC_printf1("Disposing of reclaim lists took %lu msecs\n",
diff -u -r gc6.5/include/private/gc_priv.h gc6.5-risa/include/private/gc_priv.h
--- gc6.5/include/private/gc_priv.h	Sat Feb 11 04:38:40 2006
+++ gc6.5-risa/include/private/gc_priv.h	Tue May 22 20:00:39 2007
@@ -227,6 +227,10 @@
 # define EXTRA_BYTES 0
 #endif
 
+/* Added by ohara */
+# ifndef LARGE_CONFIG
+#   define LARGE_CONFIG
+# endif
 
 # ifndef LARGE_CONFIG
 #   define MINHINCR 16	 /* Minimum heap increment, in blocks of HBLKSIZE  */
diff -u -r gc6.5/os_dep.c gc6.5-risa/os_dep.c
--- gc6.5/os_dep.c	2006-04-22 08:26:47.000000000 +0900
+++ gc6.5-risa/os_dep.c	2008-02-13 18:32:47.000000000 +0900
@@ -694,7 +694,7 @@
     || defined(HURD) || defined(NETBSD)
 	static struct sigaction old_segv_act;
 #	if defined(IRIX5) || defined(HPUX) \
-	|| defined(HURD) || defined(NETBSD)
+	|| defined(HURD) || defined(NETBSD) || defined(FREEBSD)
 	    static struct sigaction old_bus_act;
 #	endif
 #   else
@@ -709,7 +709,7 @@
 #   endif
     {
 #	if defined(SUNOS5SIGS) || defined(IRIX5)  \
-        || defined(OSF1) || defined(HURD) || defined(NETBSD)
+        || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
 	  struct sigaction	act;
 
 	  act.sa_handler	= h;
@@ -731,7 +731,7 @@
 #	  else
 	        (void) sigaction(SIGSEGV, &act, &old_segv_act);
 #		if defined(IRIX5) \
-		   || defined(HPUX) || defined(HURD) || defined(NETBSD)
+		   || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
 		    /* Under Irix 5.x or HP/UX, we may get SIGBUS.	*/
 		    /* Pthreads doesn't exist under Irix 5.x, so we	*/
 		    /* don't have to worry in the threads case.		*/
diff -u -r gc6.5/dyn_load.c gc6.5-risa/dyn_load.c
--- gc6.5/dyn_load.c	2006-06-07 14:01:52.000000000 +0900
+++ gc6.5-risa/dyn_load.c	2008-02-13 18:31:52.000000000 +0900
@@ -102,6 +102,12 @@
 #      else
 #        define ElfW(type) Elf64_##type
 #      endif
+#    elif defined(__FreeBSD__)
+#      if __ELF_WORD_SIZE == 32
+#        define ElfW(type) Elf32_##type
+#      else
+#        define ElfW(type) Elf64_##type
+#      endif
 #    else
 #      ifdef NETBSD
 #        if ELFSIZE == 32