projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
POWER: Add support for the Power ISA
[gem5.git]
/
src
/
arch
/
sparc
/
remote_gdb.cc
diff --git
a/src/arch/sparc/remote_gdb.cc
b/src/arch/sparc/remote_gdb.cc
index e2ea7a84d42ec224d9edc722fe8c706952757c01..615c5b55168da8d6424b2bc4394fb7da892e64cb 100644
(file)
--- a/
src/arch/sparc/remote_gdb.cc
+++ b/
src/arch/sparc/remote_gdb.cc
@@
-30,7
+30,7
@@
/*
* Copyright (c) 1990, 1993
/*
* Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+ *
The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
@@
-38,8
+38,8
@@
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Lawrence Berkeley Laboratories.
+ *
This product includes software developed by the University of
+ *
California, Lawrence Berkeley Laboratories.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@
-51,8
+51,8
@@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
+ *
This product includes software developed by the University of
+ *
California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@
-69,7
+69,7
@@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)kgdb_stub.c 8.4 (Berkeley) 1/12/94
+ *
@(#)kgdb_stub.c 8.4 (Berkeley) 1/12/94
*/
/*-
*/
/*-
@@
-89,8
+89,8
@@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
+ *
This product includes software developed by the NetBSD
+ *
Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
@@
-130,12
+130,14
@@
#include "config/full_system.hh"
#include "cpu/thread_context.hh"
#include "cpu/static_inst.hh"
#include "config/full_system.hh"
#include "cpu/thread_context.hh"
#include "cpu/static_inst.hh"
+#include "mem/page_table.hh"
#include "mem/physical.hh"
#include "mem/port.hh"
#include "mem/physical.hh"
#include "mem/port.hh"
+#include "sim/process.hh"
#include "sim/system.hh"
using namespace std;
#include "sim/system.hh"
using namespace std;
-using namespace
The
ISA;
+using namespace
Sparc
ISA;
RemoteGDB::RemoteGDB(System *_system, ThreadContext *c)
: BaseRemoteGDB(_system, c, NumGDBRegs), nextBkpt(0)
RemoteGDB::RemoteGDB(System *_system, ThreadContext *c)
: BaseRemoteGDB(_system, c, NumGDBRegs), nextBkpt(0)
@@
-144,30
+146,39
@@
RemoteGDB::RemoteGDB(System *_system, ThreadContext *c)
///////////////////////////////////////////////////////////
// RemoteGDB::acc
//
///////////////////////////////////////////////////////////
// RemoteGDB::acc
//
-// Determine if the mapping at va..(va+len) is valid.
+//
Determine if the mapping at va..(va+len) is valid.
//
bool
RemoteGDB::acc(Addr va, size_t len)
{
//@Todo In NetBSD, this function checks if all addresses
//
bool
RemoteGDB::acc(Addr va, size_t len)
{
//@Todo In NetBSD, this function checks if all addresses
- //from va to va + len have valid page map
e
entries. Not
+ //from va to va + len have valid page map entries. Not
//sure how this will work for other OSes or in general.
//sure how this will work for other OSes or in general.
+#if FULL_SYSTEM
if (va)
return true;
return false;
if (va)
return true;
return false;
+#else
+ TlbEntry entry;
+ //Check to make sure the first byte is mapped into the processes address
+ //space.
+ if (context->getProcessPtr()->pTable->lookup(va, entry))
+ return true;
+ return false;
+#endif
}
///////////////////////////////////////////////////////////
// RemoteGDB::getregs
//
}
///////////////////////////////////////////////////////////
// RemoteGDB::getregs
//
-// Translate the kernel debugger register format into
-// the GDB register format.
+//
Translate the kernel debugger register format into
+//
the GDB register format.
void
RemoteGDB::getregs()
{
memset(gdbregs.regs, 0, gdbregs.size);
void
RemoteGDB::getregs()
{
memset(gdbregs.regs, 0, gdbregs.size);
- if (context->readMiscReg
WithEffect
(MISCREG_PSTATE) &
+ if (context->readMiscReg(MISCREG_PSTATE) &
PSTATE::am) {
uint32_t *regs;
regs = (uint32_t*)gdbregs.regs;
PSTATE::am) {
uint32_t *regs;
regs = (uint32_t*)gdbregs.regs;
@@
-177,8
+188,8
@@
RemoteGDB::getregs()
regs[x] = htobe((uint32_t)context->readIntReg(x - RegG0));
regs[Reg32Y] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 1));
regs[x] = htobe((uint32_t)context->readIntReg(x - RegG0));
regs[Reg32Y] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 1));
- regs[Reg32Psr] = htobe((uint32_t)context->readMiscReg
WithEffect
(MISCREG_PSTATE));
- regs[Reg32Fsr] = htobe((uint32_t)context->readMiscReg
WithEffect
(MISCREG_FSR));
+ regs[Reg32Psr] = htobe((uint32_t)context->readMiscReg(MISCREG_PSTATE));
+ regs[Reg32Fsr] = htobe((uint32_t)context->readMiscReg(MISCREG_FSR));
regs[Reg32Csr] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 2));
} else {
gdbregs.regs[RegPc] = htobe(context->readPC());
regs[Reg32Csr] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 2));
} else {
gdbregs.regs[RegPc] = htobe(context->readPC());
@@
-186,13
+197,13
@@
RemoteGDB::getregs()
for(int x = RegG0; x <= RegI0 + 7; x++)
gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0));
for(int x = RegG0; x <= RegI0 + 7; x++)
gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0));
- gdbregs.regs[RegFsr] = htobe(context->readMiscReg
WithEffect
(MISCREG_FSR));
- gdbregs.regs[RegFprs] = htobe(context->readMiscReg
WithEffect
(MISCREG_FPRS));
+ gdbregs.regs[RegFsr] = htobe(context->readMiscReg(MISCREG_FSR));
+ gdbregs.regs[RegFprs] = htobe(context->readMiscReg(MISCREG_FPRS));
gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1));
gdbregs.regs[RegState] = htobe(
gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1));
gdbregs.regs[RegState] = htobe(
- context->readMiscReg
WithEffect
(MISCREG_CWP) |
- context->readMiscReg
WithEffect
(MISCREG_PSTATE) << 8 |
- context->readMiscReg
WithEffect
(MISCREG_ASI) << 24 |
+ context->readMiscReg(MISCREG_CWP) |
+ context->readMiscReg(MISCREG_PSTATE) << 8 |
+ context->readMiscReg(MISCREG_ASI) << 24 |
context->readIntReg(NumIntArchRegs + 2) << 32);
}
context->readIntReg(NumIntArchRegs + 2) << 32);
}
@@
-206,8
+217,8
@@
RemoteGDB::getregs()
///////////////////////////////////////////////////////////
// RemoteGDB::setregs
//
///////////////////////////////////////////////////////////
// RemoteGDB::setregs
//
-// Translate the GDB register format into the kernel
-// debugger register format.
+//
Translate the GDB register format into the kernel
+//
debugger register format.
//
void
RemoteGDB::setregs()
//
void
RemoteGDB::setregs()