Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2018 17:03:15 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341081 - stable/12/sys/riscv/include
Message-ID:  <201811271703.wARH3FQ8050984@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Nov 27 17:03:15 2018
New Revision: 341081
URL: https://svnweb.freebsd.org/changeset/base/341081

Log:
  MFC r340400:
  RISC-V: Implement get_cyclecount(9).

Modified:
  stable/12/sys/riscv/include/cpu.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/riscv/include/cpu.h
==============================================================================
--- stable/12/sys/riscv/include/cpu.h	Tue Nov 27 17:02:15 2018	(r341080)
+++ stable/12/sys/riscv/include/cpu.h	Tue Nov 27 17:03:15 2018	(r341081)
@@ -38,6 +38,7 @@
 #define	_MACHINE_CPU_H_
 
 #include <machine/atomic.h>
+#include <machine/cpufunc.h>
 #include <machine/frame.h>
 
 #define	TRAPF_PC(tfp)		((tfp)->tf_ra)
@@ -86,8 +87,7 @@ static __inline uint64_t
 get_cyclecount(void)
 {
 
-	/* TODO: This is bogus */
-	return (1);
+	return (rdcycle());
 }
 
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811271703.wARH3FQ8050984>