diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-02 06:07:38 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-02 06:07:38 -0500 |
commit | 0706a252031b3f160bac65fac00b22f8a5ebf4f9 (patch) | |
tree | 7f34dd2ef0a6d19fa5f5e1e43268d0be9a0963bb /src/mem/fs_translating_port_proxy.cc | |
parent | 9779ba2e37a753df407b976fc4b299d936ea62b8 (diff) | |
download | gem5-0706a252031b3f160bac65fac00b22f8a5ebf4f9.tar.xz |
mem: Use const pointers for port proxy write functions
This patch changes the various write functions in the port proxies
to use const pointers for all sources (similar to how memcpy works).
The one unfortunate aspect is the need for a const_cast in the packet,
to avoid having to juggle a const and a non-const data pointer. This
design decision can always be re-evaluated at a later stage.
Diffstat (limited to 'src/mem/fs_translating_port_proxy.cc')
-rw-r--r-- | src/mem/fs_translating_port_proxy.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mem/fs_translating_port_proxy.cc b/src/mem/fs_translating_port_proxy.cc index 52e8b49d8..a3229d7d1 100644 --- a/src/mem/fs_translating_port_proxy.cc +++ b/src/mem/fs_translating_port_proxy.cc @@ -89,7 +89,7 @@ FSTranslatingPortProxy::readBlob(Addr addr, uint8_t *p, int size) const } void -FSTranslatingPortProxy::writeBlob(Addr addr, uint8_t *p, int size) const +FSTranslatingPortProxy::writeBlob(Addr addr, const uint8_t *p, int size) const { Addr paddr; for (ChunkGenerator gen(addr, size, TheISA::PageBytes); !gen.done(); @@ -129,7 +129,7 @@ CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen) } void -CopyIn(ThreadContext *tc, Addr dest, void *source, size_t cplen) +CopyIn(ThreadContext *tc, Addr dest, const void *source, size_t cplen) { uint8_t *src = (uint8_t *)source; tc->getVirtProxy().writeBlob(dest, src, cplen); @@ -154,7 +154,7 @@ CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen) } void -CopyStringIn(ThreadContext *tc, char *src, Addr vaddr) +CopyStringIn(ThreadContext *tc, const char *src, Addr vaddr) { FSTranslatingPortProxy &vp = tc->getVirtProxy(); for (ChunkGenerator gen(vaddr, strlen(src), TheISA::PageBytes); !gen.done(); |