diff options
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/byteswap.hh | 6 | ||||
-rw-r--r-- | src/sim/host.hh | 2 | ||||
-rw-r--r-- | src/sim/main.cc | 12 | ||||
-rw-r--r-- | src/sim/pseudo_inst.cc | 16 | ||||
-rw-r--r-- | src/sim/pseudo_inst.hh | 2 | ||||
-rw-r--r-- | src/sim/system.cc | 2 | ||||
-rw-r--r-- | src/sim/system.hh | 7 |
7 files changed, 17 insertions, 30 deletions
diff --git a/src/sim/byteswap.hh b/src/sim/byteswap.hh index 7648b8fcd..7b1ae701e 100644 --- a/src/sim/byteswap.hh +++ b/src/sim/byteswap.hh @@ -47,6 +47,8 @@ // If one doesn't exist, we pretty much get what is listed below, so it all // works out #include <byteswap.h> +#elif defined (__sun__) +#include <sys/isa_defs.h> #else #include <machine/endian.h> #endif @@ -128,12 +130,12 @@ template <typename T> static inline T letobe(T value) {return swap_byte(value);} //For conversions not involving the guest system, we can define the functions //conditionally based on the BYTE_ORDER macro and outside of the namespaces -#if BYTE_ORDER == BIG_ENDIAN +#if defined(_BIG_ENDIAN) || BYTE_ORDER == BIG_ENDIAN template <typename T> static inline T htole(T value) {return swap_byte(value);} template <typename T> static inline T letoh(T value) {return swap_byte(value);} template <typename T> static inline T htobe(T value) {return value;} template <typename T> static inline T betoh(T value) {return value;} -#elif BYTE_ORDER == LITTLE_ENDIAN +#elif defined(_LITTLE_ENDIAN) || BYTE_ORDER == LITTLE_ENDIAN template <typename T> static inline T htole(T value) {return value;} template <typename T> static inline T letoh(T value) {return value;} template <typename T> static inline T htobe(T value) {return swap_byte(value);} diff --git a/src/sim/host.hh b/src/sim/host.hh index 9c79580b1..a2faa206b 100644 --- a/src/sim/host.hh +++ b/src/sim/host.hh @@ -56,7 +56,7 @@ typedef int64_t Counter; */ typedef int64_t Tick; -const Tick MaxTick = (1LL << 62); +const Tick MaxTick = (1LL << 63) - 1; /** * Address type diff --git a/src/sim/main.cc b/src/sim/main.cc index 133141e57..5b44102a8 100644 --- a/src/sim/main.cc +++ b/src/sim/main.cc @@ -309,18 +309,14 @@ finalInit() * @return The SimLoopExitEvent that caused the loop to exit. */ SimLoopExitEvent * -simulate(Tick num_cycles = -1) +simulate(Tick num_cycles = MaxTick) { warn("Entering event queue @ %d. Starting simulation...\n", curTick); - // Fix up num_cycles. Special default value -1 means simulate - // "forever"... schedule event at MaxTick just to be safe. - // Otherwise it's a delta for additional cycles to simulate past - // curTick, and thus must be non-negative. - if (num_cycles == -1) - num_cycles = MaxTick; - else if (num_cycles < 0) + if (num_cycles < 0) fatal("simulate: num_cycles must be >= 0 (was %d)\n", num_cycles); + else if (curTick + num_cycles < 0) //Overflow + num_cycles = MaxTick; else num_cycles = curTick + num_cycles; diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc index d913e159b..66036def1 100644 --- a/src/sim/pseudo_inst.cc +++ b/src/sim/pseudo_inst.cc @@ -34,14 +34,14 @@ #include <string> -#include "sim/pseudo_inst.hh" #include "arch/vtophys.hh" #include "base/annotate.hh" #include "cpu/base.hh" #include "cpu/thread_context.hh" #include "cpu/quiesce_event.hh" -#include "kern/kernel_stats.hh" +#include "arch/kernel_stats.hh" #include "sim/param.hh" +#include "sim/pseudo_inst.hh" #include "sim/serialize.hh" #include "sim/sim_exit.hh" #include "sim/stat_control.hh" @@ -134,18 +134,6 @@ namespace AlphaPseudo } void - ivlb(ThreadContext *tc) - { - if (tc->getKernelStats()) - tc->getKernelStats()->ivlb(); - } - - void - ivle(ThreadContext *tc) - { - } - - void m5exit_old(ThreadContext *tc) { exitSimLoop("m5_exit_old instruction encountered"); diff --git a/src/sim/pseudo_inst.hh b/src/sim/pseudo_inst.hh index d211de44e..bc71a7e64 100644 --- a/src/sim/pseudo_inst.hh +++ b/src/sim/pseudo_inst.hh @@ -47,8 +47,6 @@ namespace AlphaPseudo void quiesceNs(ThreadContext *tc, uint64_t ns); void quiesceCycles(ThreadContext *tc, uint64_t cycles); uint64_t quiesceTime(ThreadContext *tc); - void ivlb(ThreadContext *tc); - void ivle(ThreadContext *tc); void m5exit(ThreadContext *tc, Tick delay); void m5exit_old(ThreadContext *tc); void loadsymbol(ThreadContext *xc); diff --git a/src/sim/system.cc b/src/sim/system.cc index 11ae492b9..4b42d41fc 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -43,7 +43,7 @@ #include "sim/system.hh" #if FULL_SYSTEM #include "arch/vtophys.hh" -#include "base/remote_gdb.hh" +#include "arch/remote_gdb.hh" #include "kern/kernel_stats.hh" #endif diff --git a/src/sim/system.hh b/src/sim/system.hh index 827fe5c78..b3a67bf7a 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -56,7 +56,10 @@ class PhysicalMemory; #if FULL_SYSTEM class Platform; class GDBListener; -class RemoteGDB; +namespace TheISA +{ + class RemoteGDB; +} #endif class System : public SimObject @@ -157,7 +160,7 @@ class System : public SimObject #endif public: #if FULL_SYSTEM - std::vector<RemoteGDB *> remoteGDB; + std::vector<TheISA::RemoteGDB *> remoteGDB; std::vector<GDBListener *> gdbListen; virtual bool breakpoint() = 0; #endif // FULL_SYSTEM |