diff --git a/config.h.in b/config.h.in index df662fb..c4270d1 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,9 @@ /* adds support for libffi */ #undef ENABLE_LIBFFI +/* use flat segment and dirty vectors (not used yet) */ +#undef FLAT_TABLES + /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H diff --git a/configure b/configure index 695d1de..a887a32 100755 --- a/configure +++ b/configure @@ -5606,6 +5606,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF +if test "$ac_cv_sizeof_void_p" = 4; then + +cat >>confdefs.h <<\_ACEOF +#define FLAT_TABLES 1 +_ACEOF + +fi + # Checks for libraries. { $as_echo "$as_me:$LINENO: checking for library containing dlsym" >&5 diff --git a/configure.ac b/configure.ac index 9034ff2..bcfbaff 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,11 @@ case "$target_os" in esac AC_CHECK_SIZEOF(void *) +if test "$ac_cv_sizeof_void_p" = 4; then + AC_DEFINE(FLAT_TABLES, 1, + [use flat segment and dirty vectors (not used yet)]) +fi + # Checks for libraries. AC_SEARCH_LIBS(dlsym, dl,, [AC_MSG_ERROR([Cannot find libdl])]) diff --git a/src/ikarus-data.h b/src/ikarus-data.h index 08e0237..b625b2d 100644 --- a/src/ikarus-data.h +++ b/src/ikarus-data.h @@ -190,14 +190,14 @@ void ikarus_usage_short(void); void* ik_malloc(int); void ik_free(void*, int); -ikptr ik_mmap(int); -ikptr ik_mmap_typed(int size, unsigned int type, ikpcb*); -ikptr ik_mmap_ptr(int size, int gen, ikpcb*); -ikptr ik_mmap_data(int size, int gen, ikpcb*); -ikptr ik_mmap_code(int size, int gen, ikpcb*); -ikptr ik_mmap_mixed(int size, ikpcb*); -void ik_munmap(ikptr, int); -void ik_munmap_from_segment(ikptr, unsigned long int, ikpcb*); +ikptr ik_mmap(long int); +ikptr ik_mmap_typed(long int size, unsigned int type, ikpcb*); +ikptr ik_mmap_ptr(long int size, int gen, ikpcb*); +ikptr ik_mmap_data(long int size, int gen, ikpcb*); +ikptr ik_mmap_code(long int size, int gen, ikpcb*); +ikptr ik_mmap_mixed(long int size, ikpcb*); +void ik_munmap(ikptr, long int); +void ik_munmap_from_segment(ikptr, long int, ikpcb*); ikpcb* ik_make_pcb(); void ik_delete_pcb(ikpcb*); void ik_free_symbol_table(ikpcb* pcb); diff --git a/src/ikarus-runtime.c b/src/ikarus-runtime.c index 2c7082a..4be15c6 100644 --- a/src/ikarus-runtime.c +++ b/src/ikarus-runtime.c @@ -50,8 +50,8 @@ extern char **environ; #define segment_shift (pageshift+pageshift-2) #define segment_index(x) (((unsigned long int)(x)) >> segment_shift) -ikptr ik_mmap(int size); -void ik_munmap(ikptr mem, int size); +ikptr ik_mmap(long int size); +void ik_munmap(ikptr mem, long int size); static void extend_table_maybe(ikptr p, unsigned long int size, ikpcb* pcb){ @@ -120,7 +120,7 @@ set_segment_type(ikptr base, unsigned long int size, unsigned int type, ikpcb* p } void -ik_munmap_from_segment(ikptr base, unsigned long int size, ikpcb* pcb){ +ik_munmap_from_segment(ikptr base, long int size, ikpcb* pcb){ assert(base >= pcb->memory_base); assert((base+size) <= pcb->memory_end); assert(size == align_to_next_page(size)); @@ -158,7 +158,7 @@ ik_munmap_from_segment(ikptr base, unsigned long int size, ikpcb* pcb){ ikptr -ik_mmap_typed(int size, unsigned int type, ikpcb* pcb){ +ik_mmap_typed(long int size, unsigned int type, ikpcb* pcb){ ikptr p; if(size == pagesize) { ikpage* s = pcb->cached_pages; @@ -181,17 +181,17 @@ ik_mmap_typed(int size, unsigned int type, ikpcb* pcb){ } ikptr -ik_mmap_ptr(int size, int gen, ikpcb* pcb){ +ik_mmap_ptr(long int size, int gen, ikpcb* pcb){ return ik_mmap_typed(size, pointers_mt | gen, pcb); } ikptr -ik_mmap_data(int size, int gen, ikpcb* pcb){ +ik_mmap_data(long int size, int gen, ikpcb* pcb){ return ik_mmap_typed(size, data_mt | gen, pcb); } ikptr -ik_mmap_code(int size, int gen, ikpcb* pcb){ +ik_mmap_code(long int size, int gen, ikpcb* pcb){ ikptr p = ik_mmap_typed(size, code_mt | gen, pcb); if(size > pagesize){ set_segment_type(p+pagesize, size-pagesize, data_mt|gen, pcb); @@ -208,7 +208,7 @@ ik_mmap_code(int size, int gen, ikpcb* pcb){ ikptr -ik_mmap_mixed(int size, ikpcb* pcb){ +ik_mmap_mixed(long int size, ikpcb* pcb){ return ik_mmap_typed(size, mainheap_mt, pcb); } @@ -216,7 +216,7 @@ ik_mmap_mixed(int size, ikpcb* pcb){ ikptr -ik_mmap(int size){ +ik_mmap(long int size){ int pages = (size + pagesize - 1) / pagesize; total_allocated_pages += pages; int mapsize = pages * pagesize; @@ -231,7 +231,7 @@ ik_mmap(int size){ 0); /* FIXME: check if in range */ if(mem == MAP_FAILED){ - fprintf(stderr, "Mapping failed: %s\n", strerror(errno)); + fprintf(stderr, "Mapping (0x%lx bytes) failed: %s\n", size, strerror(errno)); exit(-1); } #else @@ -246,7 +246,7 @@ ik_mmap(int size){ } void -ik_munmap(ikptr mem, int size){ +ik_munmap(ikptr mem, long int size){ int pages = (size + pagesize - 1) / pagesize; int mapsize = pages * pagesize; assert(size == mapsize);