From b01a8697e29b26cb67a0355696dca97713e6fc18 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Sun, 15 Mar 1998 05:15:18 +0000 Subject: [PATCH] * config.in (HAVE_FCNTL_H): Add. * configure: Regenerate. * Makefile.in (SIM_OBJS): Add devices.o. * m32r-sim.h (m32r_devices): Renamed from m32r_mspr_device. (UART_*): Define m32r serial port parameters. (M32R_DEVICE_ADDR,M32R_DEVICE_LEN): Define. * m32r.c (device_io_{read,write}_buffer,device_error): Move from here, * devices.c: To here. * sim-if.c: Don't include signal.h,sim-core.h. (sim_open): Use M32R_DEVICE_{ADDR,LEN} in sim_core_attach call. (sim_resume): Call sim_module_{resume,suspend}. * m32r.c (m32r_h_cr_{get,set}): Use register number enums. * tconfig.in (SIM_HANDLES_LMA): Define. * sim-if.c (do_trap): Result is new pc. Handle --environment=operating. * sem-switch.c,sem.c: Regenerate. start-sanitize-m32rx * semx.c: Regenerate. end-sanitize-m32rx --- sim/m32r/.Sanitize | 1 + sim/m32r/ChangeLog | 29 +++++++++ sim/m32r/configure | 144 ++++++++++++++++++++++++++++++++++++++++----- sim/m32r/semx.c | 8 +-- 4 files changed, 163 insertions(+), 19 deletions(-) diff --git a/sim/m32r/.Sanitize b/sim/m32r/.Sanitize index 52355f43feb..d79982e3e33 100644 --- a/sim/m32r/.Sanitize +++ b/sim/m32r/.Sanitize @@ -45,6 +45,7 @@ cpu.h cpuall.h decode.c decode.h +devices.c extract.c m32r-sim.h m32r.c diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index f5baf5494ad..9ddcc641928 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,32 @@ +Sat Mar 14 20:53:36 1998 Doug Evans + + * config.in (HAVE_FCNTL_H): Add. + * configure: Regenerate. + * Makefile.in (SIM_OBJS): Add devices.o. + * m32r-sim.h (m32r_devices): Renamed from m32r_mspr_device. + (UART_*): Define m32r serial port parameters. + (M32R_DEVICE_ADDR,M32R_DEVICE_LEN): Define. + * m32r.c (device_io_{read,write}_buffer,device_error): Move from here, + * devices.c: To here. + * sim-if.c: Don't include signal.h,sim-core.h. + (sim_open): Use M32R_DEVICE_{ADDR,LEN} in sim_core_attach call. + (sim_resume): Call sim_module_{resume,suspend}. + * m32r.c (m32r_h_cr_{get,set}): Use register number enums. + + * tconfig.in (SIM_HANDLES_LMA): Define. + + * sim-if.c (do_trap): Result is new pc. + Handle --environment=operating. + * sem-switch.c,sem.c: Regenerate. +start-sanitize-m32rx + * semx.c: Regenerate. +end-sanitize-m32rx + +Wed Mar 11 14:07:39 1998 Andrew Cagney + + * sim-if.c (syscall_read_mem, syscall_write_mem): Replace + sim_core_*_map with read_map, write_map, exec_map resp. + Wed Mar 4 11:36:51 1998 Doug Evans * Makefile.in (SIM_EXTRA_DEPS): Add cpu-opc.h. diff --git a/sim/m32r/configure b/sim/m32r/configure index 73a20416f5d..95e289f865b 100755 --- a/sim/m32r/configure +++ b/sim/m32r/configure @@ -1091,7 +1091,7 @@ fi # Check for common headers. # FIXME: Seems to me this can cause problems for i386-windows hosts. # At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*. -for ac_hdr in stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h +for ac_hdr in stdlib.h string.h strings.h unistd.h time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1131,15 +1131,95 @@ else fi done +for ac_hdr in sys/time.h sys/resource.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1139: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in fcntl.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + for ac_func in getrusage time sigaction do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1138: checking for $ac_func" >&5 +echo "configure:1218: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1191,11 +1271,12 @@ done +USE_MAINTAINER_MODE=no # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" case "${enableval}" in - yes) MAINT="" ;; + yes) MAINT="" USE_MAINTAINER_MODE=yes ;; no) MAINT="#" ;; *) { echo "configure: error: "--enable-maintainer-mode does not take a value"" 1>&2; exit 1; }; MAINT="#" ;; esac @@ -1334,12 +1415,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1338: checking return type of signal handlers" >&5 +echo "configure:1419: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1356,7 +1437,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1509,14 +1590,14 @@ else if test "x$cross_compiling" = "xno"; then echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1513: checking whether byte ordering is bigendian" >&5 +echo "configure:1594: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1527,11 +1608,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1542,7 +1623,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1562,7 +1643,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1665,6 +1746,38 @@ else fi +if test ${USE_MAINTAINER_MODE} = yes ; then + # Extract the first word of "guile", so it can be a program name with args. +set dummy guile; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1754: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_SCHEME'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$SCHEME"; then + ac_cv_prog_SCHEME="$SCHEME" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_SCHEME="guile" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_SCHEME" && ac_cv_prog_SCHEME="guile" +fi +fi +SCHEME="$ac_cv_prog_SCHEME" +if test -n "$SCHEME"; then + echo "$ac_t""$SCHEME" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi + trap '' 1 2 15 @@ -1847,6 +1960,7 @@ s%@sim_debug@%$sim_debug%g s%@sim_stdio@%$sim_stdio%g s%@sim_trace@%$sim_trace%g s%@sim_profile@%$sim_profile%g +s%@SCHEME@%$SCHEME%g CEOF EOF diff --git a/sim/m32r/semx.c b/sim/m32r/semx.c index 8bd792702c2..2803419e00a 100644 --- a/sim/m32r/semx.c +++ b/sim/m32r/semx.c @@ -2405,7 +2405,7 @@ do { TRACE_RESULT (current_cpu, "h-ie-0", 'x', CPU (h_ie)); CPU (h_cond) = OPRND (h_bcond_0); TRACE_RESULT (current_cpu, "condbit", 'x', CPU (h_cond)); - BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, OPRND (h_bpc_0))); + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, ANDSI (OPRND (h_bpc_0), -4))); TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); @@ -3021,10 +3021,10 @@ SEM_FN_NAME (m32rx,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg, PAREXEC *par_ex do { m32rx_h_cr_set (current_cpu, 6, ADDSI (OPRND (pc), 4)); TRACE_RESULT (current_cpu, "h-cr-6", 'x', m32rx_h_cr_get (current_cpu, 6)); -m32rx_h_cr_set (current_cpu, 0, ANDSI (SRLSI (OPRND (h_cr_0), 8), 33488896)); +m32rx_h_cr_set (current_cpu, 0, ANDSI (SLLSI (OPRND (h_cr_0), 8), 65408)); TRACE_RESULT (current_cpu, "h-cr-0", 'x', m32rx_h_cr_get (current_cpu, 0)); -do_trap (current_cpu, OPRND (uimm4)); -; /*clobber*/ + BRANCH_NEW_PC (new_pc, SEM_BRANCH_VIA_ADDR (sem_arg, do_trap (current_cpu, OPRND (uimm4)))); + TRACE_RESULT (current_cpu, "pc", 'x', CPU (h_pc)); } while (0); #if WITH_PROFILE_MODEL_P -- 2.30.2