Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6132494rwd; Wed, 24 May 2023 11:07:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+9s6hc5v3s4ELlNeRshybn/ecr+YVPfiONm6lemPT/1dyHzQEk1cQGZ1x/gPR8+CAUSUn X-Received: by 2002:a05:6a20:4315:b0:ef:7aa2:3cfd with SMTP id h21-20020a056a20431500b000ef7aa23cfdmr17615063pzk.50.1684951667286; Wed, 24 May 2023 11:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684951667; cv=none; d=google.com; s=arc-20160816; b=KJtyXxhDO4bpr2F6CR1XgKQctV4yVLA5FK67xmtMgfzK++76DcOENHzZl81WBk6xsI HQtbXUyTBGqcDaKI7+ZvD5VWlX4W5PvDvLoD0WHTD+ubyhS6K4V7UKm8BXuz6TDLdup5 ruQF5k8S0JjQ02XiO2CptUyheby3vamQjetj6MNH+zHzYhhbw2jXgXWNdtHAmUkEMko5 LXXKLYtXg6oy1GMjQ259itGBBu2mPoTBJf5OJe2q4cqMIG1P82mma8ua9c2PaBm7RBC/ VcXXC+em4kLUGpCS1cx5b/Suns6TBtORSRauqm1qv4OjNdGjfqCOuvyBmla6HHoPN3wn rqfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=HPJr/DpWViA+XYl4F3WHI6QuRSFbuhfB5M20FaHKjx8=; b=DJIhoe4nyEkuVS5Jx5hkFCCxSnrC32CpU8YvfHEp8rmNeiGtvqQHnM+uqyKWbygwFg 22PnDcr2ezQN5xcCumMfVVE9ZzqzXT3AThlinWqt4GRNlNRCNsY1HA127dBRK1OjHGWg K4hFWRzUYy42ShyXPrGDmdDxbR9FJZ33cYF57YvFYXyQzaiao0U7bWXH+5wxSKbumQIk xb3nH3wdK+B8mdWXlDekw7ODxfsOdqbx8hIW1+E3kfb7L3zNxSvmBVA0nw+npkLjCZGC ddTRTHaxeKBiOmv2eOT8781NsFa72UtqOm1cQFv/Ol0a3L9Vgaer8bBCRcmWV3xxpAUP sHSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs129-20020a632887000000b00519a8f54d2esi3947593pgb.479.2023.05.24.11.07.32; Wed, 24 May 2023 11:07:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236456AbjEXR5l (ORCPT + 99 others); Wed, 24 May 2023 13:57:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231658AbjEXR5j (ORCPT ); Wed, 24 May 2023 13:57:39 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BA398; Wed, 24 May 2023 10:57:36 -0700 (PDT) X-QQ-mid: bizesmtp69t1684951051toedm1f2 Received: from linux-lab-host.localdomain ( [116.30.125.36]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 25 May 2023 01:57:30 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: 1U/NVTUyJNR0Bdf3bNTIg9tVMMQ36KW+m0gOe7QYfuSjie+syXUksgUIyPwT9 XfFw8T5ZcY0Gquio8enXfYroGAwnsHycofnfTqboltbdqCDUUnRUVfDdQvLU4WvGApwZDmN bAN6znioI8PEsk337ISXWj6upRE/YjYx52ag3fsAJyiq4tZ26fjpekhGMHr/nYoxUoDKTYU 6S9Cj0J1aASneoJI34cnjcZTI00YRCWzxAihgavquQbYb9F5spPI4fNfgj/l9yZIVq6KWXo a6u2uupdH0bFQEDqTZhEIceDjXFL2DwMqyhdHjNld9/7nfjCGEzUsIU/oflxOuhOMH7GnTA mW8SbP+DccbvKioNg2HMYwFQW6yUW75OfYEsj38yT1ZpwZ2SpCTFlWISeGvAQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 7132561189251988013 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com, thomas@t-8ch.de Subject: [PATCH 09/13] tools/nolibc: sys_poll: riscv: use __NR_ppoll_time64 for rv32 Date: Thu, 25 May 2023 01:57:24 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rv32 uses the generic include/uapi/asm-generic/unistd.h and it has no __NR_ppoll after kernel commit d4c08b9776b3 ("riscv: Use latest system call ABI"), use __NR_ppoll_time64 instead. Signed-off-by: Zhangjin Wu --- tools/include/nolibc/std.h | 1 + tools/include/nolibc/sys.h | 7 ++++++- tools/include/nolibc/types.h | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/include/nolibc/std.h b/tools/include/nolibc/std.h index 83c0b0cb9564..221385c0e823 100644 --- a/tools/include/nolibc/std.h +++ b/tools/include/nolibc/std.h @@ -32,6 +32,7 @@ typedef signed long off_t; typedef signed long blksize_t; typedef signed long blkcnt_t; typedef signed long time_t; +typedef long long time64_t; typedef long long loff_t; #endif /* _NOLIBC_STD_H */ diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 0ff77c0a06d7..08d38175bd7b 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -923,8 +923,13 @@ int pivot_root(const char *new, const char *old) static __attribute__((unused)) int sys_poll(struct pollfd *fds, int nfds, int timeout) { -#if defined(__NR_ppoll) +#if defined(__NR_ppoll) || defined(__NR_ppoll_time64) +#ifdef __NR_ppoll struct timespec t; +#else + struct timespec64 t; +#define __NR_ppoll __NR_ppoll_time64 +#endif if (timeout >= 0) { t.tv_sec = timeout / 1000; diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 15b0baffd336..ee914391439c 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -203,6 +203,12 @@ struct stat { time_t st_ctime; /* time of last status change */ }; +/* needed by time64 syscalls */ +struct timespec64 { + time64_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; + /* WARNING, it only deals with the 4096 first majors and 256 first minors */ #define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff))) #define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff)) -- 2.25.1