* interp.c ([wr][bwl]at): New functions.

(trap): Cope with both byte modes.
This commit is contained in:
Steve Chamberlain 1994-11-24 05:33:47 +00:00
parent 3f67e00028
commit d2fd61a812
5 changed files with 109 additions and 28 deletions

View File

@ -39,4 +39,27 @@ Things-to-lose:
Do-last:
# Don't try to clean directories here, as the 'mv' command will fail.
# Also, grep fails on NFS mounted directories.
if ( echo $* | grep keep\-sh3 > /dev/null ) ; then
for i in * ; do
if test ! -d $i && (grep sanitize-sh3 $i > /dev/null) ; then
echo Keeping SH3 stuff in $i
fi
done
else
for i in * ; do
if test ! -d $i && (grep sanitize-sh3 $i > /dev/null) ; then
echo Cleaning the \"SH3\" out of $i...
cp $i new
sed '/start\-sanitize\-sh3/,/end-\sanitize\-sh3/d' < $i > new
if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
echo Caching $i in .Recover...
mv $i .Recover
fi
mv new $i
fi
done
fi
# End of file.

View File

@ -1,3 +1,31 @@
Wed Nov 23 21:31:55 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* interp.c ([wr][bwl]at): New functions.
(trap): Cope with both byte modes.
Thu Sep 8 17:35:07 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* gencode.c (tab): Simulate T bit after a negc insn right.
* interp.c (RSBAT): Sign extend the arg.
(ACE_FAST): New macro.
(sim_resume): Remove obsolete test of sim_timeout.
Fri Aug 5 14:12:31 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* interp.c (IOMEM): New function, simulates very basic I/O area of
the SH.
(WBAT, RBAT) : Call I/O functions.
* gencode.c (tab): Special case trapa #3.
Mon Jun 27 18:04:54 1994 Steve Chamberlain (sac@cirdan.cygnus.com)
* run.c (main): Specify the file type again.
Thu May 26 19:04:37 1994 Steve Chamberlain (sac@thepub.cygnus.com)
* interp.c (trap): Fix irix incompatibility.
* run.c (main): open without specifying file type.
Wed May 18 14:18:53 1994 Doug Evans (dje@canuck.cygnus.com)
* interp.c (sim_*): Make result void where there isn't one.

View File

@ -17,12 +17,16 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
srcdir = .
srcroot = $(srcdir)/../../
prefix = /usr/local
program_transform_name =
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
tooldir = $(libdir)/$(target_alias)
datadir = $(prefix)/lib
mandir = $(prefix)/man
@ -42,43 +46,56 @@ docdir = $(srcdir)/doc
SHELL = /bin/sh
INSTALL = install -c
INSTALL = $(srcroot)/install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
CC_FOR_BUILD = cc
AR = ar
AR_FLAGS = qc
CFLAGS = -g
BISON = bison
MAKEINFO = makeinfo
RANLIB = ranlib
X=xstuff.o
XL=-lX11
X=
XL=
INCDIR = $(srcdir)/../../include
CSEARCH = -I.-I$(srcdir) -I../../include -I../../bfd -I$(INCDIR) -I$(srcdir)/../../bfd
CSEARCH = -I. -I$(srcdir) -I../../include -I../../bfd -I$(INCDIR) -I$(srcdir)/../../bfd -I$(srcdir)/../../gdb
DEP = mkdep
#### host, target, and site specific Makefile frags come in here.
all: run
all: run libsim.a
run: interp.o run.o table.o
$(CC) -o run interp.o table.o run.o ../../bfd/libbfd.a ../../libiberty/libiberty.a
run: interp.o $(X) run.o table.o
$(CC) $(CFLAGS) -o run $(X) interp.o table.o run.o ../../bfd/libbfd.a ../../libiberty/libiberty.a $(XL)
interp.o:interp.c code.c table.c
run.o:run.c
libsim.a:interp.o table.o
$(AR) $(ARFLAGS) libsim.a interp.o table.o
$(RANLIB) libsim.a
code.c:gencode
./gencode -x >code.c
indent code.c
# indent code.c
table.c:gencode
./gencode -s >table.c
indent table.c
# indent table.c
gencode.o:gencode.c
gencode:gencode.o
gencode:gencode.c
$(CC_FOR_BUILD) -o gencode $<
#### host and target dependent Makefile fragments come in here.
@ -148,17 +165,20 @@ roll:
#
force:
# Copy the files into directories where they will be run.
install:
-parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
-if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
-parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
-if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
-n=`t='$(program_transform_name)'; echo run | sed -e "" $$t`; \
$(INSTALL_PROGRAM) run $(bindir)/$$n; \
$(M_INSTALL)
srcroot=`cd $(srcroot); pwd`; export srcroot; \
$(INSTALL_XFORM) run $(bindir)/run ; \
n=`t='$(program_transform_name)'; echo run | sed -e "" $$t`; \
if [ -d $(tooldir) ] ; then \
if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
rm -f $(tooldir)/bin/run; \
ln $(bindir)/$$n $(tooldir)/bin/run \
|| $(INSTALL_PROGRAM) run $(tooldir)/bin/run; \
else true; fi
install-man: run.1
$(INSTALL_XFORM1) $(srcdir)/run.1 $(man1dir)/run.1
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)

View File

@ -31,3 +31,9 @@ fi
# per-target:
case "${target}" in
sh-*-*) sim_target=sh ;;
shl-*-*) sim_target=shl ;;
esac
target_makefile_frag=${sim_target}.mt

View File

@ -27,6 +27,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "sysdep.h"
#include "remote-sim.h"
int target_byte_order;
int
main (ac, av)
int ac;
@ -39,7 +41,7 @@ main (ac, av)
int verbose = 0;
int trace = 0;
char *name = "";
for (i = 1; i < ac; i++)
{
if (strcmp (av[i], "-v") == 0)
@ -52,17 +54,17 @@ main (ac, av)
}
else if (strcmp (av[i], "-p") == 0)
{
sim_set_profile(atoi(av[i+1]));
sim_set_profile (atoi (av[i + 1]));
i++;
}
else if (strcmp (av[i], "-s") == 0)
{
sim_set_profile_size(atoi(av[i+1]));
sim_set_profile_size (atoi (av[i + 1]));
i++;
}
else if (strcmp (av[i], "-m") == 0)
{
sim_size(atoi(av[i+1]));
sim_size (atoi (av[i + 1]));
i++;
}
else
@ -74,10 +76,9 @@ main (ac, av)
{
printf ("run %s\n", name);
}
abfd = bfd_openr (name, "coff-sh");
abfd = bfd_openr (name, 0);
if (abfd)
{
if (bfd_check_format (abfd, bfd_object))
{
@ -94,6 +95,9 @@ main (ac, av)
start_address = bfd_get_start_address (abfd);
sim_create_inferior (start_address, NULL, NULL);
target_byte_order = abfd->xvec->byteorder_big_p ? 4321 : 1234;
if (trace)
{
int done = 0;
@ -112,10 +116,10 @@ main (ac, av)
/* Find out what was in r0 and return that */
{
unsigned char b[4];
sim_fetch_register(0, b);
sim_fetch_register (0, b);
return b[3];
}
}
}