aboutsummaryrefslogtreecommitdiff
path: root/sim/tic80
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-08-25 23:14:25 +0000
committerAndrew Cagney <cagney@redhat.com>1997-08-25 23:14:25 +0000
commit247fccdeb54a09a14287b2e829511803ad9d7cc1 (patch)
treec992df7132ca0c315cbcfd5ad81bbc4f16675936 /sim/tic80
parent04f295b64859a6c6b01739fc4dd7fddce42db8d9 (diff)
downloadgdb-247fccdeb54a09a14287b2e829511803ad9d7cc1.zip
gdb-247fccdeb54a09a14287b2e829511803ad9d7cc1.tar.gz
gdb-247fccdeb54a09a14287b2e829511803ad9d7cc1.tar.bz2
Add ABFD argument to sim_open call. Pass through to sim_config so
that image properties such as endianness can be checked. More strongly document the expected behavour of each of the sim_* interfaces. Add default endian argument to simulator config macro SIM_AC_OPTION_ENDIAN. Use in sim_config.
Diffstat (limited to 'sim/tic80')
-rw-r--r--sim/tic80/ChangeLog11
-rwxr-xr-xsim/tic80/configure46
-rw-r--r--sim/tic80/sim-calls.c11
3 files changed, 46 insertions, 22 deletions
diff --git a/sim/tic80/ChangeLog b/sim/tic80/ChangeLog
index 5b92c84..f4105b5 100644
--- a/sim/tic80/ChangeLog
+++ b/sim/tic80/ChangeLog
@@ -1,3 +1,14 @@
+Mon Aug 25 17:50:22 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
+Mon Aug 25 16:33:29 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sim-calls.c (sim_open): Add ABFD argument.
+ (sim_open): Move sim_config call to just after argument
+ parsing. Check return status.
+
Fri Aug 8 21:52:27 1997 Mark Alexander <marka@cygnus.com>
* sim-calls.c (sim_store_register): Allow accumulators
diff --git a/sim/tic80/configure b/sim/tic80/configure
index 2b8e6ea..db70f43 100755
--- a/sim/tic80/configure
+++ b/sim/tic80/configure
@@ -1341,19 +1341,27 @@ fi
+wire_endian="LITTLE_ENDIAN"
+default_endian="LITTLE_ENDIAN"
default_sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN"
# Check whether --enable-sim-endian or --disable-sim-endian was given.
if test "${enable_sim_endian+set}" = set; then
enableval="$enable_sim_endian"
case "${enableval}" in
- yes) case "$target" in
- *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
- *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
- *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
- esac;;
- no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
+ yes) if test x"$wire_endian" != x; then
+ sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
+ else
+ echo "No hard-wired endian for target $target" 1>&6
+ sim_endian="-DWITH_TARGET_BYTE_ORDER=0"
+ fi;;
+ no) if test x"$default_endian" != x; then
+ sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
+ else
+ echo "No default endian for target $target" 1>&6
+ sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0"
+ fi;;
*) { echo "configure: error: "Unknown value $enableval for --enable-sim-endian"" 1>&2; exit 1; }; sim_endian="";;
esac
if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
@@ -1399,14 +1407,14 @@ else
if test "x$cross_compiling" = "xno"; then
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1403: checking whether byte ordering is bigendian" >&5
+echo "configure:1411: 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 1410 "configure"
+#line 1418 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1417,11 +1425,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:1421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1429: \"$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 1425 "configure"
+#line 1433 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1432,7 +1440,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:1436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -1452,7 +1460,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 1456 "configure"
+#line 1464 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -1465,7 +1473,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:1469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -1539,17 +1547,17 @@ for ac_hdr in stdlib.h unistd.h string.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1543: checking for $ac_hdr" >&5
+echo "configure:1551: 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 1548 "configure"
+#line 1556 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1578,12 +1586,12 @@ done
for ac_func in getpid kill
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1582: checking for $ac_func" >&5
+echo "configure:1590: 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 1587 "configure"
+#line 1595 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1606,7 +1614,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
diff --git a/sim/tic80/sim-calls.c b/sim/tic80/sim-calls.c
index 8f609ee..60659b92 100644
--- a/sim/tic80/sim-calls.c
+++ b/sim/tic80/sim-calls.c
@@ -52,6 +52,7 @@ struct sim_state simulation = { 0 };
SIM_DESC
sim_open (SIM_OPEN_KIND kind,
host_callback *callback,
+ struct _bfd *abfd,
char **argv)
{
SIM_DESC sd = &simulation;
@@ -73,6 +74,13 @@ sim_open (SIM_OPEN_KIND kind,
return 0;
}
+ /* establish the simulator configuration */
+ if (sim_config (sd, abfd) != SIM_RC_OK)
+ {
+ sim_module_uninstall (sd);
+ return 0;
+ }
+
if (sim_post_argv_init (sd) != SIM_RC_OK)
{
/* Uninstall the modules to avoid memory leaks,
@@ -89,9 +97,6 @@ sim_open (SIM_OPEN_KIND kind,
memset (&STATE_CPU (sd, 0)->cia, 0, sizeof STATE_CPU (sd, 0)->cia);
CPU_STATE (STATE_CPU (sd, 0)) = sd;
- /* establish the simulator configuration */
- sim_config (sd, LITTLE_ENDIAN/*d30v always big endian*/);
-
#define TIC80_MEM_START 0x2000000
#define TIC80_MEM_SIZE 0x100000