diff options
author | Korey Sewell <ksewell@umich.edu> | 2007-06-22 19:03:42 -0400 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2007-06-22 19:03:42 -0400 |
commit | 753adb38d5471d23315d1bcfc6a744d1c6e03975 (patch) | |
tree | 9ae1cc842f4c3756acf86147a5fd6772d7a6622f /src/arch/mips/utility.hh | |
parent | 16c1b5484f576b6aebea9ab5ffab4ea64f080de0 (diff) | |
download | gem5-753adb38d5471d23315d1bcfc6a744d1c6e03975.tar.xz |
mips import pt. 1
src/arch/mips/SConscript:
"mips import pt.1".
--HG--
extra : convert_revision : 2e393341938bebf32fb638a209262d074fad4cc1
Diffstat (limited to 'src/arch/mips/utility.hh')
-rw-r--r-- | src/arch/mips/utility.hh | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/arch/mips/utility.hh b/src/arch/mips/utility.hh index 12db1de57..e3fd9daa8 100644 --- a/src/arch/mips/utility.hh +++ b/src/arch/mips/utility.hh @@ -35,13 +35,15 @@ #define __ARCH_MIPS_UTILITY_HH__ #include "arch/mips/types.hh" +#include "arch/mips/isa_traits.hh" #include "base/misc.hh" #include "config/full_system.hh" -#include "cpu/thread_context.hh" //XXX This is needed for size_t. We should use something other than size_t //#include "kern/linux/linux.hh" #include "sim/host.hh" +#include "cpu/thread_context.hh" + class ThreadContext; namespace MipsISA { @@ -66,6 +68,8 @@ namespace MipsISA { template <class TC> void zeroRegisters(TC *tc); + void startupCPU(ThreadContext *tc, int cpuId); + void copyRegs(ThreadContext *src, ThreadContext *dest); // Instruction address compression hooks @@ -88,9 +92,17 @@ namespace MipsISA { return 0; } - inline void startupCPU(ThreadContext *tc, int cpuId) - { - tc->activate(0); + static inline ExtMachInst + makeExtMI(MachInst inst, ThreadContext * xc) { +#if FULL_SYSTEM + ExtMachInst ext_inst = inst; + if (xc->readPC() && 0x1) + return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32); + else + return ext_inst; +#else + return ExtMachInst(inst); +#endif } }; |