public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: caiyinyu <caiyinyu@loongson.cn>
To: adhemerval.zanella@linaro.org, libc-alpha@sourceware.org,
	i.swmail@xen0n.name
Cc: joseph_myers@mentor.com, carlos@redhat.com,
	xuchenghua@loongson.cn, caiyinyu <caiyinyu@loongson.cn>
Subject: [PATCH 1/3] LoongArch: Add vdso support for gettimeofday.
Date: Thu, 28 Jul 2022 15:30:07 +0800	[thread overview]
Message-ID: <20220728073009.2588790-2-caiyinyu@loongson.cn> (raw)
In-Reply-To: <20220728073009.2588790-1-caiyinyu@loongson.cn>

---
 .../unix/sysv/linux/loongarch/gettimeofday.c  | 22 +++++++++++++++++++
 sysdeps/unix/sysv/linux/loongarch/sysdep.h    |  1 +
 2 files changed, 23 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/loongarch/gettimeofday.c

diff --git a/sysdeps/unix/sysv/linux/loongarch/gettimeofday.c b/sysdeps/unix/sysv/linux/loongarch/gettimeofday.c
new file mode 100644
index 0000000000..ee35a08650
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/gettimeofday.c
@@ -0,0 +1,22 @@
+/* gettimeofday -- Get the current time of day.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+
+#define USE_IFUNC_GETTIMEOFDAY
+#include <sysdeps/unix/sysv/linux/gettimeofday.c>
diff --git a/sysdeps/unix/sysv/linux/loongarch/sysdep.h b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
index c586df819c..306e0af3a3 100644
--- a/sysdeps/unix/sysv/linux/loongarch/sysdep.h
+++ b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
@@ -116,6 +116,7 @@
 /* List of system calls which are supported as vsyscalls.  */
 #define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"
 #define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime"
+#define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"
 #define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
 
 #define HAVE_CLONE3_WRAPPER 1
-- 
2.31.1


  reply	other threads:[~2022-07-28  7:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28  7:30 [PATCH 0/3] GLIBC LOONGARCH PATCHES caiyinyu
2022-07-28  7:30 ` caiyinyu [this message]
2022-07-28 12:58   ` [PATCH 1/3] LoongArch: Add vdso support for gettimeofday Adhemerval Zanella Netto
2022-07-29 15:10     ` Carlos O'Donell
2022-08-03  3:12       ` caiyinyu
2022-07-28  7:30 ` [PATCH 2/3] LoongArch: Fix VDSO_HASH and VDSO_NAME caiyinyu
2022-07-28 12:57   ` Adhemerval Zanella Netto
2022-07-28  7:30 ` [PATCH 3/3] LoongArch: Add greg_t and gregset_t caiyinyu
2022-07-28 12:57   ` Adhemerval Zanella Netto
2022-07-28 12:53 ` [PATCH 0/3] GLIBC LOONGARCH PATCHES Adhemerval Zanella Netto

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=20220728073009.2588790-2-caiyinyu@loongson.cn \
    --to=caiyinyu@loongson.cn \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=i.swmail@xen0n.name \
    --cc=joseph_myers@mentor.com \
    --cc=libc-alpha@sourceware.org \
    --cc=xuchenghua@loongson.cn \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).