Date: Mon, 7 Jan 2013 17:26:58 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 219955 for review Message-ID: <201301071726.r07HQwjk043458@skunkworks.freebsd.org>
index | next in thread | raw e-mail
http://p4web.freebsd.org/@@219955?ac=10 Change 219955 by brooks@brooks_zenith on 2013/01/07 17:26:50 Checkpoint a slightly less correct, but faster memcpy. Still need to switch to David's version. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/cmemcpy.h#2 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/cmemcpy.h#2 (text+ko) ==== @@ -44,9 +44,20 @@ static inline void memcpy_fromcap(void *dst, u_int creg, off_t off, size_t len) { - size_t count; + size_t count, remainder; uint8_t *v; + /* XXX: assumes the memory in the capability is 8-byte aligned */ + if (off & 0x7 == 0 && (intptr_t)dst & 0x7 == 0) { + remainder = len & 0x7; + len -= remainder; + + for (v = dst, count = 0; (count * 8) < len; v += 8, count++) + CHERI_CLD(*v, off + (count * 8), 0, creg); + len = remainder; + off += count * 8; + } + for (v = dst, count = 0; count < len; v++, count++) CHERI_CLB(*v, off + count, 0, creg); }help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301071726.r07HQwjk043458>
