From 764f1408a3fa9b1991e3e18d17ea857776c1503e Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 20 Mar 2001 17:13:39 +0000 Subject: * mmap support for common simulators 2001-03-16 Frank Ch. Eigler Add support for mmap-based memory regions. * sim-memopt.c (mmap_next_fd): New global. (sim_memory_init): Reinitialize it. (OPTION_MEMORY_MAPFILE, memory_option_handler): Support new "--memory-mapfile FILE" option. Check for some errors. (do_memopt_add): Conditionally do mmap instead of malloc for backing store of simulated memory. Check for more errors. (do_simopt_delete, sim_memory_uninstall): Corresponding cleanup. * sim-memopt.h (munmap_length): New member of _sim_memopt. * configure.in: Look for mmap/fstat related functions and headers. * config.in, configure: Regenerated. --- sim/common/configure | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'sim/common/configure') diff --git a/sim/common/configure b/sim/common/configure index 8fc9d04..11c0e64 100755 --- a/sim/common/configure +++ b/sim/common/configure @@ -3522,7 +3522,7 @@ fi # These aren't all needed yet, but will be eventually. -for ac_hdr in stdlib.h string.h strings.h time.h sys/times.h +for ac_hdr in stdlib.h string.h strings.h time.h sys/times.h sys/stat.h sys/mman.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -3562,6 +3562,61 @@ else fi done +for ac_func in mmap munmap +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3569: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + trap '' 1 2 15 cat > confcache <<\EOF -- cgit v1.1