Date: Wed, 12 Dec 2012 17:54:24 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 219898 for review Message-ID: <201212121754.qBCHsOso096574@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219898?ac=10 Change 219898 by brooks@brooks_zenith on 2012/12/12 17:53:37 Add a sysarch MIPS_GET_COUNT to access the cycle counter. Ideally we should use rdhwr to read it directly by BERI/CHERI doesn't have that yet. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/mips/include/sysarch.h#2 edit .. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/sys_machdep.c#3 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/include/sysarch.h#2 (text+ko) ==== @@ -37,6 +37,7 @@ #define MIPS_SET_TLS 1 #define MIPS_GET_TLS 2 +#define MIPS_GET_COUNT 3 #ifndef _KERNEL #include <sys/cdefs.h> ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/sys_machdep.c#3 (text+ko) ==== @@ -56,6 +56,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) { int error; + uint32_t count; void *tlsbase; switch (uap->op) { @@ -66,6 +67,10 @@ tlsbase = td->td_md.md_tls; error = copyout(&tlsbase, uap->parms, sizeof(tlsbase)); return (error); + case MIPS_GET_COUNT: + count = mips_rd_count(); + error = copyout(&count, uap->parms, sizeof(count)); + return (error); default: break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212121754.qBCHsOso096574>
