From patchwork Wed Feb 28 08:46:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Chestnykh X-Patchwork-Id: 1905616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=jyqZriZo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tl7Hx53FSz23qW for ; Wed, 28 Feb 2024 19:46:37 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 1AFE23530762; Wed, 28 Feb 2024 09:46:26 +0100 (CET) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=jyqZriZo; dkim-atps=neutral Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by helium.openadk.org (Postfix) with ESMTPS id 3B4D1353075C for ; Wed, 28 Feb 2024 09:46:20 +0100 (CET) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2cd3aea2621so23725641fa.1 for ; Wed, 28 Feb 2024 00:46:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709109979; x=1709714779; darn=uclibc-ng.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2x9FthfN/E6wdhUqnAUayofsK8RNPaEa33HKIOUzLDs=; b=jyqZriZov6qk+AhwB+zPYYF+kW6pWggHzc3+dLq2UTIpVKxtoXrhHWtYEE1LXzVQLZ rpn4YfRNdX70O0Hnb8RIlszZgDgprkPi9HDwTkUFnZMoDM948MaYz/wEJ0ROdZkQqJoY LxJIpPvanHRhLOiN0j9EEiMx27npe8caegGHf01n4eXRpXgAJJGtixIyk8S4a4PxW3n2 TFIyHb6mFznwrvF8G2XSR3MbXIXv4wgOfq2sVOE+rDn1sbGERzGRGoRoriDpLxE8k0Ng 1c2t92zSTvGhSOlRGPREwqEMM9xhBskOHpdCPgD2RW2VxO3opnZgKO9Iyr/Qt2yNEzqu 8HZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709109979; x=1709714779; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2x9FthfN/E6wdhUqnAUayofsK8RNPaEa33HKIOUzLDs=; b=ijFoQ5h8AGMpAneM0om/T1pBCcVQr5N2yu1TgZ3KDJTzURTGjdKb36CbPDuIc0OTmv khZjmGlG2dBbeZhvaiF6ScAbaqiQSOQ0c7ugQut9B1Cs7XCO6jxMyWenbx8y6PAJuQhy x7ltA627J52wpVDNRvUs2A2J42HceVyVFVcNQG9XgtLQdVgfz19ju9fKh1NaMYEhn1JF +hpe0zwFm5S9+NTDChP+HIRVj3OB0UQgSkLP4nvzab97INAeKLb3yYMzL6XvMKK+el7U yG2nj4t5hQrrbFCOdeeWwo3lTAUQTCqjpwelmOYdmZez+lApNQXBkjG0YFA4sk46P+eK 5pyQ== X-Gm-Message-State: AOJu0YxG2GA0GavxN/2F5TSadUrvCKT93dZnPNJm1nCZUED1x58fya8m NqIQop5smYkKV1a9GQwowC4p7Sc69qsoGptcVGB9AadECZDHuqcENVKKRqmL X-Google-Smtp-Source: AGHT+IHhy9mQ/g2xuHftNnW4gE7WVdU7jhFQIkt4KCSC0WPgMrVrNOtFM/joZ3+N3ZSTDs9l24mRvA== X-Received: by 2002:a2e:a69d:0:b0:2d2:af88:894a with SMTP id q29-20020a2ea69d000000b002d2af88894amr1296177lje.1.1709109978706; Wed, 28 Feb 2024 00:46:18 -0800 (PST) Received: from localhost.localdomain ([2a00:1370:817a:d2b8:9296:d6ce:150d:51eb]) by smtp.gmail.com with ESMTPSA id h4-20020a2e3a04000000b002d2b28a77f3sm260865lja.108.2024.02.28.00.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 00:46:18 -0800 (PST) From: Dmitry Chestnykh To: devel@uclibc-ng.org Date: Wed, 28 Feb 2024 11:46:09 +0300 Message-ID: <20240228084609.2218073-1-dm.chestnykh@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Message-ID-Hash: 2X6FDWEPOY3XSI7MBQPXJ23T6PY72YNB X-Message-ID-Hash: 2X6FDWEPOY3XSI7MBQPXJ23T6PY72YNB X-MailFrom: dm.chestnykh@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Dmitry Chestnykh X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH] Add time64 support to OpenRISC. List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Dmitry Chestnykh --- extra/Configs/Config.in | 1 + libc/sysdeps/linux/or1k/bits/kernel_stat.h | 37 +++++++++++++++++++ .../linux/or1k/bits/uClibc_arch_features.h | 3 -- 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 libc/sysdeps/linux/or1k/bits/kernel_stat.h diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index c7c502040..ded1f72c9 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -1028,6 +1028,7 @@ config UCLIBC_USE_TIME64 bool "Use *time64 syscalls instead of 32bit ones (if possible)" depends on TARGET_arm || \ (TARGET_mips && !CONFIG_MIPS_N64_ABI) || \ + TARGET_or1k || \ TARGET_powerpc || \ TARGET_xtensa # TODO: add support for other architectures diff --git a/libc/sysdeps/linux/or1k/bits/kernel_stat.h b/libc/sysdeps/linux/or1k/bits/kernel_stat.h new file mode 100644 index 000000000..cec44ecfc --- /dev/null +++ b/libc/sysdeps/linux/or1k/bits/kernel_stat.h @@ -0,0 +1,37 @@ +#ifndef _BITS_STAT_STRUCT_H +#define _BITS_STAT_STRUCT_H + +#if defined(__UCLIBC_USE_TIME64__) +#include "internal/time64_helpers.h" +#endif + +struct kernel_stat { + unsigned long st_dev; /* Device. */ + unsigned long st_ino; /* File serial number. */ + unsigned int st_mode; /* File mode. */ + unsigned int st_nlink; /* Link count. */ + unsigned int st_uid; /* User ID of the file's owner. */ + unsigned int st_gid; /* Group ID of the file's group. */ + unsigned long st_rdev; /* Device number, if device. */ + unsigned long __pad1; + long st_size; /* Size of file, in bytes. */ + int st_blksize; /* Optimal block size for I/O. */ + int __pad2; + long st_blocks; /* Number 512-byte blocks allocated. */ +#if defined(__UCLIBC_USE_TIME64__) + struct __ts32_struct __st_atim32; + struct __ts32_struct __st_mtim32; + struct __ts32_struct __st_ctim32; +#else + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; +#endif + unsigned int __unused4; + unsigned int __unused5; +}; + +#define kernel_stat64 kernel_stat + +#endif /* _BITS_STAT_STRUCT_H */ + diff --git a/libc/sysdeps/linux/or1k/bits/uClibc_arch_features.h b/libc/sysdeps/linux/or1k/bits/uClibc_arch_features.h index a9560b0b9..e11e71f88 100644 --- a/libc/sysdeps/linux/or1k/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/or1k/bits/uClibc_arch_features.h @@ -14,9 +14,6 @@ /* can your target use syscall6() for mmap ? */ #define __UCLIBC_MMAP_HAS_6_ARGS__ -/* does your target use statx */ -#undef __UCLIBC_HAVE_STATX__ - /* does your target have a broken create_module() ? */ #undef __UCLIBC_BROKEN_CREATE_MODULE__