diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2008-07-01 10:24:19 -0400 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2008-07-01 10:24:19 -0400 |
commit | c5fbbf376a6be4bb3ad7ddc64841450541c16db6 (patch) | |
tree | b7038e333bdc574d1338de4d136aeeb80ce27819 /src | |
parent | 50e3e50e1ac592b357a47eecdc3c99a528172870 (diff) | |
download | gem5-c5fbbf376a6be4bb3ad7ddc64841450541c16db6.tar.xz |
Change everything to use the cached virtPort rather than created their own each time.
This appears to work, but I don't want to commit it until it gets tested a lot more.
I haven't deleted the functionality in this patch that will come later, but one question
is how to enforce encourage objects that call getVirtPort() to not cache the virtual port
since if the CPU changes out from under them it will be worse than useless. Perhaps a null
function like delVirtPort() is still useful in that case.
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/alpha/utility.cc | 2 | ||||
-rw-r--r-- | src/arch/mips/utility.cc | 2 | ||||
-rw-r--r-- | src/arch/sparc/utility.cc | 2 | ||||
-rw-r--r-- | src/base/remote_gdb.cc | 4 | ||||
-rw-r--r-- | src/mem/vport.cc | 8 | ||||
-rw-r--r-- | src/sim/vptr.hh | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/arch/alpha/utility.cc b/src/arch/alpha/utility.cc index f1864203b..94e82adf3 100644 --- a/src/arch/alpha/utility.cc +++ b/src/arch/alpha/utility.cc @@ -49,7 +49,7 @@ uint64_t getArgument(ThreadContext *tc, int number, bool fp) return tc->readIntReg(ArgumentReg[number]); } else { Addr sp = tc->readIntReg(StackPointerReg); - VirtualPort *vp = tc->getVirtPort(tc); + VirtualPort *vp = tc->getVirtPort(); uint64_t arg = vp->read<uint64_t>(sp + (number-NumArgumentRegs) * sizeof(uint64_t)); tc->delVirtPort(vp); diff --git a/src/arch/mips/utility.cc b/src/arch/mips/utility.cc index c254811fa..52c52f8e7 100644 --- a/src/arch/mips/utility.cc +++ b/src/arch/mips/utility.cc @@ -59,7 +59,7 @@ getArgument(ThreadContext *tc, int number, bool fp) return tc->readIntReg(ArgumentReg[number]); } else { Addr sp = tc->readIntReg(StackPointerReg); - VirtualPort *vp = tc->getVirtPort(tc); + VirtualPort *vp = tc->getVirtPort(); uint64_t arg = vp->read<uint64_t>(sp + (number-NumArgumentRegs) * sizeof(uint64_t)); tc->delVirtPort(vp); diff --git a/src/arch/sparc/utility.cc b/src/arch/sparc/utility.cc index 6d4358603..0677823af 100644 --- a/src/arch/sparc/utility.cc +++ b/src/arch/sparc/utility.cc @@ -50,7 +50,7 @@ uint64_t getArgument(ThreadContext *tc, int number, bool fp) { return tc->readIntReg(ArgumentReg[number]); } else { Addr sp = tc->readIntReg(StackPointerReg); - VirtualPort *vp = tc->getVirtPort(tc); + VirtualPort *vp = tc->getVirtPort(); uint64_t arg = vp->read<uint64_t>(sp + 92 + (number-NumArgumentRegs) * sizeof(uint64_t)); tc->delVirtPort(vp); diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc index d5095e7f9..1a858a3f3 100644 --- a/src/base/remote_gdb.cc +++ b/src/base/remote_gdb.cc @@ -454,7 +454,7 @@ BaseRemoteGDB::read(Addr vaddr, size_t size, char *data) DPRINTF(GDBRead, "read: addr=%#x, size=%d", vaddr, size); #if FULL_SYSTEM - VirtualPort *port = context->getVirtPort(context); + VirtualPort *port = context->getVirtPort(); #else TranslatingPort *port = context->getMemPort(); #endif @@ -499,7 +499,7 @@ BaseRemoteGDB::write(Addr vaddr, size_t size, const char *data) DPRINTFNR("\n"); } #if FULL_SYSTEM - VirtualPort *port = context->getVirtPort(context); + VirtualPort *port = context->getVirtPort(); #else TranslatingPort *port = context->getMemPort(); #endif diff --git a/src/mem/vport.cc b/src/mem/vport.cc index 6cc4d9ca9..a2f8b1ecc 100644 --- a/src/mem/vport.cc +++ b/src/mem/vport.cc @@ -75,7 +75,7 @@ void CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen) { uint8_t *dst = (uint8_t *)dest; - VirtualPort *vp = tc->getVirtPort(tc); + VirtualPort *vp = tc->getVirtPort(); vp->readBlob(src, dst, cplen); @@ -87,7 +87,7 @@ void CopyIn(ThreadContext *tc, Addr dest, void *source, size_t cplen) { uint8_t *src = (uint8_t *)source; - VirtualPort *vp = tc->getVirtPort(tc); + VirtualPort *vp = tc->getVirtPort(); vp->writeBlob(dest, src, cplen); @@ -99,7 +99,7 @@ CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen) { int len = 0; char *start = dst; - VirtualPort *vp = tc->getVirtPort(tc); + VirtualPort *vp = tc->getVirtPort(); do { vp->readBlob(vaddr++, (uint8_t*)dst++, 1); @@ -112,7 +112,7 @@ CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen) void CopyStringIn(ThreadContext *tc, char *src, Addr vaddr) { - VirtualPort *vp = tc->getVirtPort(tc); + VirtualPort *vp = tc->getVirtPort(); for (ChunkGenerator gen(vaddr, strlen(src), TheISA::PageBytes); !gen.done(); gen.next()) { diff --git a/src/sim/vptr.hh b/src/sim/vptr.hh index 383f65351..88b515c13 100644 --- a/src/sim/vptr.hh +++ b/src/sim/vptr.hh @@ -71,7 +71,7 @@ class VPtr if (!ptr) return; - VirtualPort *port = tc->getVirtPort(tc); + VirtualPort *port = tc->getVirtPort(); port->readBlob(ptr, buffer, sizeof(T)); tc->delVirtPort(port); } |