}
return true;
}
-
-void
-CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen)
-{
- uint8_t *dst = (uint8_t *)dest;
- tc->getVirtProxy().readBlob(src, dst, cplen);
-}
-
-void
-CopyIn(ThreadContext *tc, Addr dest, const void *source, size_t cplen)
-{
- uint8_t *src = (uint8_t *)source;
- tc->getVirtProxy().writeBlob(dest, src, cplen);
-}
-
-void
-CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen)
-{
- char *start = dst;
- FSTranslatingPortProxy &vp = tc->getVirtProxy();
-
- bool foundNull = false;
- while ((dst - start + 1) < maxlen && !foundNull) {
- vp.readBlob(vaddr++, (uint8_t*)dst, 1);
- if (*dst == '\0')
- foundNull = true;
- dst++;
- }
-
- if (!foundNull)
- *dst = '\0';
-}
-
-void
-CopyStringIn(ThreadContext *tc, const char *src, Addr vaddr)
-{
- FSTranslatingPortProxy &vp = tc->getVirtProxy();
- for (ChunkGenerator gen(vaddr, strlen(src), TheISA::PageBytes); !gen.done();
- gen.next())
- {
- vp.writeBlob(gen.addr(), (uint8_t*)src, gen.size());
- src += gen.size();
- }
-}
bool tryMemsetBlob(Addr address, uint8_t v, int size) const override;
};
-void CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen);
-void CopyIn(ThreadContext *tc, Addr dest, const void *source, size_t cplen);
-void CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen);
-void CopyStringIn(ThreadContext *tc, const char *src, Addr vaddr);
-
#endif //__MEM_FS_TRANSLATING_PORT_PROXY_HH__