Skip to content
Snippets Groups Projects
Unverified Commit 52420e48 authored by Palmer Dabbelt's avatar Palmer Dabbelt
Browse files

RISC-V: Provide the frequency of time CSR via hwprobe


The RISC-V architecture makes a real time counter CSR (via RDTIME
instruction) available for applications in U-mode but there is no
architected mechanism for an application to discover the frequency
the counter is running at. Some applications (e.g., DPDK) use the
time counter for basic performance analysis as well as fine grained
time-keeping.

Add support to the hwprobe system call to export the time CSR
frequency to code running in U-mode.

Signed-off-by: default avatarYunhui Cui <cuiyunhui@bytedance.com>
Reviewed-by: default avatarEvan Green <evan@rivosinc.com>
Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
Acked-by: default avatarPunit Agrawal <punit.agrawal@bytedance.com>
Link: https://lore.kernel.org/r/20240702033731.71955-2-cuiyunhui@bytedance.com


Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 5c8405d7
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment