RISC-V: Implement get_cyclecount(9).
Add the missing implementation for get_cyclecount(9) on RISC-V by reading the cycle CSR. Submitted by: Mitchell Horne <mhorne063@gmail.com> Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17953
This commit is contained in:
parent
1e2ceeb16a
commit
6f8ba91638
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340400
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user