summaryrefslogtreecommitdiff
path: root/src/sim/pseudo_inst.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-05-01 21:43:09 -0700
committerGabe Black <gabeblack@google.com>2019-05-30 06:07:33 +0000
commit096598c05a6c352bfd4b93adf06143a43a8f4e11 (patch)
tree1dcbf980d846035fed6554ae00ca1d2669072b51 /src/sim/pseudo_inst.cc
parentda7e63d088cd1710ee4f55f7c5481df4fa95e531 (diff)
downloadgem5-096598c05a6c352bfd4b93adf06143a43a8f4e11.tar.xz
arch, base, sim: Replace Copy(String)?(In|Out) with equivalent code.
This expands those functions into code which extracts the virt proxy and then uses the appropriate method on it. This has two benefits. First, the Copy* functions where mostly redundant wrappers around the methods the proxy port already had. Second, using them forced a particular port which might not actually be what the user wanted. Change-Id: I62084631dd080061e3c74997125164f40da2d77c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18575 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/sim/pseudo_inst.cc')
-rw-r--r--src/sim/pseudo_inst.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc
index 8ffb13e3b..92886dacb 100644
--- a/src/sim/pseudo_inst.cc
+++ b/src/sim/pseudo_inst.cc
@@ -377,9 +377,8 @@ addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
if (!FullSystem)
panicFsOnlyPseudoInst("addSymbol");
- char symb[100];
- CopyStringOut(tc, symb, symbolAddr, 100);
- std::string symbol(symb);
+ std::string symbol;
+ tc->getVirtProxy().readString(symbol, symbolAddr);
DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
@@ -525,7 +524,7 @@ readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
}
close(fd);
- CopyIn(tc, vaddr, buf, result);
+ tc->getVirtProxy().writeBlob(vaddr, buf, result);
delete [] buf;
return result;
}
@@ -538,10 +537,8 @@ writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset,
vaddr, len, offset, filename_addr);
// copy out target filename
- char fn[100];
std::string filename;
- CopyStringOut(tc, fn, filename_addr, 100);
- filename = std::string(fn);
+ tc->getVirtProxy().readString(filename, filename_addr);
OutputStream *out;
if (offset == 0) {
@@ -563,7 +560,7 @@ writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset,
// copy out data and write to file
char *buf = new char[len];
- CopyOut(tc, buf, vaddr, len);
+ tc->getVirtProxy().readBlob(vaddr, buf, len);
os->write(buf, len);
if (os->fail() || os->bad())
panic("Error while doing writefile!\n");