enable build of the cpu tester from the SheepShaver tree

This commit is contained in:
gbeauche 2004-11-25 19:14:15 +00:00
parent 6d68826725
commit 6287978c19
3 changed files with 44 additions and 3 deletions

View File

@ -23,6 +23,7 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
SYSSRCS = @SYSSRCS@
CPUSRCS = @CPUSRCS@
MONSRCS = @MONSRCS@
DYNGENSRCS = @DYNGENSRCS@
DYNGEN_CC = @DYNGEN_CC@
DYNGEN_OP_FLAGS = @DYNGEN_OP_FLAGS@
@ -42,7 +43,7 @@ SRCS = main_unix.cpp ../prefs.cpp ../prefs_items.cpp prefs_unix.cpp sys_unix.cpp
../serial.cpp ../extfs.cpp \
about_window_unix.cpp ../user_strings.cpp user_strings_unix.cpp \
vm_alloc.cpp sigsegv.cpp \
sshpty.c strlcpy.c $(SYSSRCS) $(CPUSRCS)
sshpty.c strlcpy.c $(SYSSRCS) $(CPUSRCS) $(MONSRCS)
APP = SheepShaver
APP_EXE = $(APP)$(EXEEXT)
APP_APP = $(APP).app
@ -163,5 +164,21 @@ $(OBJ_DIR)/ppc-execute.o: ppc-execute-impl.cpp
ppc-execute-impl.cpp: $(kpxsrcdir)/cpu/ppc/ppc-decode.cpp $(GENEXEC) $(DYNGENDEPS)
$(CPP) $(CPPFLAGS) -DGENEXEC $< | $(GENEXEC) > $@
# PowerPC CPU tester
TESTSRCS_ = cpu/jit/jit-cache.cpp cpu/jit/basic-dyngen.cpp cpu/ppc/ppc-dyngen.cpp mathlib/ieeefp.cpp cpu/ppc/ppc-cpu.cpp cpu/ppc/ppc-decode.cpp cpu/ppc/ppc-execute.cpp cpu/ppc/ppc-translate.cpp test/test-powerpc.cpp $(MONSRCS) vm_alloc.cpp
TESTSRCS = $(TESTSRCS_:%.cpp=$(kpxsrcdir)/%.cpp)
define TESTSRCS_LIST_TO_OBJS
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(TESTSRCS), \
$(basename $(notdir $(file))))))
endef
TESTOBJS = $(TESTSRCS_LIST_TO_OBJS)
$(OBJ_DIR)/test-powerpc.o: $(kpxsrcdir)/test/test-powerpc.cpp
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DEMU_KHEPERIX -c $< -o $@
test-powerpc$(EXEEXT): $(TESTOBJS)
$(CXX) -o $@ $(LDFLAGS) $(TESTOBJS) $(LIBS)
#-------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -105,6 +105,7 @@ if [[ "x$WANT_MON" = "xyes" ]]; then
WANT_MON=no
fi
fi
AC_SUBST(MONSRCS)
dnl Checks for libraries.
AC_CHECK_LIB(posix4, sem_init)
@ -445,7 +446,7 @@ if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
AUDIOSRC="../SDL/audio_sdl.cpp"
fi
SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
dnl Define a macro that translates a yesno-variable into a C macro definition
dnl to be put into the config.h file

View File

@ -29,6 +29,10 @@
#include <ctype.h>
#include <math.h>
#ifndef USE_JIT
#define USE_JIT 0
#endif
#if EMU_KHEPERIX
#include "sysdeps.h"
#include "cpu/ppc/ppc-cpu.hpp"
@ -159,6 +163,25 @@ static void inline ppc_flush_icache_range(uint32 *start_p, uint32 length)
#endif
#if EMU_KHEPERIX
// Wrappers when building from SheepShaver tree
#ifdef SHEEPSHAVER
int64 TimebaseSpeed = 25000000; // Default: 25 MHz
uint32 PVR = 0x000c0000; // Default: 7400 (with AltiVec)
uint64 GetTicks_usec(void)
{
return clock();
}
void init_emul_op_trampolines(basic_dyngen & dg)
{
}
#define ENABLE_JIT_P (USE_JIT && 1)
#else
#define ENABLE_JIT_P NULL
#endif
struct powerpc_cpu_base
: public powerpc_cpu
{
@ -179,7 +202,7 @@ struct powerpc_cpu_base
};
powerpc_cpu_base::powerpc_cpu_base()
: powerpc_cpu(NULL)
: powerpc_cpu(ENABLE_JIT_P)
{
init_decoder();
}