aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>1998-05-18 15:55:05 +0000
committerFrank Ch. Eigler <fche@redhat.com>1998-05-18 15:55:05 +0000
commit3fa454e95fe104add1b25e53a8dc1decc1c270f1 (patch)
tree9bb506f391e5eaece890333cda94a9a3f2e219af /sim/mips
parentd9c2c0c569da93bb393a078ebadbb89c1b6cca3b (diff)
downloadgdb-3fa454e95fe104add1b25e53a8dc1decc1c270f1.zip
gdb-3fa454e95fe104add1b25e53a8dc1decc1c270f1.tar.gz
gdb-3fa454e95fe104add1b25e53a8dc1decc1c270f1.tar.bz2
* Monster patch - may destablize MIPS sims for a little while.
* Followup patch for SCEI PR 15853 * First check-in of TX3904 interrupt controller devices for ECC. [sanitized] * First implementation of MIPS hardware interrupt emulation. Mon May 18 18:22:42 1998 Frank Ch. Eigler <fche@cygnus.com> * configure.in (SIM_AC_OPTION_HARDWARE): Added common hardware modules. Recognize TX39 target with "mips*tx39" pattern. * configure: Rebuilt. * sim-main.h (*): Added many macros defining bits in TX39 control registers. (SignalInterrupt): Send actual PC instead of NULL. (SignalNMIReset): New exception type. * interp.c (board): New variable for future use to identify a particular board being simulated. (mips_option_handler,mips_options): Added "--board" option. (interrupt_event): Send actual PC. (sim_open): Make memory layout conditional on board setting. (signal_exception): Initial implementation of hardware interrupt handling. Accept another break instruction variant for simulator exit. (decode_coproc): Implement RFE instruction for TX39. (mips.igen): Decode RFE instruction as such. start-sanitize-tx3904 * configure.in (tx3904cpu,tx3904irc): Added devices for tx3904. * interp.c: Define "jmr3904" and "jmr3904debug" board types and bbegin to implement memory map. * dv-tx3904cpu.c: New file. * dv-tx3904irc.c: New file. end-sanitize-tx3904
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/.Sanitize37
-rw-r--r--sim/mips/ChangeLog31
-rwxr-xr-xsim/mips/configure410
-rw-r--r--sim/mips/configure.in19
-rw-r--r--sim/mips/dv-tx3904cpu.c230
-rw-r--r--sim/mips/dv-tx3904irc.c392
-rw-r--r--sim/mips/interp.c219
-rw-r--r--sim/mips/mips.igen46
-rw-r--r--sim/mips/sim-main.h79
9 files changed, 1271 insertions, 192 deletions
diff --git a/sim/mips/.Sanitize b/sim/mips/.Sanitize
index 46f01be..135288d 100644
--- a/sim/mips/.Sanitize
+++ b/sim/mips/.Sanitize
@@ -31,6 +31,13 @@ else
lose_these_too="${vr4320_files} ${lose_these_too}"
fi
+tx3904_files="dv-tx3904cpu.c dv-tx3904irc.c"
+if ( echo $* | grep keep\-tx3904 > /dev/null ) ; then
+ keep_these_too="${tx3904_files} ${keep_these_too}"
+else
+ lose_these_too="${tx3904_files} ${lose_these_too}"
+fi
+
sky_files="ChangeLog.sky sky-device.c sky-device.h sky-dma.c sky-dma.h sky-bits.h"
sky_files="$sky_files sky-engine.c sky-gpuif.c sky-gpuif.h"
sky_files="$sky_files sky-gs.c sky-gs.h"
@@ -264,6 +271,36 @@ else
fi
+tx3904_files="ChangeLog configure configure.in interp.c"
+
+if ( echo $* | grep keep\-tx3904 > /dev/null ) ; then
+ for i in $tx3904_files ; do
+ if test ! -d $i && (grep sanitize-tx3904 $i > /dev/null) ; then
+ if [ -n "${verbose}" ] ; then
+ echo Keeping tx3904 stuff in $i
+ fi
+ fi
+ done
+else
+ for i in * ; do
+ if test ! -d $i && (grep sanitize-tx3904 $i > /dev/null) ; then
+ if [ -n "${verbose}" ] ; then
+ echo Removing traces of \"tx3904\" from $i...
+ fi
+ cp $i new
+ sed '/start\-sanitize\-tx3904/,/end-\sanitize\-tx3904/d' < $i > new
+ if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
+ if [ -n "${verbose}" ] ; then
+ echo Caching $i in .Recover...
+ fi
+ mv $i .Recover
+ fi
+ mv new $i
+ fi
+ done
+fi
+
+
never_files="ChangeLog configure configure.in interp.c gencode.c mips.igen mips.dc"
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 07d4c76..7900eba 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,34 @@
+Mon May 18 18:22:42 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * configure.in (SIM_AC_OPTION_HARDWARE): Added common hardware
+ modules. Recognize TX39 target with "mips*tx39" pattern.
+ * configure: Rebuilt.
+ * sim-main.h (*): Added many macros defining bits in
+ TX39 control registers.
+ (SignalInterrupt): Send actual PC instead of NULL.
+ (SignalNMIReset): New exception type.
+ * interp.c (board): New variable for future use to identify
+ a particular board being simulated.
+ (mips_option_handler,mips_options): Added "--board" option.
+ (interrupt_event): Send actual PC.
+ (sim_open): Make memory layout conditional on board setting.
+ (signal_exception): Initial implementation of hardware interrupt
+ handling. Accept another break instruction variant for simulator
+ exit.
+ (decode_coproc): Implement RFE instruction for TX39.
+ (mips.igen): Decode RFE instruction as such.
+start-sanitize-tx3904
+ * configure.in (tx3904cpu,tx3904irc): Added devices for tx3904.
+ * interp.c: Define "jmr3904" and "jmr3904debug" board types and
+ bbegin to implement memory map.
+ * dv-tx3904cpu.c: New file.
+ * dv-tx3904irc.c: New file.
+end-sanitize-tx3904
+
+Wed May 13 14:40:11 1998 Gavin Koch <gavin@cygnus.com>
+
+ * mips.igen (check_mt_hilo): Create a separate r3900 version.
+
Wed May 13 14:27:53 1998 Gavin Koch <gavin@cygnus.com>
* r5900.igen: Replace the calls and the definition of the
diff --git a/sim/mips/configure b/sim/mips/configure
index fea79a2..8e160d3 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -119,6 +119,18 @@ sim_inline="-DDEFAULT_INLINE=0"
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
+# Otherwise set it to "no".
+
+
+
+# Check to see if we're running under Win32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+
+
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.12.1
@@ -168,6 +180,10 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-sim-igen=opts Enable IGEN simulator"
ac_help="$ac_help
+ --enable-sim-hardware=LIST Specify the hardware to be included in the build."
+ac_help="$ac_help
+ --enable-sim-hardware=LIST Specify the hardware to be included in the build."
+ac_help="$ac_help
--with-x use the X Window System"
ac_help="$ac_help
--with-sim-gpu2=path Use GPU2 library under given directory"
@@ -683,7 +699,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:687: checking how to run the C preprocessor" >&5
+echo "configure:703: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -698,13 +714,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 702 "configure"
+#line 718 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -715,13 +731,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 719 "configure"
+#line 735 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -744,7 +760,7 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:748: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:764: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -771,7 +787,7 @@ else
fi
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:775: checking for POSIXized ISC" >&5
+echo "configure:791: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -792,12 +808,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:796: checking for ANSI C header files" >&5
+echo "configure:812: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 801 "configure"
+#line 817 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -805,7 +821,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -822,7 +838,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 826 "configure"
+#line 842 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -840,7 +856,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 844 "configure"
+#line 860 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -861,7 +877,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 865 "configure"
+#line 881 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -872,7 +888,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@@ -896,12 +912,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:900: checking for working const" >&5
+echo "configure:916: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 905 "configure"
+#line 921 "configure"
#include "confdefs.h"
int main() {
@@ -950,7 +966,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -971,21 +987,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:975: checking for inline" >&5
+echo "configure:991: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 982 "configure"
+#line 998 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1011,12 +1027,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1015: checking for off_t" >&5
+echo "configure:1031: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1020 "configure"
+#line 1036 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1044,12 +1060,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1048: checking for size_t" >&5
+echo "configure:1064: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1053 "configure"
+#line 1069 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1079,19 +1095,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1083: checking for working alloca.h" >&5
+echo "configure:1099: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1088 "configure"
+#line 1104 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1112,12 +1128,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1116: checking for alloca" >&5
+echo "configure:1132: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1121 "configure"
+#line 1137 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1140,7 +1156,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1172,12 +1188,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1176: checking whether alloca needs Cray hooks" >&5
+echo "configure:1192: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1181 "configure"
+#line 1197 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1202,12 +1218,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1206: checking for $ac_func" >&5
+echo "configure:1222: 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 <<EOF
-#line 1211 "configure"
+#line 1227 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1230,7 +1246,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1257,7 +1273,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1261: checking stack direction for C alloca" >&5
+echo "configure:1277: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1265,7 +1281,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1269 "configure"
+#line 1285 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1284,7 +1300,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -1309,17 +1325,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1313: checking for $ac_hdr" >&5
+echo "configure:1329: 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
-#line 1318 "configure"
+#line 1334 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1348,12 +1364,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1352: checking for $ac_func" >&5
+echo "configure:1368: 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 <<EOF
-#line 1357 "configure"
+#line 1373 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1376,7 +1392,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1401,7 +1417,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1405: checking for working mmap" >&5
+echo "configure:1421: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1409,7 +1425,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1413 "configure"
+#line 1429 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1549,7 +1565,7 @@ main()
}
EOF
-if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -1622,7 +1638,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1626: checking host system type" >&5
+echo "configure:1642: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1643,7 +1659,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1647: checking target system type" >&5
+echo "configure:1663: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1661,7 +1677,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1665: checking build system type" >&5
+echo "configure:1681: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1705,7 +1721,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1709: checking for $ac_word" >&5
+echo "configure:1725: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1734,7 +1750,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1738: checking for $ac_word" >&5
+echo "configure:1754: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1782,7 +1798,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1786: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1802: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1792,11 +1808,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1796 "configure"
+#line 1812 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1816,12 +1832,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1820: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1836: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1825: checking whether we are using GNU C" >&5
+echo "configure:1841: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1830,7 +1846,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1845,7 +1861,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1849: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1865: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1884,7 +1900,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1888: checking for a BSD compatible install" >&5
+echo "configure:1904: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1950,7 +1966,7 @@ AR=${AR-ar}
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1954: checking for $ac_word" >&5
+echo "configure:1970: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1984,17 +2000,17 @@ unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1988: checking for $ac_hdr" >&5
+echo "configure:2004: 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
-#line 1993 "configure"
+#line 2009 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2024,12 +2040,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2028: checking for $ac_func" >&5
+echo "configure:2044: 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 <<EOF
-#line 2033 "configure"
+#line 2049 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2052,7 +2068,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2081,12 +2097,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2085: checking for $ac_func" >&5
+echo "configure:2101: 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 <<EOF
-#line 2090 "configure"
+#line 2106 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2109,7 +2125,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2143,19 +2159,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2147: checking for LC_MESSAGES" >&5
+echo "configure:2163: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2152 "configure"
+#line 2168 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -2176,7 +2192,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2180: checking whether NLS is requested" >&5
+echo "configure:2196: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -2196,7 +2212,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2200: checking whether included gettext is requested" >&5
+echo "configure:2216: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -2215,17 +2231,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2219: checking for libintl.h" >&5
+echo "configure:2235: checking for libintl.h" >&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
-#line 2224 "configure"
+#line 2240 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2242,19 +2258,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2246: checking for gettext in libc" >&5
+echo "configure:2262: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2251 "configure"
+#line 2267 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -2270,7 +2286,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2274: checking for bindtextdomain in -lintl" >&5
+echo "configure:2290: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2278,7 +2294,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2282 "configure"
+#line 2298 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2289,7 +2305,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2305,19 +2321,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2309: checking for gettext in libintl" >&5
+echo "configure:2325: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2314 "configure"
+#line 2330 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -2345,7 +2361,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2349: checking for $ac_word" >&5
+echo "configure:2365: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2379,12 +2395,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2383: checking for $ac_func" >&5
+echo "configure:2399: 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 <<EOF
-#line 2388 "configure"
+#line 2404 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2407,7 +2423,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2434,7 +2450,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2438: checking for $ac_word" >&5
+echo "configure:2454: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2469,7 +2485,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2473: checking for $ac_word" >&5
+echo "configure:2489: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2501,7 +2517,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 2505 "configure"
+#line 2521 "configure"
#include "confdefs.h"
int main() {
@@ -2509,7 +2525,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -2541,7 +2557,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2545: checking for $ac_word" >&5
+echo "configure:2561: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2575,7 +2591,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2579: checking for $ac_word" >&5
+echo "configure:2595: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2610,7 +2626,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2614: checking for $ac_word" >&5
+echo "configure:2630: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2700,7 +2716,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2704: checking for catalogs to be installed" >&5
+echo "configure:2720: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -2728,17 +2744,17 @@ echo "configure:2704: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:2732: checking for linux/version.h" >&5
+echo "configure:2748: checking for linux/version.h" >&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
-#line 2737 "configure"
+#line 2753 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2807,17 +2823,17 @@ 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
-echo "configure:2811: checking for $ac_hdr" >&5
+echo "configure:2827: 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
-#line 2816 "configure"
+#line 2832 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2847,17 +2863,17 @@ 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:2851: checking for $ac_hdr" >&5
+echo "configure:2867: 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
-#line 2856 "configure"
+#line 2872 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2887,17 +2903,17 @@ for ac_hdr in fcntl.h fpu_control.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2891: checking for $ac_hdr" >&5
+echo "configure:2907: 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
-#line 2896 "configure"
+#line 2912 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2926,12 +2942,12 @@ done
for ac_func in getrusage time sigaction __setfpucw
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2930: checking for $ac_func" >&5
+echo "configure:2946: 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 <<EOF
-#line 2935 "configure"
+#line 2951 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2954,7 +2970,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3127,12 +3143,12 @@ fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3131: checking return type of signal handlers" >&5
+echo "configure:3147: 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 <<EOF
-#line 3136 "configure"
+#line 3152 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3149,7 +3165,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -3168,6 +3184,30 @@ EOF
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:3189: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*
+fi
+
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+echo "$ac_t""${am_cv_exeext}" 1>&6
+
sim_link_files=
sim_link_links=
@@ -3298,14 +3338,14 @@ else
if test "x$cross_compiling" = "xno"; then
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3302: checking whether byte ordering is bigendian" >&5
+echo "configure:3342: 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 <<EOF
-#line 3309 "configure"
+#line 3349 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3316,11 +3356,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3360: \"$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 <<EOF
-#line 3324 "configure"
+#line 3364 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3331,7 +3371,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3351,7 +3391,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 <<EOF
-#line 3355 "configure"
+#line 3395 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3364,7 +3404,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -3414,7 +3454,6 @@ else
fi
-
# Ensure a reasonable default simulator is constructed: (DEPRECATED)
case "${target}" in
# start-sanitize-tx19
@@ -3435,10 +3474,16 @@ esac
# DEPRECATED
+#
+# Instead of defining a `subtarget' macro, code should be checking
+# the value of {STATE,CPU}_ARCHITECTURE to identify the architecture
+# in question.
+#
case "${target}" in
# start-sanitize-tx19
mipstx19*-*-*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
# end-sanitize-tx19
+ mips*tx39*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
*) SIM_SUBTARGET="";;
esac
@@ -3599,7 +3644,7 @@ case "${target}" in
# start-sanitize-tx19
mipstx19*-*-*) mips_fpu=SOFT_FLOATING_POINT ;;
# end-sanitize-tx19
- mipstx39*-*-*) mips_fpu=HARD_FLOATING_POINT
+ mips*tx39*) mips_fpu=HARD_FLOATING_POINT
mips_fpu_bitsize=32
;;
# start-sanitize-r5900
@@ -3691,7 +3736,7 @@ case "${target}" in
sim_m16_filter="16"
;;
# end-sanitize-tx19
- mipstx39*-*-*) sim_default_gen=IGEN
+ mipst*tx39*) sim_default_gen=IGEN
sim_use_gen=IGEN
sim_igen_filter="32,f"
sim_igen_machine="-M r3900"
@@ -3790,12 +3835,94 @@ esac
+
+# Add simulated hardware devices
+#
+
+sim_hardware="-DWITH_HW=1"
+sim_hw_obj="hw-device.o hw-ports.o hw-properties.o hw-base.o hw-tree.o sim-hw.o"
+hardware="core pal glue "
+# Check whether --enable-sim-hardware or --disable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then
+ enableval="$enable_sim_hardware"
+
+case "${enableval}" in
+ yes) ;;
+ no) hardware=""; sim_hardware="-DWITH_HW=0"; sim_hw_obj="";;
+ ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+ *,) hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+ *) hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
+esac
+sim_hw=""
+for i in x $hardware ; do
+ case " $f " in
+ x) ;;
+ *" $i "*) ;;
+ *) sim_hw="$sim_hw $i" ;;
+ esac
+done
+sim_hw_obj="$sim_hw_obj `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
+if test x"$silent" != x"yes" && test x"$hardware" != x""; then
+ echo "Setting hardware to $sim_hardware, $sim_hw, $sim_hw_obj"
+fi
+else
+
+sim_hw="$hardware"
+sim_hw_obj="$sim_hw_obj `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
+if test x"$silent" != x"yes"; then
+ echo "Setting hardware to $sim_hardware, $sim_hw, $sim_hw_obj"
+fi
+fi
+
+case "${target}" in
+# start-sanitize-tx3904
+ mips*tx39*)
+sim_hardware="-DWITH_HW=1"
+sim_hw_obj="hw-device.o hw-ports.o hw-properties.o hw-base.o hw-tree.o sim-hw.o"
+hardware="core pal glue tx3904cpu tx3904irc"
+# Check whether --enable-sim-hardware or --disable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then
+ enableval="$enable_sim_hardware"
+
+case "${enableval}" in
+ yes) ;;
+ no) hardware=""; sim_hardware="-DWITH_HW=0"; sim_hw_obj="";;
+ ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+ *,) hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+ *) hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
+esac
+sim_hw=""
+for i in x $hardware ; do
+ case " $f " in
+ x) ;;
+ *" $i "*) ;;
+ *) sim_hw="$sim_hw $i" ;;
+ esac
+done
+sim_hw_obj="$sim_hw_obj `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
+if test x"$silent" != x"yes" && test x"$hardware" != x""; then
+ echo "Setting hardware to $sim_hardware, $sim_hw, $sim_hw_obj"
+fi
+else
+
+sim_hw="$hardware"
+sim_hw_obj="$sim_hw_obj `echo $sim_hw | sed -e 's/\([^ ][^ ]*\)/dv-\1.o/g'`"
+if test x"$silent" != x"yes"; then
+ echo "Setting hardware to $sim_hardware, $sim_hw, $sim_hw_obj"
+fi
+fi
+ ;;
+# end-sanitize-tx3904
+ *) ;;
+esac
+
+
# If we find X, set shell vars x_includes and x_libraries to the
# paths, otherwise set no_x=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:3799: checking for X" >&5
+echo "configure:3926: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -3857,12 +3984,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 3861 "configure"
+#line 3988 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3931,14 +4058,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3935 "configure"
+#line 4062 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:3942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -4057,17 +4184,17 @@ for ac_hdr in string.h strings.h stdlib.h stdlib.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4061: checking for $ac_hdr" >&5
+echo "configure:4188: 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
-#line 4066 "configure"
+#line 4193 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4094,7 +4221,7 @@ fi
done
echo $ac_n "checking for fabs in -lm""... $ac_c" 1>&6
-echo "configure:4098: checking for fabs in -lm" >&5
+echo "configure:4225: checking for fabs in -lm" >&5
ac_lib_var=`echo m'_'fabs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4102,7 +4229,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4106 "configure"
+#line 4233 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4113,7 +4240,7 @@ int main() {
fabs()
; return 0; }
EOF
-if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4143,12 +4270,12 @@ fi
for ac_func in aint anint sqrt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4147: checking for $ac_func" >&5
+echo "configure:4274: 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 <<EOF
-#line 4152 "configure"
+#line 4279 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4171,7 +4298,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4402,6 +4529,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%@EXEEXT@%$EXEEXT%g
s%@SIMCONF@%$SIMCONF%g
s%@SIM_SUBTARGET@%$SIM_SUBTARGET%g
s%@sim_igen_flags@%$sim_igen_flags%g
diff --git a/sim/mips/configure.in b/sim/mips/configure.in
index aba2f2e..f5148e5 100644
--- a/sim/mips/configure.in
+++ b/sim/mips/configure.in
@@ -11,7 +11,6 @@ SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
SIM_AC_OPTION_HOSTENDIAN
SIM_AC_OPTION_WARNINGS
-
# Ensure a reasonable default simulator is constructed: (DEPRECATED)
case "${target}" in
# start-sanitize-tx19
@@ -41,7 +40,7 @@ case "${target}" in
# start-sanitize-tx19
mipstx19*-*-*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
# end-sanitize-tx19
- mipstx39*-*-*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
+ mips*tx39*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
*) SIM_SUBTARGET="";;
esac
AC_SUBST(SIM_SUBTARGET)
@@ -98,7 +97,7 @@ case "${target}" in
# start-sanitize-tx19
mipstx19*-*-*) mips_fpu=SOFT_FLOATING_POINT ;;
# end-sanitize-tx19
- mipstx39*-*-*) mips_fpu=HARD_FLOATING_POINT
+ mips*tx39*) mips_fpu=HARD_FLOATING_POINT
mips_fpu_bitsize=32
;;
# start-sanitize-r5900
@@ -144,7 +143,7 @@ case "${target}" in
sim_m16_filter="16"
;;
# end-sanitize-tx19
- mipstx39*-*-*) sim_default_gen=IGEN
+ mipst*tx39*) sim_default_gen=IGEN
sim_use_gen=IGEN
sim_igen_filter="32,f"
sim_igen_machine="-M r3900"
@@ -239,6 +238,18 @@ esac
AC_SUBST(mips_extra_objs)
+
+# Add simulated hardware devices
+#
+SIM_AC_OPTION_HARDWARE()
+case "${target}" in
+# start-sanitize-tx3904
+ mips*tx39*) SIM_AC_OPTION_HARDWARE(,tx3904cpu tx3904irc) ;;
+# end-sanitize-tx3904
+ *) ;;
+esac
+
+
AC_PATH_X
mips_extra_libs=""
# start-sanitize-sky
diff --git a/sim/mips/dv-tx3904cpu.c b/sim/mips/dv-tx3904cpu.c
new file mode 100644
index 0000000..f756f22
--- /dev/null
+++ b/sim/mips/dv-tx3904cpu.c
@@ -0,0 +1,230 @@
+/* This file is part of the program GDB, the GU debugger.
+
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ */
+
+
+#include "sim-main.h"
+#include "hw-base.h"
+
+/* DEVICE
+
+
+ tx3904cpu - tx3904 cpu virtual device
+
+
+ DESCRIPTION
+
+
+ Implements the external tx3904 functionality. This includes the
+ delivery of of interrupts generated from other devices and the
+ handling of device specific registers.
+
+
+ PROPERTIES
+
+ none
+
+
+ PORTS
+
+
+ reset (input)
+
+ Currently ignored.
+
+
+ nmi (input)
+
+ Deliver a non-maskable interrupt to the processor.
+
+
+ level (input)
+
+ Deliver a maskable interrupt of given level, corresponding to
+ IP[5:0], to processor.
+
+
+
+ BUGS
+
+
+ When delivering an interrupt, this code assumes that there is only
+ one processor (number 0).
+
+ This code does not attempt to be efficient at handling pending
+ interrupts. It simply schedules the interrupt delivery handler
+ every instruction cycle until all pending interrupts go away. An
+ alternative implementation might modify instructions that change
+ the PSW and have them check to see if the change makes an interrupt
+ delivery possible.
+
+ */
+
+
+
+struct tx3904cpu {
+ /* Pending interrupts for delivery by event handler */
+ int pending_reset, pending_nmi, pending_level;
+};
+
+
+
+/* input port ID's */
+
+enum {
+ RESET_PORT,
+ NMI_PORT,
+ LEVEL_PORT,
+};
+
+
+static const struct hw_port_descriptor tx3904cpu_ports[] = {
+
+ /* interrupt inputs */
+ { "reset", RESET_PORT, 0, input_port, },
+ { "nmi", NMI_PORT, 0, input_port, },
+ { "level", LEVEL_PORT, 0, input_port, },
+
+ { NULL, },
+};
+
+
+/* Finish off the partially created hw device. Attach our local
+ callbacks. Wire up our port names etc */
+
+static hw_port_event_callback tx3904cpu_port_event;
+
+
+
+static void
+tx3904cpu_finish (struct hw *me)
+{
+ struct tx3904cpu *controller;
+
+ controller = HW_ZALLOC (me, struct tx3904cpu);
+ set_hw_data (me, controller);
+ set_hw_ports (me, tx3904cpu_ports);
+ set_hw_port_event (me, tx3904cpu_port_event);
+
+ /* Initialize the pending interrupt flags */
+ controller->pending_level = 0;
+ controller->pending_reset = 0;
+ controller->pending_nmi = 0;
+}
+
+
+
+/* An event arrives on an interrupt port */
+
+static void
+deliver_tx3904cpu_interrupt (struct hw *me,
+ void *data)
+{
+ struct tx3904cpu *controller = hw_data (me);
+ SIM_DESC simulator = hw_system (me);
+ sim_cpu *cpu = STATE_CPU (simulator, 0); /* NB: fix CPU 0. */
+ address_word cia = CIA_GET (cpu);
+
+#define CPU cpu
+#define SD current_state
+
+ if (controller->pending_reset)
+ {
+ controller->pending_reset = 0;
+ HW_TRACE ((me, "reset pc=0x%08lx", (long) CIA_GET (cpu)));
+ SignalExceptionNMIReset();
+ }
+ else if (controller->pending_nmi)
+ {
+ controller->pending_nmi = 0;
+ HW_TRACE ((me, "nmi pc=0x%08lx", (long) CIA_GET (cpu)));
+ SignalExceptionNMIReset();
+ }
+ else if (controller->pending_level)
+ {
+ HW_TRACE ((me, "interrupt level=%d pc=0x%08lx sr=0x%08lx",
+ controller->pending_level,
+ (long) CIA_GET (cpu), (long) SR));
+
+ /* Don't overwrite the CAUSE field since we have no good place to clear
+ it again. The specs allow it to be zero by the time the interrupt
+ handler is invoked. */
+ /* CAUSE &= ~ (cause_IP_mask << cause_IP_shift);
+ CAUSE |= (controller->pending_level & cause_IP_mask) << cause_IP_shift; */
+
+ /* check for enabled / unmasked interrupts */
+ if((SR & status_IEc) &&
+ (controller->pending_level & ((SR >> status_IM_shift) & status_IM_mask)))
+ {
+ controller->pending_level = 0;
+ SignalExceptionInterrupt();
+ }
+ else
+ {
+ /* reschedule soon */
+ hw_event_queue_schedule (me, 1, deliver_tx3904cpu_interrupt, NULL);
+ }
+ }
+#undef CPU cpu
+#undef SD current_state
+}
+
+
+static void
+tx3904cpu_port_event (struct hw *me,
+ int my_port,
+ struct hw *source,
+ int source_port,
+ int level)
+{
+ struct tx3904cpu *controller = hw_data (me);
+
+ switch (my_port)
+ {
+ case RESET_PORT:
+ controller->pending_reset = 1;
+ HW_TRACE ((me, "port-in reset"));
+ break;
+
+ case NMI_PORT:
+ controller->pending_nmi = 1;
+ HW_TRACE ((me, "port-in nmi"));
+ break;
+
+ case LEVEL_PORT:
+ controller->pending_level |= level; /* accumulate bits until they are cleared */
+ HW_TRACE ((me, "port-in level=%d", level));
+ break;
+
+ default:
+ hw_abort (me, "bad switch");
+ break;
+ }
+
+ /* Schedule an event to be delivered immediately after current
+ instruction. */
+ hw_event_queue_schedule (me, 0, deliver_tx3904cpu_interrupt, NULL);
+}
+
+
+const struct hw_device_descriptor dv_tx3904cpu_descriptor[] = {
+ { "tx3904cpu", tx3904cpu_finish, },
+ { NULL },
+};
diff --git a/sim/mips/dv-tx3904irc.c b/sim/mips/dv-tx3904irc.c
new file mode 100644
index 0000000..f11f4c0
--- /dev/null
+++ b/sim/mips/dv-tx3904irc.c
@@ -0,0 +1,392 @@
+/* This file is part of the program GDB, the GNU debugger.
+
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ */
+
+
+#include "sim-main.h"
+#include "hw-base.h"
+
+
+/* DEVICE
+
+
+ tx3904irc - tx3904 interrupt controller
+
+
+ DESCRIPTION
+
+
+ Implements the tx3904 interrupt controller described in the tx3904
+ user guide. It does not include the interrupt detection circuit
+ that preprocesses the eight external interrupts.
+
+
+ PROPERTIES
+
+
+ reg <base> <length>
+
+ Base of IRC control register bank. <length> must equal 0x20.
+ Registers offsets: 0: ISR: interrupt status register
+ 4: IMR: interrupt mask register
+ 16: ILR0: interrupt level register 3..0
+ 20: ILR1: interrupt level register 7..4
+ 24: ILR2: interrupt level register 11..8
+ 28: ILR3: interrupt level register 15..12
+
+
+
+ PORTS
+
+
+ ip (output)
+
+ Interrupt priority port. An event is generated when an interrupt
+ of a sufficient priority is passed through the IRC. The value
+ associated with the event is the interrupt level (16-31), as given
+ for bits IP[5:0] in the book TMPR3904F Rev. 2.0, pg. 11-3. Note
+ that even though INT[0] is tied externally to IP[5], we simulate
+ it as passing through the controller.
+
+
+ int0-7 (input)
+
+ External interrupts.
+
+
+ dmac0-3 (input)
+
+ DMA internal interrupts, correspond to DMA channels 0-3.
+
+
+ sio0-1 (input)
+
+ SIO internal interrupts.
+
+
+ tmr0-2 (input)
+
+ Timer internal interrupts.
+
+ */
+
+
+
+/* port ID's */
+
+enum {
+ /* inputs, ordered to correspond to interrupt sources 0..15 */
+ INT1_PORT = 0, INT2_PORT, INT3_PORT, INT4_PORT, INT5_PORT, INT6_PORT, INT7_PORT,
+ DMAC3_PORT, DMAC2_PORT, DMAC1_PORT, DMAC0_PORT, SIO0_PORT, SIO1_PORT,
+ TMR0_PORT, TMR1_PORT, TMR2_PORT,
+
+ /* special INT[0] port */
+ INT0_PORT,
+
+ /* reset */
+ RESET_PORT,
+
+ /* output */
+ IP_PORT
+};
+
+
+/* register numbers; each is one word long */
+enum {
+ ISR_REG = 0,
+ IMR_REG = 1,
+ ILR0_REG = 4,
+ ILR1_REG = 5,
+ ILR2_REG = 6,
+ ILR3_REG = 7,
+};
+
+
+
+static const struct hw_port_descriptor tx3904irc_ports[] = {
+
+ /* interrupt output */
+
+ { "ip", IP_PORT, 0, output_port, },
+
+ /* interrupt inputs (as names) */
+ /* in increasing order of level number */
+
+ { "int1", INT1_PORT, 0, input_port, },
+ { "int2", INT2_PORT, 0, input_port, },
+ { "int3", INT3_PORT, 0, input_port, },
+ { "int4", INT4_PORT, 0, input_port, },
+ { "int5", INT5_PORT, 0, input_port, },
+ { "int6", INT6_PORT, 0, input_port, },
+ { "int7", INT7_PORT, 0, input_port, },
+
+ { "dmac3", DMAC3_PORT, 0, input_port, },
+ { "dmac2", DMAC2_PORT, 0, input_port, },
+ { "dmac1", DMAC1_PORT, 0, input_port, },
+ { "dmac0", DMAC0_PORT, 0, input_port, },
+
+ { "sio0", SIO0_PORT, 0, input_port, },
+ { "sio1", SIO1_PORT, 0, input_port, },
+
+ { "tmr0", TMR0_PORT, 0, input_port, },
+ { "tmr1", TMR1_PORT, 0, input_port, },
+ { "tmr2", TMR2_PORT, 0, input_port, },
+
+ { "reset", RESET_PORT, 0, input_port, },
+ { "int0", INT0_PORT, 0, input_port, },
+
+ { NULL, },
+};
+
+
+#define NR_SOURCES (TMR3_PORT - INT1_PORT + 1) /* 16: number of interrupt sources */
+
+
+/* The interrupt controller register internal state. Note that we
+ store state using the control register images, in host endian
+ order. */
+
+struct tx3904irc {
+ address_word base_address; /* control register base */
+ unsigned_4 isr;
+#define ISR_SET(c,s) ((c)->isr &= ~ (1 << (s)))
+ unsigned_4 imr;
+#define IMR_GET(c) ((c)->imr)
+ unsigned_4 ilr[4];
+#define ILR_GET(c,s) LSEXTRACTED32((c)->ilr[(s)/4], (s) % 4 * 8 + 2, (s) % 4 * 8)
+};
+
+
+
+/* Finish off the partially created hw device. Attach our local
+ callbacks. Wire up our port names etc */
+
+static hw_io_read_buffer_callback tx3904irc_io_read_buffer;
+static hw_io_write_buffer_callback tx3904irc_io_write_buffer;
+static hw_port_event_callback tx3904irc_port_event;
+
+static void
+attach_tx3904irc_regs (struct hw *me,
+ struct tx3904irc *controller)
+{
+ unsigned_word attach_address;
+ int attach_space;
+ unsigned attach_size;
+ reg_property_spec reg;
+
+ if (hw_find_property (me, "reg") == NULL)
+ hw_abort (me, "Missing \"reg\" property");
+
+ if (!hw_find_reg_array_property (me, "reg", 0, &reg))
+ hw_abort (me, "\"reg\" property must contain one addr/size entry");
+
+ hw_unit_address_to_attach_address (hw_parent (me),
+ &reg.address,
+ &attach_space,
+ &attach_address,
+ me);
+ hw_unit_size_to_attach_size (hw_parent (me),
+ &reg.size,
+ &attach_size, me);
+
+ hw_attach_address (hw_parent (me), 0,
+ attach_space, attach_address, attach_size,
+ me);
+
+ controller->base_address = attach_address;
+}
+
+
+static void
+tx3904irc_finish (struct hw *me)
+{
+ int i;
+ struct tx3904irc *controller;
+
+ controller = HW_ZALLOC (me, struct tx3904irc);
+ set_hw_data (me, controller);
+ set_hw_io_read_buffer (me, tx3904irc_io_read_buffer);
+ set_hw_io_write_buffer (me, tx3904irc_io_write_buffer);
+ set_hw_ports (me, tx3904irc_ports);
+ set_hw_port_event (me, tx3904irc_port_event);
+
+ /* Attach ourself to our parent bus */
+ attach_tx3904irc_regs (me, controller);
+
+ /* Initialize to reset state */
+ controller->isr = 0x0000ffff;
+ controller->imr = 0;
+ controller->ilr[0] =
+ controller->ilr[1] =
+ controller->ilr[2] =
+ controller->ilr[3] = 0;
+}
+
+
+
+/* An event arrives on an interrupt port */
+
+static void
+tx3904irc_port_event (struct hw *me,
+ int my_port,
+ struct hw *source,
+ int source_port,
+ int level)
+{
+ struct tx3904irc *controller = hw_data (me);
+
+ switch (my_port)
+ {
+ case INT0_PORT:
+ {
+ int ip_number = 32; /* compute IP[5:0] */
+ HW_TRACE ((me, "port-event INT[0]"));
+ hw_port_event(me, IP_PORT, ip_number);
+ break;
+ }
+
+ case INT1_PORT: case INT2_PORT: case INT3_PORT: case INT4_PORT:
+ case INT5_PORT: case INT6_PORT: case INT7_PORT: case DMAC3_PORT:
+ case DMAC2_PORT: case DMAC1_PORT: case DMAC0_PORT: case SIO0_PORT:
+ case SIO1_PORT: case TMR0_PORT: case TMR1_PORT: case TMR2_PORT:
+ {
+ int source = my_port - INT1_PORT;
+
+ HW_TRACE ((me, "port-event interrupt source %d", source));
+ ISR_SET(controller, source);
+ if(ILR_GET(controller, source) > IMR_GET(controller))
+ {
+ int ip_number = 16 + source; /* compute IP[4:0] */
+ HW_TRACE ((me, "interrupt level %d", ILR_GET(controller,source)));
+ hw_port_event(me, IP_PORT, ip_number);
+ }
+ break;
+ }
+
+ case RESET_PORT:
+ {
+ HW_TRACE ((me, "reset"));
+ controller->isr = 0x0000ffff;
+ controller->imr = 0;
+ controller->ilr[0] =
+ controller->ilr[1] =
+ controller->ilr[2] =
+ controller->ilr[3] = 0;
+ break;
+ }
+
+ case IP_PORT:
+ hw_abort (me, "Event on output port %d", my_port);
+ break;
+
+ default:
+ hw_abort (me, "Event on unknown port %d", my_port);
+ break;
+ }
+}
+
+
+/* generic read/write */
+
+static unsigned
+tx3904irc_io_read_buffer (struct hw *me,
+ void *dest,
+ int space,
+ unsigned_word base,
+ unsigned nr_bytes)
+{
+ struct tx3904irc *controller = hw_data (me);
+ unsigned byte;
+
+ HW_TRACE ((me, "read 0x%08lx %d", (long) base, (int) nr_bytes));
+ for (byte = 0; byte < nr_bytes; byte++)
+ {
+ address_word address = base + byte;
+ int reg_number = (address - controller->base_address) / 4;
+ int reg_offset = (address - controller->base_address) % 4;
+ unsigned_4 register_value; /* in target byte order */
+
+ /* fill in entire register_value word */
+ switch (reg_number)
+ {
+ case ISR_REG: register_value = controller->isr; break;
+ case IMR_REG: register_value = controller->imr; break;
+ case ILR0_REG: register_value = controller->ilr[0]; break;
+ case ILR1_REG: register_value = controller->ilr[1]; break;
+ case ILR2_REG: register_value = controller->ilr[2]; break;
+ case ILR3_REG: register_value = controller->ilr[3]; break;
+ default: register_value = 0;
+ }
+
+ /* write requested byte out */
+ memcpy(dest+byte, ((char*)& register_value)+reg_offset, 1);
+ }
+
+ return nr_bytes;
+}
+
+
+
+static unsigned
+tx3904irc_io_write_buffer (struct hw *me,
+ const void *source,
+ int space,
+ unsigned_word base,
+ unsigned nr_bytes)
+{
+ struct tx3904irc *controller = hw_data (me);
+ unsigned byte;
+
+ HW_TRACE ((me, "write 0x%08lx %d", (long) base, (int) nr_bytes));
+ for (byte = 0; byte < nr_bytes; byte++)
+ {
+ address_word address = base + byte;
+ int reg_number = (address - controller->base_address) / 4;
+ int reg_offset = (address - controller->base_address) % 4;
+ unsigned_4* register_ptr;
+ unsigned_4 register_value;
+
+ /* fill in entire register_value word */
+ switch (reg_number)
+ {
+ case ISR_REG: register_ptr = & controller->isr; break;
+ case IMR_REG: register_ptr = & controller->imr; break;
+ case ILR0_REG: register_ptr = & controller->ilr[0]; break;
+ case ILR1_REG: register_ptr = & controller->ilr[1]; break;
+ case ILR2_REG: register_ptr = & controller->ilr[2]; break;
+ case ILR3_REG: register_ptr = & controller->ilr[3]; break;
+ default: register_ptr = & register_value; /* used as a dummy */
+ }
+
+ HW_TRACE ((me, "reg %d pre: %08lx", reg_number, (long) *register_ptr));
+
+ /* overwrite requested byte */
+ memcpy(((char*)register_ptr)+reg_offset, source+byte, 1);
+
+ HW_TRACE ((me, "post: %08lx", (long) *register_ptr));
+ }
+ return nr_bytes;
+}
+
+
+const struct hw_device_descriptor dv_tx3904irc_descriptor[] = {
+ { "tx3904irc", tx3904irc_finish, },
+ { NULL },
+};
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index ff1252d..f83fdc3 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -37,6 +37,7 @@ code on the hardware.
#include "sim-utils.h"
#include "sim-options.h"
#include "sim-assert.h"
+#include "sim-hw.h"
/* start-sanitize-sky */
#ifdef TARGET_SKY
@@ -113,6 +114,7 @@ char* pr_uword64 PARAMS ((uword64 addr));
halt is required. NOTE: Care must be taken, since this value may
be used in later revisions of the MIPS ISA. */
#define HALT_INSTRUCTION (0x03ff000d)
+#define HALT_INSTRUCTION2 (0x0000ffcd)
#define HALT_INSTRUCTION_MASK (0x03FFFFC0)
@@ -180,6 +182,10 @@ FILE *tracefh = NULL;
static void open_trace PARAMS((SIM_DESC sd));
#endif /* TRACE */
+/* simulation target board. NULL=canonical */
+static char* board = NULL;
+
+
static DECLARE_OPTION_HANDLER (mips_option_handler);
enum {
@@ -195,8 +201,10 @@ enum {
,OPTION_GS_REFRESH2
#endif
/* end-sanitize-sky */
+ ,OPTION_BOARD
};
+
static SIM_RC
mips_option_handler (sd, cpu, opt, arg, is_command)
SIM_DESC sd;
@@ -265,10 +273,10 @@ Re-compile simulator with \"-DTRACE\" to enable this option.\n");
#ifdef SKY_FUNIT
case OPTION_FLOAT_TYPE:
/* Use host (fast) or target (accurate) floating point implementation. */
- if (arg && strcmp (arg, "host") == 0)
- STATE_FP_TYPE_OPT (sd) &= ~STATE_FP_TYPE_OPT_TARGET;
- else if (arg && strcmp (arg, "target") == 0)
- STATE_FP_TYPE_OPT (sd) |= STATE_FP_TYPE_OPT_TARGET;
+ if (arg && strcmp (arg, "fast") == 0)
+ STATE_FP_TYPE_OPT (sd) &= ~STATE_FP_TYPE_OPT_ACCURATE;
+ else if (arg && strcmp (arg, "accurate") == 0)
+ STATE_FP_TYPE_OPT (sd) |= STATE_FP_TYPE_OPT_ACCURATE;
else
{
fprintf (stderr, "Unrecognized float-type option `%s'\n", arg);
@@ -318,11 +326,22 @@ Re-compile simulator with \"-DTRACE\" to enable this option.\n");
#endif
/* end-sanitize-sky */
+
+ case OPTION_BOARD:
+ {
+ if (arg)
+ {
+ board = zalloc(strlen(arg) + 1);
+ strcpy(board, arg);
+ }
+ return SIM_RC_OK;
+ }
}
-
+
return SIM_RC_OK;
}
+
static const OPTION mips_options[] =
{
{ {"dinero-trace", optional_argument, NULL, OPTION_DINERO_TRACE},
@@ -335,7 +354,7 @@ static const OPTION mips_options[] =
#ifdef TARGET_SKY
#ifdef SKY_FUNIT
{ {"float-type", required_argument, NULL, OPTION_FLOAT_TYPE},
- '\0', "host|target", "Use host (fast) or target (accurate) floating point",
+ '\0', "fast|accurate", "Use fast (host) or accurate (target) floating point",
mips_option_handler },
#endif
{ {"enable-gs", required_argument, NULL, OPTION_GS_ENABLE},
@@ -349,6 +368,19 @@ static const OPTION mips_options[] =
mips_option_handler },
#endif
/* end-sanitize-sky */
+
+ { {"board", required_argument, NULL, OPTION_BOARD},
+ '\0', "none" /* rely on compile-time string concatenation for other options */
+
+/* start-sanitize-tx3904 */
+#define BOARD_JMR3904 "jmr3904"
+ "|" BOARD_JMR3904
+#define BOARD_JMR3904_DEBUG "jmr3904debug"
+ "|" BOARD_JMR3904_DEBUG
+/* end-sanitize-tx3904 */
+
+ , "Customize simulation for a particular board.", mips_option_handler },
+
{ {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
};
@@ -359,6 +391,7 @@ static void
interrupt_event (SIM_DESC sd, void *data)
{
sim_cpu *cpu = STATE_CPU (sd, 0); /* FIXME */
+ address_word cia = CIA_GET (cpu);
if (SR & status_IE)
{
interrupt_pending = 0;
@@ -397,8 +430,8 @@ sim_open (kind, cb, abfd, argv)
/* start-sanitize-sky */
#if defined(TARGET_SKY) && defined(SKY_FUNIT)
- /* Set "--float-type host" as the default. */
- STATE_FP_TYPE_OPT (sd) &= ~STATE_FP_TYPE_OPT_TARGET;
+ /* Set "--float-type fast" as the default. */
+ STATE_FP_TYPE_OPT (sd) &= ~STATE_FP_TYPE_OPT_ACCURATE;
#endif
/* end-sanitize-sky */
@@ -413,33 +446,6 @@ sim_open (kind, cb, abfd, argv)
return 0;
sim_add_option_table (sd, NULL, mips_options);
- /* Allocate core managed memory */
-
- /* the monitor */
- sim_do_commandf (sd, "memory region 0x%lx,0x%lx", MONITOR_BASE, MONITOR_SIZE);
- /* For compatibility with the old code - under this (at level one)
- are the kernel spaces K0 & K1. Both of these map to a single
- smaller sub region */
- sim_do_command(sd," memory region 0x7fff8000,0x8000") ; /* MTZ- 32 k stack */
-/* start-sanitize-sky */
-#ifndef TARGET_SKY
-/* end-sanitize-sky */
- sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx%%0x%lx,0x%0x",
- K1BASE, K0SIZE,
- MEM_SIZE, /* actual size */
- K0BASE);
-/* start-sanitize-sky */
-#else
- sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx%%0x%lx,0x%0x,0x%0x",
- K1BASE, K0SIZE,
- MEM_SIZE, /* actual size */
- K0BASE,
- 0); /* add alias at 0x0000 */
-#endif
-/* end-sanitize-sky */
-
- device_init(sd);
-
/* getopt will print the error message so we just have to exit if this fails.
FIXME: Hmmm... in the case of gdb we need getopt to call
print_filtered. */
@@ -451,6 +457,99 @@ sim_open (kind, cb, abfd, argv)
return 0;
}
+ /* handle board-specific memory maps */
+ if (board == NULL)
+ {
+ /* Allocate core managed memory */
+
+ /* the monitor */
+ sim_do_commandf (sd, "memory region 0x%lx,0x%lx", MONITOR_BASE, MONITOR_SIZE);
+ /* For compatibility with the old code - under this (at level one)
+ are the kernel spaces K0 & K1. Both of these map to a single
+ smaller sub region */
+ sim_do_command(sd," memory region 0x7fff8000,0x8000") ; /* MTZ- 32 k stack */
+ /* start-sanitize-sky */
+#ifndef TARGET_SKY
+ /* end-sanitize-sky */
+ sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx%%0x%lx,0x%0x",
+ K1BASE, K0SIZE,
+ MEM_SIZE, /* actual size */
+ K0BASE);
+ /* start-sanitize-sky */
+#else
+ sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx%%0x%lx,0x%0x,0x%0x",
+ K1BASE, K0SIZE,
+ MEM_SIZE, /* actual size */
+ K0BASE,
+ 0); /* add alias at 0x0000 */
+#endif
+ /* end-sanitize-sky */
+
+ device_init(sd);
+ }
+
+ /* start-sanitize-tx3904 */
+ else if(! strcmp(board, BOARD_JMR3904) ||
+ (! strcmp(board, BOARD_JMR3904_DEBUG)))
+ {
+ /* match VIRTUAL memory layout of JMR-TX3904 board */
+
+ /* --- memory --- */
+
+ /* ROM: 0x9FC0_0000 - 0x9FFF_FFFF and 0xBFC0_0000 - 0xBFFF_FFFF */
+ sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+ 0x9FC00000,
+ 4 * 1024 * 1024, /* 4 MB */
+ 0xBFC00000);
+
+ /* SRAM: 0x8000_0000 - 0x803F_FFFF and 0xA000_0000 - 0xA03F_FFFF */
+ sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+ 0x80000000,
+ 4 * 1024 * 1024, /* 4 MB */
+ 0xA0000000);
+
+ /* DRAM: 0x8800_0000 - 0x89FF_FFFF and 0xA800_0000 - 0xA9FF_FFFF */
+ sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+ 0x88000000,
+ 32 * 1024 * 1024, /* 32 MB */
+ 0xA8000000);
+
+ /* --- simulated devices --- */
+ sim_hw_parse (sd, "/tx3904irc@0xffffc00/reg 0xffffc000 0x20");
+ sim_hw_parse (sd, "/tx3904cpu");
+
+ /* -- device connections --- */
+ sim_hw_parse (sd, "/tx3904irc > ip level /tx3904cpu");
+
+ if(! strcmp(board, BOARD_JMR3904_DEBUG))
+ {
+ /* -- DEBUG: glue interrupt generators --- */
+ sim_hw_parse (sd, "/glue@0xffff0000/reg 0xffff0000 0x50");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int0 int0 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int1 int1 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int2 int2 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int3 int3 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int4 int4 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int5 int5 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int6 int6 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int7 int7 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int8 dmac0 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int9 dmac1 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int10 dmac2 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int11 dmac3 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int12 sio0 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int13 sio1 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int14 tmr0 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int15 tmr1 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int16 tmr2 /tx3904irc");
+ sim_hw_parse (sd, "/glue@0xffff0000 > int17 nmi /tx3904cpu");
+ }
+
+ device_init(sd);
+ }
+ /* end-sanitize-tx3904 */
+
+
/* check for/establish the a reference program image */
if (sim_analyze_program (sd,
(STATE_PROG_ARGV (sd) != NULL
@@ -1275,7 +1374,7 @@ sim_monitor (SIM_DESC sd,
int width = 0, trunc = 0, haddot = 0, longlong = 0;
while (sim_read (sd, s++, &c, 1) && c != '\0')
{
- if (strchr ("dobxXulscefg%", s))
+ if (strchr ("dobxXulscefg%", c))
break;
else if (c == '-')
fmt = FMT_LJUST;
@@ -1622,7 +1721,7 @@ ColdReset (SIM_DESC sd)
{
sim_cpu *cpu = STATE_CPU (sd, cpu_nr);
/* RESET: Fixed PC address: */
- PC = UNSIGNED64 (0xFFFFFFFFBFC00000);
+ PC = (unsigned_word) UNSIGNED64 (0xFFFFFFFFBFC00000);
/* The reset vector address is in the unmapped, uncached memory space. */
SR &= ~(status_SR | status_TS | status_RP);
@@ -1760,8 +1859,8 @@ signal_exception (SIM_DESC sd,
instruction = va_arg(ap,unsigned int);
va_end(ap);
/* Check for our special terminating BREAK: */
- if ((instruction & HALT_INSTRUCTION_MASK)
- == (HALT_INSTRUCTION & HALT_INSTRUCTION_MASK))
+ if ((instruction & HALT_INSTRUCTION_MASK) == (HALT_INSTRUCTION & HALT_INSTRUCTION_MASK) ||
+ (instruction & HALT_INSTRUCTION_MASK) == (HALT_INSTRUCTION2 & HALT_INSTRUCTION_MASK))
{
sim_engine_halt (SD, CPU, NULL, cia,
sim_exited, (unsigned int)(A0 & 0xFFFFFFFF));
@@ -1781,6 +1880,28 @@ signal_exception (SIM_DESC sd,
/* TODO: If not simulating exceptions then stop the simulator
execution. At the moment we always stop the simulation. */
+#ifdef SUBTARGET_R3900
+ /* update interrupt-related registers */
+
+ /* insert exception code in bits 6:2 */
+ CAUSE = LSMASKED32(CAUSE, 31, 7) | LSINSERTED32(exception, 6, 2);
+ /* shift IE/KU history bits left */
+ SR = LSMASKED32(SR, 31, 4) | LSINSERTED32(LSEXTRACTED32(SR, 3, 0), 5, 2);
+
+ if (STATE & simDELAYSLOT)
+ {
+ STATE &= ~simDELAYSLOT;
+ CAUSE |= cause_BD;
+ EPC = (cia - 4); /* reference the branch instruction */
+ }
+ else
+ EPC = cia;
+
+ if (SR & status_BEV)
+ PC = (signed)0xBFC00000 + 0x180;
+ else
+ PC = (signed)0x80000000 + 0x080;
+#else
/* See figure 5-17 for an outline of the code below */
if (! (SR & status_EXL))
{
@@ -1804,10 +1925,12 @@ signal_exception (SIM_DESC sd,
SR |= status_EXL;
/* Store exception code into current exception id variable (used
by exit code): */
+
if (SR & status_BEV)
PC = (signed)0xBFC00200 + 0x180;
else
PC = (signed)0x80000000 + 0x180;
+#endif
switch ((CAUSE >> 2) & 0x1F)
{
@@ -1815,7 +1938,15 @@ signal_exception (SIM_DESC sd,
/* Interrupts arrive during event processing, no need to
restart */
return;
-
+
+ case NMIReset:
+ /* Ditto */
+#ifdef SUBTARGET_3900
+ /* Exception vector: BEV=0 BFC00000 / BEF=1 BFC00000 */
+ PC = (signed)0xBFC00000;
+#endif SUBTARGET_3900
+ return;
+
case TLBModification:
case TLBLoad:
case TLBStore:
@@ -3304,6 +3435,14 @@ decode_coproc (SIM_DESC sd,
else if (code == 0x10 && (instruction & 0x3f) == 0x10)
{
/* RFE */
+#ifdef SUBTARGET_R3900
+ /* TX39: Copy IEp/KUp -> IEc/KUc, and IEo/KUo -> IEp/KUp */
+
+ /* shift IE/KU history bits right */
+ SR = LSMASKED32(SR, 31, 4) | LSINSERTED32(LSEXTRACTED32(SR, 5, 2), 3, 0);
+
+ /* TODO: CACHE register */
+#endif /* SUBTARGET_R3900 */
}
else if (code == 0x10 && (instruction & 0x3f) == 0x1F)
{
diff --git a/sim/mips/mips.igen b/sim/mips/mips.igen
index 303de9d..a1f254c 100644
--- a/sim/mips/mips.igen
+++ b/sim/mips/mips.igen
@@ -124,6 +124,17 @@
}
:function:::int:check_mt_hilo:hilo_history *history
+*mipsI,mipsII,mipsIII,mipsIV:
+*vr5000:
+// start-sanitize-vr4320
+*vr4320:
+// end-sanitize-vr4320
+// start-sanitize-vr5400
+*vr5400:
+// end-sanitize-vr5400
+// start-sanitize-r5900
+*r5900:
+// end-sanitize-r5900
{
signed64 time = sim_events_time (SD);
int ok = check_mf_cycles (SD_, history, time, "MT");
@@ -132,6 +143,18 @@
return ok;
}
+:function:::int:check_mt_hilo:hilo_history *history
+*r3900:
+// start-sanitize-tx19
+*tx19:
+// end-sanitize-tx19
+{
+ signed64 time = sim_events_time (SD);
+ history->mt.timestamp = time;
+ history->mt.cia = CIA;
+ return 1;
+}
+
:function:::int:check_mf_hilo:hilo_history *history, hilo_history *peer
{
signed64 time = sim_events_time (SD);
@@ -5351,6 +5374,7 @@
010000,00000,5.RT,5.RD,00000,6.REGX:COP0:32::MFC0
"mfc0 r<RT>, r<RD> # <REGX>"
*mipsI,mipsII,mipsIII,mipsIV:
+*r3900:
*vr5000:
// start-sanitize-vr4320
*vr4320:
@@ -5389,6 +5413,28 @@
}
+010000,10000,000000000000000,010000:COP0:32::RFE
+"rfe"
+*mipsI,mipsII,mipsIII,mipsIV:
+// start-sanitize-tx19
+*tx19:
+// end-sanitize-tx19
+*r3900:
+// start-sanitize-vr4320
+*vr4320:
+// end-sanitize-vr4320
+*vr5000:
+// start-sanitize-vr5400
+*vr5400:
+// end-sanitize-vr5400
+// start-sanitize-r5900
+*r5900:
+// end-sanitize-r5900
+{
+ DecodeCoproc (instruction_0);
+}
+
+
010000,10000,000000000000000,001000:COP0:32::TLBP
"tlbp"
*mipsI,mipsII,mipsIII,mipsIV:
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index 690ea81..295b127 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -561,7 +561,6 @@ struct _sim_cpu {
/* start-sanitize-sky */
#ifdef TARGET_SKY
#ifndef TM_TXVU_H
-
/* Number of machine registers */
#define NUM_VU_REGS 153
#define NUM_VU_INTEGER_REGS 16
@@ -574,7 +573,8 @@ struct _sim_cpu {
#undef NUM_REGS
#define NUM_REGS (NUM_R5900_REGS + 2*(NUM_VU_REGS) + 2*(NUM_VIF_REGS))
#endif /* no tm-txvu.h */
-#endif
+#endif /* TARGET_SKY */
+/* end-sanitize-sky */
enum float_operation
/* start-sanitize-sky */
@@ -665,7 +665,6 @@ enum float_operation
hilo_history lo_history;
#define LOHISTORY (&(CPU)->lo_history)
-
/* start-sanitize-r5900 */
sim_r5900_cpu r5900;
@@ -675,7 +674,13 @@ enum float_operation
/* The MDMX ISA has a very very large accumulator */
unsigned8 acc[3 * 8];
/* end-sanitize-vr5400 */
+ /* start-sanitize-sky */
+#ifdef TARGET_SKY
+ /* Device on which instruction issue last occured. */
+ char cur_device;
+#endif
+ /* end-sanitize-sky */
sim_cpu_base base;
};
@@ -709,7 +714,7 @@ struct sim_state {
/* Record of option for floating point implementation type. */
int fp_type_opt;
#define STATE_FP_TYPE_OPT(sd) ((sd)->fp_type_opt)
-#define STATE_FP_TYPE_OPT_TARGET 0x80000000
+#define STATE_FP_TYPE_OPT_ACCURATE 0x80000000
#endif
#endif
/* end-sanitize-sky */
@@ -746,7 +751,29 @@ struct sim_state {
#define status_CU2 (1 << 30) /* COP2 usable */
/* end-sanitize-r5900 */
-#define cause_BD ((unsigned)1 << 31) /* Exception in branch delay slot */
+/* Specializations for TX39 family */
+#define status_IEc (1 << 0) /* Interrupt enable (current) */
+#define status_KUc (1 << 1) /* Kernel/User mode */
+#define status_IEp (1 << 2) /* Interrupt enable (previous) */
+#define status_KUp (1 << 3) /* Kernel/User mode */
+#define status_IEo (1 << 4) /* Interrupt enable (old) */
+#define status_KUo (1 << 5) /* Kernel/User mode */
+#define status_IM_mask (0xff) /* Interrupt mask */
+#define status_IM_shift (8)
+#define status_NMI (1 << 20) /* NMI */
+#define status_NMI (1 << 20) /* NMI */
+
+#define cause_EXC_mask (0x1f) /* Exception code */
+#define cause_EXC_shift (2)
+#define cause_SW0 (1 << 8) /* Software interrupt 0 */
+#define cause_SW1 (1 << 9) /* Software interrupt 1 */
+#define cause_IP_mask (0x3f) /* Interrupt pending field */
+#define cause_IP_shift (10)
+#define cause_CE_mask (0x3) /* Coprocessor error */
+#define cause_CE_shift (28)
+
+#define cause_BD ((unsigned)1 << 31) /* Exception in branch delay slot */
+
/* NOTE: We keep the following status flags as bit values (1 for true,
0 for false). This allows them to be used in binary boolean
@@ -754,7 +781,11 @@ struct sim_state {
value is. */
/* UserMode */
+#ifdef SUBTARGET_R3900
+#define UserMode ((SR & status_KUc) ? 1 : 0)
+#else
#define UserMode ((((SR & status_KSU_mask) >> status_KSU_shift) == ksu_user) ? 1 : 0)
+#endif /* SUBTARGET_R3900 */
/* BigEndianMem */
/* Hardware configuration. Affects endianness of LoadMemory and
@@ -799,6 +830,8 @@ struct sim_state {
#define FPE (15)
#define DebugBreakPoint (16)
#define Watch (23)
+#define NMIReset (31)
+
/* The following exception code is actually private to the simulator
world. It is *NOT* a processor feature, and is used to signal
@@ -807,7 +840,7 @@ struct sim_state {
void signal_exception (SIM_DESC sd, sim_cpu *cpu, address_word cia, int exception, ...);
#define SignalException(exc,instruction) signal_exception (SD, CPU, cia, (exc), (instruction))
-#define SignalExceptionInterrupt() signal_exception (SD, CPU, NULL_CIA, Interrupt)
+#define SignalExceptionInterrupt() signal_exception (SD, CPU, cia, Interrupt)
#define SignalExceptionInstructionFetch() signal_exception (SD, CPU, cia, InstructionFetch)
#define SignalExceptionAddressStore() signal_exception (SD, CPU, cia, AddressStore)
#define SignalExceptionAddressLoad() signal_exception (SD, CPU, cia, AddressLoad)
@@ -815,7 +848,7 @@ void signal_exception (SIM_DESC sd, sim_cpu *cpu, address_word cia, int exceptio
#define SignalExceptionFPE() signal_exception (SD, CPU, cia, FPE)
#define SignalExceptionIntegerOverflow() signal_exception (SD, CPU, cia, IntegerOverflow)
#define SignalExceptionCoProcessorUnusable() signal_exception (SD, CPU, cia, CoProcessorUnusable)
-
+#define SignalExceptionNMIReset() signal_exception (SD, CPU, cia, NMIReset)
/* Co-processor accesses */
@@ -931,6 +964,38 @@ INLINE_SIM_MAIN (void) pending_tick PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_
char* pr_addr PARAMS ((SIM_ADDR addr));
char* pr_uword64 PARAMS ((uword64 addr));
+/* start-sanitize-sky */
+#ifdef TARGET_SKY
+#ifdef SIM_ENGINE_HALT_HOOK
+#undef SIM_ENGINE_HALT_HOOK
+#endif
+
+void sky_sim_engine_halt PARAMS ((SIM_DESC sd, sim_cpu *last, sim_cia cia));
+#define SIM_ENGINE_HALT_HOOK(sd, last, cia) sky_sim_engine_halt(sd, last, cia);
+
+#ifndef TM_TXVU_H /* In case GDB hasn't been configured yet */
+enum txvu_cpu_context
+{
+ TXVU_CPU_AUTO = -1, /* context-sensitive context */
+ TXVU_CPU_MASTER, /* R5900 core */
+ TXVU_CPU_VU0, /* Vector units */
+ TXVU_CPU_VU1,
+ TXVU_CPU_VIF0, /* FIFO's */
+ TXVU_CPU_VIF1,
+ TXVU_CPU_LAST /* Count of context types */
+};
+
+/* memory segment for communication with GDB */
+#define GDB_COMM_AREA 0x21010000
+#define GDB_COMM_SIZE 0x4000
+
+/* Memory address containing last device to execute */
+#define LAST_DEVICE GDB_COMM_AREA
+
+#define BREAK_MASK 0x02 /* Breakpoint bit is #57 */
+#endif /* !TM_TXVU_H */
+#endif /* TARGET_SKY */
+/* end-sanitize-sky */
#if H_REVEALS_MODULE_P (SIM_MAIN_INLINE)
#include "sim-main.c"