mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Kevin <kevin@liao.gg>
To: musl@lists.openwall.com
Subject: [musl] [PATCH] Add clock_gettime VDSO support for Riscv64
Date: Wed, 18 Sep 2024 02:08:02 +0800	[thread overview]
Message-ID: <CAAi9v1kpNPQ_mvL0uw0cLuVfhBQCDjd3McMeMS1jebhfpxo7eA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

Hello,

Currently, musl on Riscv64 does not implement VDSO for the clock_gettime
function call. The following patch should fix it. (Rudimentary testing on a
Riscv64 virtual machine confirms this works.) A similar patch could
probably be made for Riscv32. This patch was made based on information
from: https://man7.org/linux/man-pages/man7/vdso.7.html

Please CC me on replies.

---
 arch/riscv64/syscall_arch.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/riscv64/syscall_arch.h b/arch/riscv64/syscall_arch.h
index 7fd042cd..81993fc8 100644
--- a/arch/riscv64/syscall_arch.h
+++ b/arch/riscv64/syscall_arch.h
@@ -71,8 +71,7 @@ static inline long __syscall6(long n, long a, long b,
long c, long d, long e, lo
 }

 #define VDSO_USEFUL
-/* We don't have a clock_gettime function.
 #define VDSO_CGT_SYM "__vdso_clock_gettime"
-#define VDSO_CGT_VER "LINUX_2.6" */
+#define VDSO_CGT_VER "LINUX_4.15"

 #define IPC_64 0
-- 
2.34.1

[-- Attachment #2: Type: text/html, Size: 1205 bytes --]

             reply	other threads:[~2024-09-17 18:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-17 18:08 Kevin [this message]
2024-09-17 20:43 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAi9v1kpNPQ_mvL0uw0cLuVfhBQCDjd3McMeMS1jebhfpxo7eA@mail.gmail.com \
    --to=kevin@liao.gg \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).