-rwxr-xr-x | gcl/h/386-linux.h | 15 |
diff --git a/gcl/h/386-linux.h b/gcl/h/386-linux.h index 4b62b5169..16ff5d26a 100755 --- a/gcl/h/386-linux.h +++ b/gcl/h/386-linux.h @@ -41,3 +41,18 @@ #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 |