diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2007-02-18 19:57:46 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2007-02-18 19:57:46 -0500 |
commit | bd367d4825e26ab3f8e01f3b4bdb914bb0ef756a (patch) | |
tree | d7969c7a0dc5eb9097280ad1e56cca8048a6b0ed /src/arch/sparc/remote_gdb.cc | |
parent | b2fd2a813d75815ed2ceaa447590986a29ee99b8 (diff) | |
download | gem5-bd367d4825e26ab3f8e01f3b4bdb914bb0ef756a.tar.xz |
implement vtophys and 32bit gdb support
src/arch/alpha/vtophys.cc:
src/arch/alpha/vtophys.hh:
src/arch/sparc/arguments.hh:
move Copy* to vport since it's generic for all the ISAs
src/arch/sparc/isa_traits.hh:
the Solaris kernel sets up a virtual-> real mapping for all memory starting at SegKPMBase
src/arch/sparc/pagetable.hh:
add a class for getting bits out of the TteTag
src/arch/sparc/remote_gdb.cc:
add 32bit support kinda.... If its 32 bit
src/arch/sparc/remote_gdb.hh:
Add 32bit register offsets too.
src/arch/sparc/tlb.cc:
cleanup generation of tsb pointers
src/arch/sparc/tlb.hh:
add function to return tsb pointers for an address
make lookup public so vtophys can use it
src/arch/sparc/vtophys.cc:
src/arch/sparc/vtophys.hh:
write vtophys for sparc
src/base/bitfield.hh:
return a mask of bits first->last
src/mem/vport.cc:
src/mem/vport.hh:
move Copy* here since it's ISA generic
--HG--
extra : convert_revision : c42c331e396c0d51a2789029d8e232fe66995d0f
Diffstat (limited to 'src/arch/sparc/remote_gdb.cc')
-rw-r--r-- | src/arch/sparc/remote_gdb.cc | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/src/arch/sparc/remote_gdb.cc b/src/arch/sparc/remote_gdb.cc index 2221576a3..e2ea7a84d 100644 --- a/src/arch/sparc/remote_gdb.cc +++ b/src/arch/sparc/remote_gdb.cc @@ -152,7 +152,9 @@ RemoteGDB::acc(Addr va, size_t len) //@Todo In NetBSD, this function checks if all addresses //from va to va + len have valid page mape entries. Not //sure how this will work for other OSes or in general. - return true; + if (va) + return true; + return false; } /////////////////////////////////////////////////////////// @@ -166,23 +168,33 @@ RemoteGDB::getregs() memset(gdbregs.regs, 0, gdbregs.size); if (context->readMiscRegWithEffect(MISCREG_PSTATE) & - PSTATE::am) - panic("In 32bit mode\n"); - - gdbregs.regs[RegPc] = htobe(context->readPC()); - gdbregs.regs[RegNpc] = htobe(context->readNextPC()); - for(int x = RegG0; x <= RegI0 + 7; x++) - gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0)); - - gdbregs.regs[RegFsr] = htobe(context->readMiscRegWithEffect(MISCREG_FSR)); - gdbregs.regs[RegFprs] = htobe(context->readMiscRegWithEffect(MISCREG_FPRS)); - gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1)); - gdbregs.regs[RegState] = htobe( - context->readMiscRegWithEffect(MISCREG_CWP) | - context->readMiscRegWithEffect(MISCREG_PSTATE) << 8 | - context->readMiscRegWithEffect(MISCREG_ASI) << 24 | - context->readIntReg(NumIntArchRegs + 2) << 32); - + PSTATE::am) { + uint32_t *regs; + regs = (uint32_t*)gdbregs.regs; + regs[Reg32Pc] = htobe((uint32_t)context->readPC()); + regs[Reg32Npc] = htobe((uint32_t)context->readNextPC()); + for(int x = RegG0; x <= RegI0 + 7; x++) + regs[x] = htobe((uint32_t)context->readIntReg(x - RegG0)); + + regs[Reg32Y] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 1)); + regs[Reg32Psr] = htobe((uint32_t)context->readMiscRegWithEffect(MISCREG_PSTATE)); + regs[Reg32Fsr] = htobe((uint32_t)context->readMiscRegWithEffect(MISCREG_FSR)); + regs[Reg32Csr] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 2)); + } else { + gdbregs.regs[RegPc] = htobe(context->readPC()); + gdbregs.regs[RegNpc] = htobe(context->readNextPC()); + for(int x = RegG0; x <= RegI0 + 7; x++) + gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0)); + + gdbregs.regs[RegFsr] = htobe(context->readMiscRegWithEffect(MISCREG_FSR)); + gdbregs.regs[RegFprs] = htobe(context->readMiscRegWithEffect(MISCREG_FPRS)); + gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1)); + gdbregs.regs[RegState] = htobe( + context->readMiscRegWithEffect(MISCREG_CWP) | + context->readMiscRegWithEffect(MISCREG_PSTATE) << 8 | + context->readMiscRegWithEffect(MISCREG_ASI) << 24 | + context->readIntReg(NumIntArchRegs + 2) << 32); + } DPRINTF(GDBRead, "PC=%#x\n", gdbregs.regs[RegPc]); |