summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-05-01 20:14:13 -0700
committerGabe Black <gabeblack@google.com>2019-05-29 04:23:46 +0000
commit8666440499ef5b175b16efcf9d3a53f0583f0c45 (patch)
tree8fa4310dcd56908d5c8efbca3854c7444770c8e7 /src/sim
parentd7c4cad240fd4f378d7362da5e9e44b9f0dd80d3 (diff)
downloadgem5-8666440499ef5b175b16efcf9d3a53f0583f0c45.tar.xz
arch, base, dev, sim: Remove now unnecessary casts from PortProxy methods.
Change-Id: Ia73b2d86a10d02fa09c924a4571477bb5f200eb7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18572 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/process_impl.hh5
-rw-r--r--src/sim/syscall_emul.hh10
2 files changed, 7 insertions, 8 deletions
diff --git a/src/sim/process_impl.hh b/src/sim/process_impl.hh
index 3f3d6ae15..ae2a3b571 100644
--- a/src/sim/process_impl.hh
+++ b/src/sim/process_impl.hh
@@ -47,8 +47,7 @@ copyStringArray(std::vector<std::string> &strings,
AddrType data_ptr_swap;
for (std::vector<std::string>::size_type i = 0; i < strings.size(); ++i) {
data_ptr_swap = TheISA::htog(data_ptr);
- memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr_swap,
- sizeof(AddrType));
+ memProxy.writeBlob(array_ptr, &data_ptr_swap, sizeof(AddrType));
memProxy.writeString(data_ptr, strings[i].c_str());
array_ptr += sizeof(AddrType);
data_ptr += strings[i].size() + 1;
@@ -56,7 +55,7 @@ copyStringArray(std::vector<std::string> &strings,
// add NULL terminator
data_ptr = 0;
- memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType));
+ memProxy.writeBlob(array_ptr, &data_ptr, sizeof(AddrType));
}
#endif
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 2230b62c0..dbbdf4734 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1670,7 +1670,7 @@ readvFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
struct iovec hiov[count];
for (size_t i = 0; i < count; ++i) {
prox.readBlob(tiov_base + (i * sizeof(typename OS::tgt_iovec)),
- (uint8_t*)&tiov[i], sizeof(typename OS::tgt_iovec));
+ &tiov[i], sizeof(typename OS::tgt_iovec));
hiov[i].iov_len = TheISA::gtoh(tiov[i].iov_len);
hiov[i].iov_base = new char [hiov[i].iov_len];
}
@@ -1681,7 +1681,7 @@ readvFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
for (size_t i = 0; i < count; ++i) {
if (result != -1) {
prox.writeBlob(TheISA::htog(tiov[i].iov_base),
- (uint8_t*)hiov[i].iov_base, hiov[i].iov_len);
+ hiov[i].iov_base, hiov[i].iov_len);
}
delete [] (char *)hiov[i].iov_base;
}
@@ -1711,10 +1711,10 @@ writevFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
typename OS::tgt_iovec tiov;
prox.readBlob(tiov_base + i*sizeof(typename OS::tgt_iovec),
- (uint8_t*)&tiov, sizeof(typename OS::tgt_iovec));
+ &tiov, sizeof(typename OS::tgt_iovec));
hiov[i].iov_len = TheISA::gtoh(tiov.iov_len);
hiov[i].iov_base = new char [hiov[i].iov_len];
- prox.readBlob(TheISA::gtoh(tiov.iov_base), (uint8_t *)hiov[i].iov_base,
+ prox.readBlob(TheISA::gtoh(tiov.iov_base), hiov[i].iov_base,
hiov[i].iov_len);
}
@@ -2302,7 +2302,7 @@ timeFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
typename OS::time_t t = sec;
t = TheISA::htog(t);
SETranslatingPortProxy &p = tc->getMemProxy();
- p.writeBlob(taddr, (uint8_t*)&t, (int)sizeof(typename OS::time_t));
+ p.writeBlob(taddr, &t, (int)sizeof(typename OS::time_t));
}
return sec;
}