Page MenuHomeFreeBSD

riscv: Implement non-stub __vdso_gettc and __vdso_gettimekeep
ClosedPublic

Authored by jrtc27 on Jun 30 2021, 3:08 PM.
Tags
None
Referenced Files
F81600303: D30963.diff
Thu, Apr 18, 6:34 PM
Unknown Object (File)
Mar 4 2024, 5:39 PM
Unknown Object (File)
Mar 4 2024, 5:39 PM
Unknown Object (File)
Feb 5 2024, 2:09 PM
Unknown Object (File)
Dec 20 2023, 4:44 AM
Unknown Object (File)
Oct 27 2023, 5:21 PM
Unknown Object (File)
Oct 27 2023, 5:21 PM
Unknown Object (File)
Oct 5 2023, 8:19 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40193
Build 37082: arc lint + arc unit

Event Timeline

lib/libc/riscv/sys/__vdso_gettc.c
48

Hm, plain csr_read might be more appropriate given the result is put in a u_int, though it's a bit academic given we don't support RV32. The two are the same on RV64 but on RV32 it'll loop until it reads a consistent time and timeh to get a 64-bit value from two 32-bit CSRs and then throw away the upper half.

Use csr_read in place of csr_read64

Thanks! I can confirm that truss no longer shows the clock_gettime() syscalls with this version of the patch.

This revision is now accepted and ready to land.Jun 30 2021, 4:35 PM
mhorne added a subscriber: mhorne.

Thanks for this one.

lib/libc/riscv/sys/__vdso_gettc.c
27

Nit: not required for new files

lib/libc/riscv/sys/__vdso_gettc.c
27

for new files that won't be MFC'd to stable/12..... I don't think this will be, given the riscv support in 12 isn't so good (IIRC, I might be wrong), but thought I'd mention in case I am wrong.

lib/libc/riscv/sys/__vdso_gettc.c
27

That's right, there's no point bringing this past stable/13, but the precision is helpful.