Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.10-42) unstable; urgency=medium
 .
   * backport travel_push_new from master
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- gcl-2.6.10.orig/h/386-gnu.h
+++ gcl-2.6.10/h/386-gnu.h
@@ -49,21 +49,6 @@
 #define	I386
 #define SGC
 
-
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
-   if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
-     fprintf(stderr,"%p %p\n",p,pe);\
-     perror("");\
-     FEerror("Cannot mprotect", 0);\
-   }\
-}
-#endif
-
 #ifndef SA_NOCLDWAIT
 #define SA_NOCLDWAIT 0 /*fixme handler does waitpid(-1, ..., WNOHANG)*/
 #endif
--- gcl-2.6.10.orig/h/386-kfreebsd.h
+++ gcl-2.6.10/h/386-kfreebsd.h
@@ -43,21 +43,6 @@
 #define	I386
 #define SGC
 
-
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
-   if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
-     fprintf(stderr,"%p %p\n",p,pe);\
-     perror("");\
-     FEerror("Cannot mprotect", 0);\
-   }\
-}
-#endif
-
 #define RELOC_H "elf32_i386_reloc.h"
 
 #define BRK_DOES_NOT_GUARANTEE_ALLOCATION
--- gcl-2.6.10.orig/h/386-linux.h
+++ gcl-2.6.10/h/386-linux.h
@@ -44,19 +44,4 @@
 #define	I386
 #define SGC
 
-
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
-   if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
-     fprintf(stderr,"%p %p\n",p,pe);\
-     perror("");\
-     FEerror("Cannot mprotect", 0);\
-   }\
-}
-#endif
-
 #define RELOC_H "elf32_i386_reloc.h"
--- gcl-2.6.10.orig/h/386-macosx.h
+++ gcl-2.6.10/h/386-macosx.h
@@ -77,34 +77,6 @@ extern void *my_sbrk(long incr);
 extern int seek_to_end_ofile (FILE *);
 #define SEEK_TO_END_OFILE(fp) seek_to_end_ofile(fp)
 
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
-   if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
-     fprintf(stderr,"%p %p\n",p,pe);\
-     perror("");\
-     FEerror("Cannot mprotect", 0);\
-   }\
-}
-#endif
-
-
-/* Processor cache synchronization code.  This is based on powerpc-linux.h (Debian ppc).
-   See equivalent code in dyld.  See also vm_msync declared in <mach/vm_maps.h>.  */
-/* #define CLEAR_CACHE_LINE_SIZE 32 */
-/* #define CLEAR_CACHE                                                             \ */
-/* do {                                                                            \ */
-/*   void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size;                     \ */
-/*   v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));                  \ */
-/*   for (;v<ve;v+=CLEAR_CACHE_LINE_SIZE)                                          \ */
-/*   asm __volatile__                                                              \ */
-/*     ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory"); \ */
-/* } while(0) */
-
-
 /** Stratified garbage collection implementation [ (si::sgc-on t) ]  */
 
 /* Mac OS X has sigaction (this is needed in o/usig.c)  */
--- gcl-2.6.10.orig/h/alpha-linux.h
+++ gcl-2.6.10/h/alpha-linux.h
@@ -16,14 +16,5 @@
 #define SPECIAL_RELOC_H "elf64_alpha_reloc_special.h"
 #define PAL_imb		134
 #define imb() __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
-#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \
-                        void *p=(void *)((unsigned long)v & ~(PAGESIZE-1));	\
-			void *pe=(void *)((unsigned long)ve & ~(PAGESIZE-1)) + PAGESIZE-1; \
-                        if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {		\
-			  fprintf(stderr,"%p %p\n",p,pe);		\
-			  perror("");					\
-			  FEerror("Cannot mprotect", 0);		\
-			}						\
-			imb();						\
-                        } while(0)
+#define CLEAR_CACHE imb()
 
--- gcl-2.6.10.orig/h/amd64-kfreebsd.h
+++ gcl-2.6.10/h/amd64-kfreebsd.h
@@ -20,20 +20,6 @@
 /* Apparently stack pointers can be 4 byte aligned, at least &argc -- CM */
 #define C_GC_OFFSET 4
 
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
-   if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
-     fprintf(stderr,"%p %p\n",p,pe);\
-     perror("");\
-     FEerror("Cannot mprotect", 0);\
-   }\
-}
-#endif
-
 #define RELOC_H "elf64_i386_reloc.h"
 
 #define BRK_DOES_NOT_GUARANTEE_ALLOCATION
--- gcl-2.6.10.orig/h/amd64-linux.h
+++ gcl-2.6.10/h/amd64-linux.h
@@ -20,18 +20,4 @@
 /* Apparently stack pointers can be 4 byte aligned, at least &argc -- CM */
 #define C_GC_OFFSET 4
 
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
-   if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
-     fprintf(stderr,"%p %p\n",p,pe);\
-     perror("");\
-     FEerror("Cannot mprotect", 0);\
-   }\
-}
-#endif
-
 #define RELOC_H "elf64_i386_reloc.h"
--- gcl-2.6.10.orig/h/arm-linux.h
+++ gcl-2.6.10/h/arm-linux.h
@@ -1,30 +1,5 @@
 #include "linux.h"
 
-/*  #define CLEAR_CACHE do {\ */
-/*    void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */
-/*    register unsigned long _beg __asm ("a1") = (unsigned long)(v);	\ */
-/*    register unsigned long _end __asm ("a2") = (unsigned long)(ve);\ */
-/*    register unsigned long _flg __asm ("a3") = 0;			\ */
-/*    __asm __volatile ("swi 0x9f0002		@ sys_cacheflush"	\ */
-/*	    :  no outputs 					\ */
-/*		    : no inputs					\ */
-/*		    : "a1");						\*/
-/*  } while (0) */
-
-/* #define CLEAR_CACHE do {\ */
-/*   void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */
-/*   register unsigned long _beg __asm ("a1") = (unsigned long)(v);	\ */
-/*   register unsigned long _end __asm ("a2") = (unsigned long)(ve);\ */
-/*   register unsigned long _flg __asm ("a3") = 0;			\ */
-/*   __asm __volatile ("swi 0x9f0002		@ sys_cacheflush"	\ */
-/* 		    : "=r" (_beg)				\ */
-/* 		    : "0" (_beg), "r" (_end), "r"(_flg));	\ */
-/* } while (0) */
-
-#define CLEAR_CACHE \
-  __builtin___clear_cache((void *)memory->cfd.cfd_start,\
-			  (void *)memory->cfd.cfd_start+memory->cfd.cfd_size)
-
 #ifdef IN_GBC
 #undef MPROTECT_ACTION_FLAGS
 #define MPROTECT_ACTION_FLAGS SA_RESTART|SA_SIGINFO
--- gcl-2.6.10.orig/h/hppa-linux.h
+++ gcl-2.6.10/h/hppa-linux.h
@@ -13,7 +13,7 @@
 #include <sys/mman.h>
 #define CLEAR_CACHE_LINE_SIZE 32
 #define CLEAR_CACHE {\
-    void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size+CLEAR_CACHE_LINE_SIZE; \
+   void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size;	\
    v1=(void *)((unsigned long)v1 & ~(CLEAR_CACHE_LINE_SIZE - 1));\
    for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fdc 0(%0)" : : "r" (v) : "memory");\
    asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");\
--- gcl-2.6.10.orig/h/ia64-linux.h
+++ gcl-2.6.10/h/ia64-linux.h
@@ -1,22 +1,5 @@
 #include "linux.h"
 
-/*  #ifdef IN_GBC */
-/*  #define GET_FAULT_ADDR(sig,code,sv,a) \ */
-/*      ((void *)(*((char ***)(&code)))[17]) */
-/*  #endif */
-
-/*#define NULL_OR_ON_C_STACK(x) ((x)==0 || ((unsigned int)x) > (unsigned int)(pagetochar(MAXPAGE+1)))*/
-
-/*  #define ADDITIONAL_FEATURES \ */
-/*  		     ADD_FEATURE("BSD386"); \ */
-/*        	             ADD_FEATURE("MC68020") */
-
-
-/*  #define	I386 */
-/*  #define SGC */
-
-/*  #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; for (;v<ve;v+=32)   asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");} while(0) */
-
 #undef MPROTECT_ACTION_FLAGS
 #define MPROTECT_ACTION_FLAGS SA_RESTART|SA_SIGINFO
 #ifdef IN_GBC
--- gcl-2.6.10.orig/h/mips-linux.h
+++ gcl-2.6.10/h/mips-linux.h
@@ -1,14 +1,5 @@
 #include "linux.h"
 
-#include <asm/cachectl.h>
-int cacheflush(void *,int,int);
-#define CLEAR_CACHE_LINE_SIZE 32
-#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \
-                        v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\
-                        cacheflush(v,ve-v,BCACHE);\
-                    } while(0)
-
-
 #undef MPROTECT_ACTION_FLAGS
 #define MPROTECT_ACTION_FLAGS SA_RESTART|SA_SIGINFO
 #ifdef IN_GBC
--- gcl-2.6.10.orig/h/mipsel-linux.h
+++ gcl-2.6.10/h/mipsel-linux.h
@@ -1,22 +1,5 @@
 #include "linux.h"
 
-/*  #ifdef IN_GBC */
-/*  #define GET_FAULT_ADDR(sig,code,sv,a) \ */
-/*      ((void *)(*((char ***)(&code)))[17]) */
-/*  #endif */
-
-/*#define NULL_OR_ON_C_STACK(x) ((x)==0 || ((unsigned int)x) > (unsigned int)(pagetochar(MAXPAGE+1)))*/
-
-/*  #define ADDITIONAL_FEATURES \ */
-/*  		     ADD_FEATURE("BSD386"); \ */
-/*        	             ADD_FEATURE("MC68020") */
-
-
-/*  #define	I386 */
-/*  #define SGC */
-
-/*  #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; for (;v<ve;v+=32)   asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");} while(0) */
-
 #undef MPROTECT_ACTION_FLAGS
 #define MPROTECT_ACTION_FLAGS SA_RESTART|SA_SIGINFO
 #ifdef IN_GBC
--- gcl-2.6.10.orig/h/powerpc-linux.h
+++ gcl-2.6.10/h/powerpc-linux.h
@@ -11,13 +11,6 @@
 
 #define CLEAR_CACHE_LINE_SIZE 32
 #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \
-                        void *p=(void *)((unsigned long)v & ~(PAGESIZE-1));	\
-			void *pe=(void *)((unsigned long)ve & ~(PAGESIZE-1)) + PAGESIZE-1; \
-                        if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {		\
-			  fprintf(stderr,"%p %p\n",p,pe);		\
-			  perror("");					\
-			  FEerror("Cannot mprotect", 0);		\
-			}						\
                         v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\
                         for (;v<ve;v+=CLEAR_CACHE_LINE_SIZE) \
                            asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");\
--- gcl-2.6.10.orig/h/s390-linux.h
+++ gcl-2.6.10/h/s390-linux.h
@@ -1,7 +1,5 @@
 #include "linux.h"
 
-/*  #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; for (;v<ve;v+=32)   asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");} while(0) */
-
 #ifdef IN_GBC
 #undef MPROTECT_ACTION_FLAGS
 #define MPROTECT_ACTION_FLAGS SA_RESTART|SA_SIGINFO
--- gcl-2.6.10.orig/h/sh4-linux.h
+++ gcl-2.6.10/h/sh4-linux.h
@@ -48,9 +48,9 @@
 #ifdef IN_SFASL
 #include <sys/mman.h>
 #define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
+   void *p=memory->cfd.cfd_start,*pe=p+memory->cfd.cfd_size; \
+   p=(void *)((unsigned long)p & ~(PAGESIZE-1)); \
+   /*+=PAGESIZE?*/
    for (;p<pe;p++) asm __volatile__ ("ocbp @%0\n\t": : "r" (p) : "memory");\
 }
 #endif
--- gcl-2.6.10.orig/h/solaris.h
+++ gcl-2.6.10/h/solaris.h
@@ -34,20 +34,6 @@ void bcopy (const void *,void *,size_t);
 void bzero(void *,size_t);
 int bcmp(const void *,const void *,size_t);
 
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p,*pe; \
-   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
-   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
-   if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
-     fprintf(stderr,"%p %p\n",p,pe);\
-     perror("");\
-     FEerror("Cannot mprotect", 0);\
-   }\
-}
-#endif
-
 #if SIZEOF_LONG==4
 #define RELOC_H "elf32_sparc_reloc.h"
 #else
--- gcl-2.6.10.orig/o/sfaslelf.c
+++ gcl-2.6.10/o/sfaslelf.c
@@ -532,16 +532,11 @@ static int
 clear_protect_memory(object memory) {
 
   void *p,*pe;
-  int i;
 
   p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1));
   pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size + PAGESIZE-1) & ~(PAGESIZE-1));
 
-  i=mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC);
-
-  __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
-
-  return i;
+  return mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC);
 
 }
 #endif
@@ -583,12 +578,12 @@ fasload(object faslfile) {
   massert(!un_mmap(v1,ve));
   close_stream(faslfile);
   
-#ifdef HAVE_BUILTIN_CLEAR_CACHE
   massert(!clear_protect_memory(memory));
-#else
-#ifdef CLEAR_CACHE
+
+#if defined(HAVE_BUILTIN_CLEAR_CACHE)
+  __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
+#elif defined(CLEAR_CACHE)
   CLEAR_CACHE;
-#endif
 #endif  
 
   init_address-=(ul)memory->cfd.cfd_start;
