PERFORCE change 219898 for review

Brooks Davis brooks at FreeBSD.org
Wed Dec 12 17:54:25 UTC 2012


http://p4web.freebsd.org/@@219898?ac=10

Change 219898 by brooks at 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;
 	}


More information about the p4-projects mailing list