Lots of changes

This commit is contained in:
Michael Meissner 1995-11-01 19:32:38 +00:00
parent 7f82c7e1ee
commit c143ef6296
14 changed files with 7066 additions and 213 deletions

View File

@ -33,6 +33,8 @@ bits.c
bits.h
build-psim
config.in
config.make
config.hdr
configure
configure.in
core.c
@ -55,6 +57,8 @@ emul_netbsd.c
emul_netbsd.h
events.c
events.h
filter_filename.c
filter_filename.h
idecode_branch.h
idecode_expression.h
idecode_fields.h

View File

@ -1,3 +1,53 @@
Wed Nov 1 10:49:48 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* emul_netbsd.c (do_exit): Print arguments and close parenthesis
if tracing, since exit doesn't go through emul_exit_call.
(do_read): Print arguments if tracing.
(do_write): Ditto.
(do_open): Ditto.
(do_break): Ditto.
(do_kill): Ditto.
(do_dup): Ditto.
(do_sigprocmask): Replace trace with printing arguments if
tracing.
(do_ioctl): Print arguments if tracing.
(do_umask): Ditto.
(do_dup2): Ditto.
(do_fcntl): Ditto.
(do_gettimeofday): Ditto.
(do_getrusage): Ditto.
(do_fstatfs): Ditto.
* filter_filename.c: New file to provide filter_filename to strip
the directory prefix from a file.
* filter_filename.h: New include file to declare filter_filename.
* debug.h: Include filter_filename.h.
(TRACE,DTRACE,ERROR): Use filter_filename on __FILE__.
* misc.h: Include filter_filename.h.
(ASSERT): Use filter_filename on __FILE__.
* igen.c (lf_print_my_prefix): Use filter_filename on the filename
argument.
* Makefile.in: Add filter_filename support.
* ppc-instructions (dcbi, icbi): Make these NOPs rather than
invalid instructions.
* configure.in: Add support for more --enable-sim-* switches.
Use config.make and config.hdr to write to Makefile and config.h
respectively. Don't rewrite Makefile, just append to it.
* configure: Regenerate.
* config.{make,hdr}: New shell scripts.
* Makefile.in: Remove all variables set by configure.in.
(psim.o): Depend on $(BUILT_SRC) also.
* emul_netbsd.c (do_gettimeofday,do_getrusage): When comparing an
integer, use 0, not NULL.
Tue Oct 31 15:20:04 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* configure.in: Add support for --enable-sim-inline,
@ -6,19 +56,19 @@ Tue Oct 31 15:20:04 1995 Michael Meissner <meissner@tiktok.cygnus.com>
and --enable-sim-endian switch to control various Makefile
variables.
* configure: Regenerate from configure.in.
* Makefile: Add various Make variables that the various switches
alter.
* Makefile.in: Add various Make variables that the various
switches alter.
* std-config.h (DEFAULT_INLINE): Don't set this to 2 if using GCC
and optimizing by default.
Fri Oct 27 19:26:27 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Fri Oct 27 19:26:27 1995 Andrew Cagney <cagney@highland.com.au>
* bits.h (ROTL32, ROTL64): Were functions, made them macros, now
make them functions again. Appears 2.6.3 is confused by just a
macro.
Thu Oct 26 18:31:58 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Thu Oct 26 18:31:58 1995 Andrew Cagney <cagney@highland.com.au>
* ppc-endian.c (SWAP_8): Fix 8 byte swap!
@ -30,18 +80,18 @@ Thu Oct 26 18:31:58 1995 Andrew Cagney <cagney@cagney@highland.com.au>
trace_semantics is now different to trace_idecode, the former
checks the cache.
Tue Oct 24 21:54:13 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Tue Oct 24 21:54:13 1995 Andrew Cagney <cagney@highland.com.au>
* ppc-instructions (mtsrin): Missing instruction
* ppc-instructions (mfsrin): Missing instruction
* ppc-instructions (eieio): Missing instruction
Tue Oct 24 20:55:29 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Tue Oct 24 20:55:29 1995 Andrew Cagney <cagney@highland.com.au>
* build-psim: New shell script - see internals for usage,
simplifies the process of building custom simulators.
Mon Oct 23 23:48:59 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Mon Oct 23 23:48:59 1995 Andrew Cagney <cagney@highland.com.au>
* std-config.h (SEMANTICS_INLINE): Tidy up notes on each of the
INLINE macros. Make SEMANTICS_INLINE == 1 if DEFAULT_INLINE == 2.
@ -55,7 +105,7 @@ Mon Oct 23 23:48:59 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* FIXME: devices.c/emul_netbsd.c would benefit (slightly) from
the inclusion of device_tree.c/emul_generic.c.
Mon Oct 23 00:31:50 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Mon Oct 23 00:31:50 1995 Andrew Cagney <cagney@highland.com.au>
* os_emul.[hc], emul_generic.[hc], emul_netbsd.[hc]: replace
system.[hc]. Start of suport for multiple emulations and
@ -64,7 +114,7 @@ Mon Oct 23 00:31:50 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* emul_generic.[hc]: Start of code to implement proper system call
tracing (from spy).
Sun Oct 22 21:33:51 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Sun Oct 22 21:33:51 1995 Andrew Cagney <cagney@highland.com.au>
* cpu.h, cpu.c (cpu_init): New function, zero the registers before
the processor is started. Fixes problem of registers being
@ -84,7 +134,7 @@ Sun Oct 22 21:33:51 1995 Andrew Cagney <cagney@cagney@highland.com.au>
performing an isync when the instruction stream doesn't contain
one.
Sun Oct 22 19:27:48 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Sun Oct 22 19:27:48 1995 Andrew Cagney <cagney@highland.com.au>
* mon.h (new), mon.c (new), std-config.h (WITH_MON): Performance
monitoring module. Counts both instructions issued and
@ -104,20 +154,20 @@ Sun Oct 22 19:27:48 1995 Andrew Cagney <cagney@cagney@highland.com.au>
cpu_increment_number_of_insns() and cpu_get_number_of_insns()
replaced by copied code in mon.[hc].
Sun Oct 22 18:42:45 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Sun Oct 22 18:42:45 1995 Andrew Cagney <cagney@highland.com.au>
* sim_calls.c, main.c, psim.c (psim_create): always create
`WITH_SMP' cpus. The actual number of CPU's active in a
simulation run is taken from the device node: /init/smp (an
integer). WITH_SMP changed to 2 (remember to put it back to 0).
Fri Oct 20 17:26:54 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Fri Oct 20 17:26:54 1995 Andrew Cagney <cagney@highland.com.au>
* system.c: More system call emulation. If code appears NetBSD
specific, make conditional to being compiled on a NetBSD system
(sigh).
Wed Oct 18 23:02:20 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Wed Oct 18 23:02:20 1995 Andrew Cagney <cagney@highland.com.au>
* Makefile.in, gen.c(delete), igen.c(new), dgen.c(new),
lf.[ch](new), table.[ch](new): Split into two generators - igen
@ -161,7 +211,7 @@ Wed Oct 18 23:02:20 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* ppc-instructions (64bit Floating Convert from Integer
Doubleword): Correct call to Round_Float().
Mon Oct 16 00:31:20 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Mon Oct 16 00:31:20 1995 Andrew Cagney <cagney@highland.com.au>
* basics.h: #include "sim_callbacks.h" earlier so that its
prototypes are declared in all other header files.
@ -177,7 +227,7 @@ Mon Oct 16 00:31:20 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Add size of buffer argument to functions writing a string into a
buffer. Check for buffer overflow.
Sun Oct 15 22:16:11 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Sun Oct 15 22:16:11 1995 Andrew Cagney <cagney@highland.com.au>
* devices.h, devices.c, debug.h, debug.c: add macro's for tracing
of each device. Make parameter names consistent so macros work.
@ -191,7 +241,7 @@ Sun Oct 15 22:16:11 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* core.c: add tracing of core-device, adjust parameter names in
core functions to be consistent with those in devices*.
Sun Oct 15 20:33:20 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Sun Oct 15 20:33:20 1995 Andrew Cagney <cagney@highland.com.au>
* debug.h, debug.c (trace_option): New function. Parses the trace
option, updating the trace array.
@ -301,7 +351,7 @@ Thu Oct 12 11:35:53 1995 Michael Meissner <meissner@tiktok.cygnus.com>
({CORE,VM,CPU,EVENTS,REGISTERS,INTERRUPTS}_INLINE): Ditto.
({SPREG,IDECODE}_INLINE): Ditto.
Wed Oct 11 17:13:15 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Wed Oct 11 17:13:15 1995 Andrew Cagney <cagney@highland.com.au>
* ppc-instructions: Initial cut of floating point suport added.
Of note include - use of host IEEE floating point instructions,
@ -318,7 +368,7 @@ Wed Oct 11 17:13:15 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* Makefile.in et.al (sorry): tweek to use new core, core_map and
core.h.
Wed Oct 11 12:10:26 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Wed Oct 11 12:10:26 1995 Andrew Cagney <cagney@highland.com.au>
* sim_calls.c, main.c: Add -g (trace_gdb) option, add tracing to
most of the other functions in sim_calls.c.
@ -329,7 +379,7 @@ Wed Oct 11 12:10:26 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* vm.c, vm_n.h, Makefile.in: ditto
Tue Oct 10 15:42:59 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Tue Oct 10 15:42:59 1995 Andrew Cagney <cagney@highland.com.au>
* devices.h, devices.c, memory_map.h, memory_map.c: Changed
callback interface so that there is a read/write buffer but no
@ -341,12 +391,12 @@ Tue Oct 10 15:42:59 1995 Andrew Cagney <cagney@cagney@highland.com.au>
eliminate transfer_mode (raw or cooked) parameter from read/write
buffer.
Fri Oct 6 20:23:56 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Fri Oct 6 20:23:56 1995 Andrew Cagney <cagney@highland.com.au>
* ppc-instructions (fmul, fmuls): correct instruction format - had
FRB instead of FRC.
Wed Oct 4 17:31:12 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Wed Oct 4 17:31:12 1995 Andrew Cagney <cagney@highland.com.au>
* psim.c, device_tree.h, device_tree.c, devices.c (printd_*,
scand_*): new functions to parse/print fields in device names
@ -360,7 +410,7 @@ Wed Oct 4 17:31:12 1995 Andrew Cagney <cagney@cagney@highland.com.au>
variable number of arguments. This gives greater flexability and
greater chance of bugs.
Tue Oct 3 22:01:56 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Tue Oct 3 22:01:56 1995 Andrew Cagney <cagney@highland.com.au>
* main.c (printf_filtered, error): Missing va_end() to close off
variable argument use.
@ -483,7 +533,7 @@ Fri Sep 8 09:51:03 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* basics.h (sysdep.h): Don't include it.
* Makefile.in (BASICS_H): Remove sysdep.h.
Wed Sep 6 13:25:42 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Wed Sep 6 13:25:42 1995 Andrew Cagney <cagney@highland.com.au>
* core.c (core_add_data): First growth of bss was being put at
wrong address (0) instead of &end.
@ -491,7 +541,7 @@ Wed Sep 6 13:25:42 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* core.c (core_add_stack, core_add_data): Was not handling case
where bss/stack is grown across the current end-of-{bss,stack}.
Wed Sep 6 00:46:10 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Wed Sep 6 00:46:10 1995 Andrew Cagney <cagney@highland.com.au>
* system.c (system_call): Fix SYS_break - was aligning bss to a
page boundary instead of just an 8 byte one; On first call sbrk(0)
@ -537,7 +587,7 @@ Tue Aug 22 09:31:18 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* configure.in: Clone from other simulator targets.
* configure: Generate via autoconf from configure.in.
Sat Aug 19 09:05:32 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Sat Aug 19 09:05:32 1995 Andrew Cagney <cagney@highland.com.au>
* ppc-instructions: fix srawi (was geting XER[CA] real wrong).
@ -548,14 +598,14 @@ Sat Aug 19 09:05:32 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* main.c (main): really stupid. Wasn't exiting with correct status
Fri Aug 18 00:38:01 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Fri Aug 18 00:38:01 1995 Andrew Cagney <cagney@highland.com.au>
* system.c (system_call): add system calls kill(2) and getpid(2).
* main.c (main): Check/return exit status when simulation
finishes.
Thu Aug 17 14:29:18 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Thu Aug 17 14:29:18 1995 Andrew Cagney <cagney@highland.com.au>
* device_tree.c (create_option_device_node): Alignment rules (at
least for the moment) now are for strict alignment only for LE OEA
@ -563,7 +613,7 @@ Thu Aug 17 14:29:18 1995 Andrew Cagney <cagney@cagney@highland.com.au>
* system.c (system_call) SYS_exit: Wasn't exiting with correct status.
Thu Aug 17 01:16:38 1995 Andrew Cagney <cagney@cagney@highland.com.au>
Thu Aug 17 01:16:38 1995 Andrew Cagney <cagney@highland.com.au>
* vm.c (DEFINE_VM_DATA_MAP_WRITE_N): For miss aligned transfer
forgot to return.

View File

@ -68,6 +68,7 @@ RANLIB = @RANLIB@
HDEFINES = @HDEFINES@
TDEFINES =
IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_FILTER)
.NOEXPORT:
MAKEOVERRIDES=
@ -77,24 +78,15 @@ BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
CONFIG_FILE = std-config.h
# See inline.h for appropriate flags to set
INLINE_CFLAGS = # -g0 -DDEFAULT_INLINE=2
IGEN_FLAGS = -f 64 # -f 64 -e
IGEN_OPCODE_RULES = ppc-opcode-simple # ppc-opcode-complex
DGEN_FLAGS = # # -s
LIBIBERTY_LIB = ../../libiberty/libiberty.a
BFD_LIB = ../../bfd/libbfd.a
TARGETLIB = libsim.a
TARGETLIB = libsim.a
all: run $(TARGETLIB) $(GDB_OBJ)
.c.o:
$(CC) -c $(CFLAGS) $(INLINE_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $<
$(CC) -c $(CFLAGS) $(INLINE_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $<
@ -104,6 +96,7 @@ BASICS_H = \
words.h \
ppc-endian.h \
debug.h \
filter_filename.h \
bits.h \
sim_callbacks.h
@ -183,6 +176,7 @@ MAIN_SRC = \
# first
LIB_OBJ = \
debug.o \
filter_filename.o \
bits.o \
ppc-endian.o \
os_emul.o \
@ -221,11 +215,12 @@ $(TARGETLIB): tmp-igen tmp-dgen $(LIB_OBJ) $(GDB_OBJ)
# Given that inlines are turned on now, rebuild psim whenever
# anything changes.
psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC)
psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC)
bits.o: bits.c $(BASICS_H)
debug.o: debug.c $(BASICS_H)
filter_filename.o: filter_filename.c $(BASICS_H)
ppc-endian.o: ppc-endian.c ppc-endian.h \
config.h ppc-config.h words.h sim_callbacks.h
@ -314,16 +309,16 @@ tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/.
# itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c: tmp-igen
# spreg.h spreg.c: tmp-dgen
dgen: dgen.o table.o lf.o misc.o
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o dgen dgen.o table.o lf.o misc.o $(LIBIBERTY_LIB) $(LIBS)
dgen: dgen.o table.o lf.o misc.o filter_filename.o
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
igen: igen.o table.o lf.o misc.o
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o igen igen.o table.o lf.o misc.o $(LIBIBERTY_LIB) $(LIBS)
igen: igen.o table.o lf.o misc.o filter_filename.o
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
table.o: misc.h lf.h table.h
lf.o: misc.h lf.h
dgen.o igen.o: misc.h lf.h table.h
misc.o: misc.h
table.o: misc.h filter_filename.h lf.h table.h
lf.o: misc.h filter_filename.h lf.h
dgen.o igen.o: misc.h filter_filename.h lf.h table.h
misc.o: misc.h filter_filename.h
# With out this #, make thinks that misc.o doesn't have a rule
tags etags: TAGS
@ -344,9 +339,11 @@ config.h: stamp-h ; @true
stamp-h: config.in config.status
CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
config.status: configure
config.status: configure config.make config.hdr
$(SHELL) ./config.status --recheck
install:
$(INSTALL_XFORM) run $(bindir)/run
# Make variables generated automatically by configure follow this

52
sim/ppc/config.hdr Executable file
View File

@ -0,0 +1,52 @@
#! /bin/sh
# Helper script to turn --enable-sim-xxx switches into defines
# Arg 1 -- header name
# Arg 2 -- define name
# Arg 3 -- --enable-sim switch spelling
# Arg 4 -- --enable-sim switch value
# the remaining switches are paired, with the first being the value to test arg 4 against
# and the second is the value to put in the define if it matches
hdr="$1"
shift
define="$1"
shift
switch="$1"
shift
value="$1"
shift
while test $# -gt 1; do
test_value="$1"
shift
set_value="$1"
shift
if test x"$value" = x"$test_value" -o x"$test_value" = x"*"; then
echo "Defining $define=$set_value"
(echo ""
if test x"$value" = x""; then
echo "/* no $switch */"
elif test x"$value" = x"yes"; then
echo "/* $switch */"
else
echo "/* $switch=$value */"
fi
echo "#ifndef $define"
echo "#define $define $set_value"
echo "#endif") >> $hdr
exit 0;
fi
done
if test x"$value" != x"" -a x"$value" != x"no"; then
echo "$switch=$value is not supported" 1>&2
exit 1
fi

53
sim/ppc/config.make Executable file
View File

@ -0,0 +1,53 @@
#! /bin/sh
# Helper script to turn --enable-sim-xxx switches into make variables
# Arg 1 -- header name
# Arg 2 -- define name
# Arg 3 -- --enable-sim switch spelling
# Arg 4 -- --enable-sim switch value
# the remaining switches are paired, with the first being the value to test arg 4 against
# and the second is the value to put in the define if it matches
make="$1"
shift
makevar="$1"
shift
switch="$1"
shift
value="$1"
shift
while test $# -gt 1; do
test_value="$1"
shift
set_value="$1"
shift
if test x"$value" = x"$test_value" -o x"$test_value" = x"*"; then
echo "Setting $makevar=$set_value"
(echo "";
if test x"$value" = x""; then
echo "# no $switch";
elif test x"$value" = x"yes"; then
echo "# $switch";
else
echo "# $switch=$value";
fi
if test x"$set_value" = x""; then
echo "$makevar ="
else
echo "$makevar = $set_value"
fi) >> $make
exit 0;
fi
done
if test x"$value" != x"" -a x"$value" != x"no"; then
echo "$switch=$value is not supported" 1>&2
exit 1
fi

173
sim/ppc/configure vendored
View File

@ -1040,13 +1040,41 @@ rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
if test x"$enable_sim_cflags" != x"" -a x"$enable_sim_cflags" != x"no"; then
if test "$enable_sim_cflags" = "yes"; then
enable_sim_cflags="-fomit-frame-pointer,-O2"
fi
echo "Setting SIM_CFLAGS=$enable_sim_cflags" | sed -e "s/,/ /g" 1>&6
(echo; echo "# --enable-sim-cflags=$enable_sim_cflags";
echo "SIM_CFLAGS = $enable_sim_cflags" | sed -e "s/,/ /g") >> Makefile
else
echo "Setting SIM_CFLAGS=" 1>&6
(echo; echo "# no --enable-sim-cflags"; echo "SIM_CFLAGS =") >> Makefile
fi
$srcdir/config.make Makefile CONFIG_FILE --enable-sim-config "$enable_sim_config" \
"" "std-config.h" "no" "std-config.h" "yes" "std-config.h" "*" "$enable_sim_config" 1>&6
$srcdir/config.make Makefile IGEN_OPCODE_RULES --enable-sim-opcode "$enable_sim_opcode" \
"" "ppc-opcode-simple" "no" "ppc-opcode-simple" "yes" "ppc-opcode-simple" \
"complex" "ppc-opcode-complex" "simple" "ppc-opcode-simple" 1>&6
$srcdir/config.make Makefile DGEN_FLAGS --enable-sim-switch "$enable_sim_switch" \
"" "" "no" "" "yes" "-s" 1>&6
$srcdir/config.make Makefile IGEN_DUPLICATE --enable-sim-duplicate "$enable_sim_duplicate" \
"" "" "no" "" "yes" "-e" 1>&6
$srcdir/config.make Makefile IGEN_FILTER --enable-sim-filter "$enable_sim_filter" \
"" "-f 64" "no" "" "yes" "-f 64" "*" "$enable_sim_filter" 1>&6
flags=""
if test x"$enable_sim_inline" != x""; then
flags=""
case "$enable_sim_inline" in
no) flags="";;
0) flags="-DDEFAULT_INLINE=0";;
yes | 2) flags="-DDEFAULT_INLINE=2";;
1) flags="-DDEFAULT_INLINE=1";;
0) flags=" -DDEFAULT_INLINE=0";;
yes | 2) flags=" -DDEFAULT_INLINE=2";;
1) flags=" -DDEFAULT_INLINE=1";;
*) for x in `echo "$enable_sim_inline" | sed -e "s/,/ /g"`; do
case "$x" in
*_INLINE=*) flags="$flags -D$x";;
@ -1056,87 +1084,68 @@ if test x"$enable_sim_inline" != x""; then
esac
done;;
esac
if test x"$flags" != x""; then
mv Makefile Makefile.tem
echo "Setting INLINE_CFLAGS=$flags" 1>&6
sed -e "s/^INLINE_CFLAGS.*=.*\$/INLINE_CFLAGS =$flags/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
fi
if test x"$enable_sim_bswap" != x"" -a x"$enable_sim_bswap" != x"no"; then
mv Makefile Makefile.tem
echo "Setting BSWAP_CFLAGS=-DWITH_BSWAP=1" 1>&6
sed -e "s/^BSWAP_CFLAGS.*=.*\$/BSWAP_CFLAGS = -DWITH_BSWAP=1/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_cflags" != x"" -a x"$enable_sim_cflags" != x"no"; then
if test "$enable_sim_cflags" = "yes"; then
enable_sim_cflags="-fomit-frame-pointer,-O2"
fi
mv Makefile Makefile.tem
echo "Setting SIM_CFLAGS=$enable_sim_cflags"
sed -e "s/^SIM_CFLAGS.*=.*\$/SIM_CFLAGS = $enable_sim_cflags/" -e "s/,/ /g"\
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_complex" != x"" -a x"$enable_sim_complex" != x"no"; then
mv Makefile Makefile.tem
echo "Setting IGEN_OPCODE_RULES=ppc-opcode-complex" 1>&6
sed -e "s/^IGEN_OPCODE_RULES.*=.*\$/IGEN_OPCODE_RULES = ppc-opcode-complex/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_switch" != x"" -a x"$enable_sim_switch" != x"no"; then
mv Makefile Makefile.tem
echo "Setting DGEN_FLAGS=-s" 1>&6
sed -e "s/^DGEN_FLAGS.*=.*\$/DGEN_FLAGS = -s/" < Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_duplicate" != x"" -a x"$enable_sim_duplicate" != x"no"; then
mv Makefile Makefile.tem
echo "Setting IGEN_DUPLICATE=-e" 1>&6
sed -e "s/^IGEN_DUPLICATE.*=.*\$/IGEN_DUPLICATE = -e/" < Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_filter" = x"no"; then
mv Makefile Makefile.tem
echo "Setting IGEN_FILTER=" 1>&6
sed -e "s/^IGEN_FILTER.*=.*\$/IGEN_FILTER =/" < Makefile.tem > Makefile
rm -f Makefile.tem
if test x"$flags" != x""; then
echo "Setting INLINE_CFLAGS=$flags" 1>&6
(echo; echo "# --enable-sim-inline=$enable_sim_inline"; echo "INLINE_CFLAGS =$flags") >> Makefile
else
if test x"$enable_sim_filter" != x"yes" -a x"$enable_sim_filter" != x""; then
mv Makefile Makefile.tem
echo "Setting IGEN_FILTER= -f $enable_sim_filter" 1>&6
sed -e "s/^IGEN_FILTER.*=.*\$/IGEN_FILTER = -f $enable_sim_filter/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
echo "Setting INLINE_CFLAGS=" 1>&6
(echo; echo "# no --enable-sim-inline"; echo "INLINE_CFLAGS =") >> Makefile
fi
endian=""
case x"$enable_sim_endian" in
xb* | xB*) endian="BIG_ENDIAN";;
xl* | xL*) endian="LITTLE_ENDIAN";;
xyes) case "$target" in
*powerpc-*) endian="BIG_ENDIAN";;
*powerpcle-*) endian="LITTLE_ENDIAN";;
*) echo "Unknown $target" 1>&6;;
esac;;
$srcdir/config.hdr config.h WITH_BSWAP --enable-sim-bswap "$enable_sim_bswap" "yes" 1
case "$target" in
*powerpc-*) endian="BIG_ENDIAN";;
*powerpcle-*) endian="LITTLE_ENDIAN";;
*) echo "Unknown $target" 1>&6; endian="0";;
esac
if test x"$endian" != x""; then
mv Makefile Makefile.tem
echo "Setting SIM_ENDIAN=-DWITH_TARGET_BYTE_ORDER=$endian"
sed -e "s/^SIM_ENDIAN.*=.*\$/SIM_ENDIAN = -DWITH_TARGET_BYTE_ORDER=$endian/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
$srcdir/config.hdr config.h WITH_TARGET_BYTE_ORDER --enable-sim-endian "$enable_sim_endian" \
"" "0" "no" "0" "yes" "$endian" \
"b" "BIG_ENDIAN" "big" "BIG_ENDIAN" "big-endian" "BIG_ENDIAN" \
"B" "BIG_ENDIAN" "BIG" "BIG_ENDIAN" "BIG-ENDIAN" "BIG_ENDIAN" \
"l" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" \
"L" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" 1>&6
$srcdir/config.hdr config.h WITH_HOST_BYTE_ORDER --enable-sim-hostendian "$enable_sim_hostendian" \
"b" "BIG_ENDIAN" "big" "BIG_ENDIAN" "big-endian" "BIG_ENDIAN" \
"B" "BIG_ENDIAN" "BIG" "BIG_ENDIAN" "BIG-ENDIAN" "BIG_ENDIAN" \
"l" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" \
"L" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" 1>&6
$srcdir/config.hdr config.h WITH_SMP --enable-sim-smp "$enable_sim_smp" \
"" "0" "no" "0" "yes" "2" "*" "$enable_sim_smp" 1>&6
$srcdir/config.hdr config.h WITH_TARGET_WORD_BITSIZE --enable-sim-bitsize "$enable_sim_bitsize" \
"yes" "32" "32" "32" "32" "64" "64" 1>&6
$srcdir/config.hdr config.h WITH_HOST_WORD_BITSIZE --enable-sim-hostbitsize "$enable_sim_hostbitsize" \
"yes" "32" "32" "32" "32" "64" "64" 1>&6
$srcdir/config.hdr config.h WITH_ENVIRONMENT --enable-sim-env "$enable_sim_env" \
"yes" "0" \
"operating" "OPERATING_ENVIRONMENT" "os" "OPERATING_ENVIRONMENT" "oea" "OPERATING_ENVIRONMENT" \
"virtual" "VIRTUAL_ENVIRONMENT" "vea" "VIRTUAL_ENVIRONMENT" 1>&6
$srcdir/config.hdr config.h WITH_TIME_BASE --enable-sim-timebase "$enable_sim_timebase" \
"no" "0" "yes" "1" 1>&6
$srcdir/config.hdr config.h WITH_ALIGNMENT --enable-sim-alignment "$enable_sim_alignment" \
"no" "NONSTRICT_ALIGNMENT" "nonstrict" "NONSTRICT_ALIGNMENT" \
"yes" "STRICT_ALIGNMENT" "strict" "STRICT_ALIGNMENT" 1>&6
$srcdir/config.hdr config.h WITH_FLOATING_POINT --enable-sim-float "$enable_sim_float" \
"no" "SOFT_FLOATING_POINT" "soft" "SOFT_FLOATING_POINT" \
"yes" "HARD_FLOATING_POINT" "hard" "HARD_FLOATING_POINT" 1>&6
$srcdir/config.hdr config.h WITH_TRACE --enable-sim-trace "$enable_sim_trace" \
"no" "0" "yes" "1" 1>&6
$srcdir/config.hdr config.h WITH_ASSERT --enable-sim-assert "$enable_sim_assert" \
"no" "0" "yes" "1" 1>&6
$srcdir/config.hdr config.h WITH_MON --enable-sim-monitor "$enable_sim_monitor" \
"no" "0" "yes" "MONITOR_INSTRUCTION_ISSUE|MONITOR_LOAD_STORE_UNIT" \
"instruction" "MONITOR_INSTRUCTION_ISSUE" \
"memory" "MONITOR_LOAD_STORE_UNIT" 1>&6

View File

@ -31,13 +31,41 @@ AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h)
AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
if test x"$enable_sim_cflags" != x"" -a x"$enable_sim_cflags" != x"no"; then
if test "$enable_sim_cflags" = "yes"; then
enable_sim_cflags="-fomit-frame-pointer,-O2"
fi
echo "Setting SIM_CFLAGS=$enable_sim_cflags" | sed -e "s/,/ /g" 1>&6
(echo; echo "# --enable-sim-cflags=$enable_sim_cflags";
echo "SIM_CFLAGS = $enable_sim_cflags" | sed -e "s/,/ /g") >> Makefile
else
echo "Setting SIM_CFLAGS=" 1>&6
(echo; echo "# no --enable-sim-cflags"; echo "SIM_CFLAGS =") >> Makefile
fi
$srcdir/config.make Makefile CONFIG_FILE --enable-sim-config "$enable_sim_config" \
"" "std-config.h" "no" "std-config.h" "yes" "std-config.h" "*" "$enable_sim_config" 1>&6
$srcdir/config.make Makefile IGEN_OPCODE_RULES --enable-sim-opcode "$enable_sim_opcode" \
"" "ppc-opcode-simple" "no" "ppc-opcode-simple" "yes" "ppc-opcode-simple" \
"complex" "ppc-opcode-complex" "simple" "ppc-opcode-simple" 1>&6
$srcdir/config.make Makefile DGEN_FLAGS --enable-sim-switch "$enable_sim_switch" \
"" "" "no" "" "yes" "-s" 1>&6
$srcdir/config.make Makefile IGEN_DUPLICATE --enable-sim-duplicate "$enable_sim_duplicate" \
"" "" "no" "" "yes" "-e" 1>&6
$srcdir/config.make Makefile IGEN_FILTER --enable-sim-filter "$enable_sim_filter" \
"" "-f 64" "no" "" "yes" "-f 64" "*" "$enable_sim_filter" 1>&6
flags=""
if test x"$enable_sim_inline" != x""; then
flags=""
case "$enable_sim_inline" in
no) flags="";;
0) flags="-DDEFAULT_INLINE=0";;
yes | 2) flags="-DDEFAULT_INLINE=2";;
1) flags="-DDEFAULT_INLINE=1";;
0) flags=" -DDEFAULT_INLINE=0";;
yes | 2) flags=" -DDEFAULT_INLINE=2";;
1) flags=" -DDEFAULT_INLINE=1";;
*) for x in `echo "$enable_sim_inline" | sed -e "s/,/ /g"`; do
case "$x" in
*_INLINE=*) flags="$flags -D$x";;
@ -47,87 +75,68 @@ if test x"$enable_sim_inline" != x""; then
esac
done;;
esac
if test x"$flags" != x""; then
mv Makefile Makefile.tem
echo "Setting INLINE_CFLAGS=$flags" 1>&6
sed -e "s/^INLINE_CFLAGS.*=.*\$/INLINE_CFLAGS =$flags/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
fi
if test x"$enable_sim_bswap" != x"" -a x"$enable_sim_bswap" != x"no"; then
mv Makefile Makefile.tem
echo "Setting BSWAP_CFLAGS=-DWITH_BSWAP=1" 1>&6
sed -e "s/^BSWAP_CFLAGS.*=.*\$/BSWAP_CFLAGS = -DWITH_BSWAP=1/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_cflags" != x"" -a x"$enable_sim_cflags" != x"no"; then
if test "$enable_sim_cflags" = "yes"; then
enable_sim_cflags="-fomit-frame-pointer,-O2"
fi
mv Makefile Makefile.tem
echo "Setting SIM_CFLAGS=$enable_sim_cflags"
sed -e "s/^SIM_CFLAGS.*=.*\$/SIM_CFLAGS = $enable_sim_cflags/" -e "s/,/ /g"\
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_complex" != x"" -a x"$enable_sim_complex" != x"no"; then
mv Makefile Makefile.tem
echo "Setting IGEN_OPCODE_RULES=ppc-opcode-complex" 1>&6
sed -e "s/^IGEN_OPCODE_RULES.*=.*\$/IGEN_OPCODE_RULES = ppc-opcode-complex/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_switch" != x"" -a x"$enable_sim_switch" != x"no"; then
mv Makefile Makefile.tem
echo "Setting DGEN_FLAGS=-s" 1>&6
sed -e "s/^DGEN_FLAGS.*=.*\$/DGEN_FLAGS = -s/" < Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_duplicate" != x"" -a x"$enable_sim_duplicate" != x"no"; then
mv Makefile Makefile.tem
echo "Setting IGEN_DUPLICATE=-e" 1>&6
sed -e "s/^IGEN_DUPLICATE.*=.*\$/IGEN_DUPLICATE = -e/" < Makefile.tem > Makefile
rm -f Makefile.tem
fi
if test x"$enable_sim_filter" = x"no"; then
mv Makefile Makefile.tem
echo "Setting IGEN_FILTER=" 1>&6
sed -e "s/^IGEN_FILTER.*=.*\$/IGEN_FILTER =/" < Makefile.tem > Makefile
rm -f Makefile.tem
if test x"$flags" != x""; then
echo "Setting INLINE_CFLAGS=$flags" 1>&6
(echo; echo "# --enable-sim-inline=$enable_sim_inline"; echo "INLINE_CFLAGS =$flags") >> Makefile
else
if test x"$enable_sim_filter" != x"yes" -a x"$enable_sim_filter" != x""; then
mv Makefile Makefile.tem
echo "Setting IGEN_FILTER= -f $enable_sim_filter" 1>&6
sed -e "s/^IGEN_FILTER.*=.*\$/IGEN_FILTER = -f $enable_sim_filter/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
echo "Setting INLINE_CFLAGS=" 1>&6
(echo; echo "# no --enable-sim-inline"; echo "INLINE_CFLAGS =") >> Makefile
fi
endian=""
case x"$enable_sim_endian" in
xb* | xB*) endian="BIG_ENDIAN";;
xl* | xL*) endian="LITTLE_ENDIAN";;
xyes) case "$target" in
*powerpc-*) endian="BIG_ENDIAN";;
*powerpcle-*) endian="LITTLE_ENDIAN";;
*) echo "Unknown $target" 1>&6;;
esac;;
$srcdir/config.hdr config.h WITH_BSWAP --enable-sim-bswap "$enable_sim_bswap" "yes" 1
case "$target" in
*powerpc-*) endian="BIG_ENDIAN";;
*powerpcle-*) endian="LITTLE_ENDIAN";;
*) echo "Unknown $target" 1>&6; endian="0";;
esac
if test x"$endian" != x""; then
mv Makefile Makefile.tem
echo "Setting SIM_ENDIAN=-DWITH_TARGET_BYTE_ORDER=$endian"
sed -e "s/^SIM_ENDIAN.*=.*\$/SIM_ENDIAN = -DWITH_TARGET_BYTE_ORDER=$endian/" \
< Makefile.tem > Makefile
rm -f Makefile.tem
fi
$srcdir/config.hdr config.h WITH_TARGET_BYTE_ORDER --enable-sim-endian "$enable_sim_endian" \
"" "0" "no" "0" "yes" "$endian" \
"b" "BIG_ENDIAN" "big" "BIG_ENDIAN" "big-endian" "BIG_ENDIAN" \
"B" "BIG_ENDIAN" "BIG" "BIG_ENDIAN" "BIG-ENDIAN" "BIG_ENDIAN" \
"l" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" \
"L" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" 1>&6
$srcdir/config.hdr config.h WITH_HOST_BYTE_ORDER --enable-sim-hostendian "$enable_sim_hostendian" \
"b" "BIG_ENDIAN" "big" "BIG_ENDIAN" "big-endian" "BIG_ENDIAN" \
"B" "BIG_ENDIAN" "BIG" "BIG_ENDIAN" "BIG-ENDIAN" "BIG_ENDIAN" \
"l" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" \
"L" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" 1>&6
$srcdir/config.hdr config.h WITH_SMP --enable-sim-smp "$enable_sim_smp" \
"" "0" "no" "0" "yes" "2" "*" "$enable_sim_smp" 1>&6
$srcdir/config.hdr config.h WITH_TARGET_WORD_BITSIZE --enable-sim-bitsize "$enable_sim_bitsize" \
"yes" "32" "32" "32" "32" "64" "64" 1>&6
$srcdir/config.hdr config.h WITH_HOST_WORD_BITSIZE --enable-sim-hostbitsize "$enable_sim_hostbitsize" \
"yes" "32" "32" "32" "32" "64" "64" 1>&6
$srcdir/config.hdr config.h WITH_ENVIRONMENT --enable-sim-env "$enable_sim_env" \
"yes" "0" \
"operating" "OPERATING_ENVIRONMENT" "os" "OPERATING_ENVIRONMENT" "oea" "OPERATING_ENVIRONMENT" \
"virtual" "VIRTUAL_ENVIRONMENT" "vea" "VIRTUAL_ENVIRONMENT" 1>&6
$srcdir/config.hdr config.h WITH_TIME_BASE --enable-sim-timebase "$enable_sim_timebase" \
"no" "0" "yes" "1" 1>&6
$srcdir/config.hdr config.h WITH_ALIGNMENT --enable-sim-alignment "$enable_sim_alignment" \
"no" "NONSTRICT_ALIGNMENT" "nonstrict" "NONSTRICT_ALIGNMENT" \
"yes" "STRICT_ALIGNMENT" "strict" "STRICT_ALIGNMENT" 1>&6
$srcdir/config.hdr config.h WITH_FLOATING_POINT --enable-sim-float "$enable_sim_float" \
"no" "SOFT_FLOATING_POINT" "soft" "SOFT_FLOATING_POINT" \
"yes" "HARD_FLOATING_POINT" "hard" "HARD_FLOATING_POINT" 1>&6
$srcdir/config.hdr config.h WITH_TRACE --enable-sim-trace "$enable_sim_trace" \
"no" "0" "yes" "1" 1>&6
$srcdir/config.hdr config.h WITH_ASSERT --enable-sim-assert "$enable_sim_assert" \
"no" "0" "yes" "1" 1>&6
$srcdir/config.hdr config.h WITH_MON --enable-sim-monitor "$enable_sim_monitor" \
"no" "0" "yes" "MONITOR_INSTRUCTION_ISSUE|MONITOR_LOAD_STORE_UNIT" \
"instruction" "MONITOR_INSTRUCTION_ISSUE" \
"memory" "MONITOR_LOAD_STORE_UNIT" 1>&6

118
sim/ppc/debug.h Normal file
View File

@ -0,0 +1,118 @@
/* This file is part of the program psim.
Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
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.
*/
#ifndef _DEBUG_H_
#define _DEBUG_H_
#include "filter_filename.h"
typedef enum {
trace_invalid,
trace_tbd,
/**/
trace_gdb,
trace_os_emul,
/**/
trace_device_tree,
trace_devices,
trace_pass_device,
trace_console_device,
trace_icu_device,
trace_halt_device,
trace_register_device,
trace_vm_device,
trace_memory_device,
trace_htab_device,
trace_pte_device,
trace_binary_device,
trace_file_device,
trace_core_device,
trace_stack_device,
/**/
trace_semantics,
trace_idecode,
trace_alu,
/**/
trace_vm,
trace_core,
trace_psim,
trace_device_init,
trace_cpu,
trace_breakpoint,
nr_trace_options
} trace_options;
extern int ppc_trace[nr_trace_options];
#if WITH_TRACE
#define TRACE(OBJECT, ARGS) \
do { \
if (ppc_trace[OBJECT]) { \
printf_filtered("%s:%d:%s: ", filter_filename(__FILE__), __LINE__, #OBJECT); \
printf_filtered ARGS; \
} \
} while (0)
/* issue */
#define ITRACE(OBJECT, ARGS) \
do { \
if (ppc_trace[OBJECT]) { \
printf_filtered("%s:%d:0x%x", my_prefix, cpu_nr(processor) + 1, cia); \
printf_filtered ARGS; \
} \
} while (0)
/* device */
#define DTRACE(OBJECT, ARGS) \
do { \
if (ppc_trace[trace_devices] || ppc_trace[trace_##OBJECT##_device]) { \
printf_filtered("%s:%d:%s: ", filter_filename(__FILE__), __LINE__, #OBJECT); \
printf_filtered ARGS; \
} \
} while (0)
#else
#define TRACE(OBJECT, ARGS)
#define ITRACE(OBJECT, ARGS)
#define DTRACE(OBJECT, ARGS)
#endif
#if WITH_ASSERT
#define ASSERT(EXPRESSION) \
do { \
if (!(EXPRESSION)) { \
error("%s:%d: assertion failed - %s\n", \
filter_filename(__FILE__), __LINE__, #EXPRESSION); \
} \
} while (0)
#else
#define ASSERT(EXPRESSION)
#endif
/* Parse OPTION updating the trace array */
extern void
trace_option(const char *option);
/* Output the list of trace options */
extern void
trace_usage(void);
#endif /* _DEBUG_H_ */

1202
sim/ppc/emul_netbsd.c Normal file

File diff suppressed because it is too large Load Diff

36
sim/ppc/filter_filename.c Normal file
View File

@ -0,0 +1,36 @@
/* This file is part of the program psim.
Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
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 "basics.h"
/* Shorten traces by eliminating the directory component to filenames. */
extern char *
filter_filename (char *filename)
{
char *p = filename;
char *last = filename;
int ch;
while ((ch = *p++) != '\0' && ch != ':')
if (ch == '/')
last = p;
return last;
}

27
sim/ppc/filter_filename.h Normal file
View File

@ -0,0 +1,27 @@
/* This file is part of the program psim.
Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
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.
*/
#ifndef _FILTER_FILENAME_H
#define _FILTER_FILENAME_H
/* Remove directory part from filename */
extern char *
filter_filename(char *filename);
#endif

2834
sim/ppc/igen.c Normal file

File diff suppressed because it is too large Load Diff

48
sim/ppc/misc.h Normal file
View File

@ -0,0 +1,48 @@
/* This file is part of the program psim.
Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
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 "filter_filename.h"
extern void error
(char *msg, ...);
#define ASSERT(EXPRESSION) \
do { \
if (!(EXPRESSION)) { \
error("%s:%d: assertion failed - %s\n", \
filter_filename (__FILE__), __LINE__, #EXPRESSION); \
} \
} while (0)
#define ZALLOC(TYPE) (TYPE*)zalloc(sizeof(TYPE))
extern void *zalloc
(long size);
extern void dumpf
(int indent, char *msg, ...);
extern int it_is
(const char *flag,
const char *flags);
extern unsigned a2i
(const char *a);

2414
sim/ppc/ppc-instructions Normal file

File diff suppressed because it is too large Load Diff