From patchwork Mon Feb 3 18:31:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1232967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109128-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=siIa1e2X; dkim=pass (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=d4mQ5R5e; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48BGn46vC0z9sRK for ; Tue, 4 Feb 2020 05:38:48 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=Y3TbE60kD8qwNIE7AM+QrH3N3TbaP2LzwGiMQclnnesstr1o8wp5e 6aKBYCxoddGSrzRTkmnZH4KAYdfY7Vn7I4pf0BntkwqiKRv2Jjc0GS14Y7rOTcRw eNoDWnd7t8ieDHpBAkLGraH53GtAqkEkEnWmqGglo7ZdhwU5r9ZtQY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=B5cw1JfXmFTONKVTaWiZGIxYFUE=; b=siIa1e2XGbId3wEV0PReCKjhVb+7 ENxjRDWfj8wECZXOpbddoorA31EuDNbv+KmCUS9sYwIOU7OgSiFAQZir0ArmPv9w yyNJkOaEJX/WAaJjq6DY1FopC9R9xjqM0BQVkaIj5WWN+2UqfK6fZfyOGrtLfQo/ Lu/NG/OgsjcYdXI= Received: (qmail 23942 invoked by alias); 3 Feb 2020 18:38:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 23907 invoked by uid 89); 3 Feb 2020 18:38:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=5713, 1167, HContent-Transfer-Encoding:8bit X-HELO: esa3.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1580755120; x=1612291120; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aFkncfqOejmSQxT3Rs2LJkFDBePoG2PJrEb86n0KPf0=; b=d4mQ5R5exmz/kaDa0VezBvuUgVY2a0TLndKyqFuud6smigoeOOwm8h5z SuxnGnOhwNTGmKm1SqjNvJXbRZQ9Mxjcy4dkxDarWtYnoD9Bqaw3GWae6 QnaHtyXTkloJ644qXV1lYShmiYat7S1A83xTkCNnBUMeSN9zTer3LB4BM UMQKT8KVIuZbh9AwKZuK31pNYEHMqO8gvbFJjBWfLXy8AuqDwnIWOPdQU sZyOaJ/CNqQoTulZ+T1PYZEzlBn+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: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, lukma@denx.de, Alistair Francis Subject: [PATCH 1/6] sysv/linux: Rename alpha functions to be alpha specific Date: Mon, 3 Feb 2020 10:31:48 -0800 Message-Id: <20200203183153.11635-2-alistair.francis@wdc.com> In-Reply-To: <20200203183153.11635-1-alistair.francis@wdc.com> References: <20200203183153.11635-1-alistair.francis@wdc.com> MIME-Version: 1.0 These functions are alpha specifc, rename them to be clear. Reviewed-by: Lukasz Majewski --- sysdeps/unix/sysv/linux/alpha/osf_adjtime.c | 8 ++++---- sysdeps/unix/sysv/linux/alpha/osf_getitimer.c | 4 ++-- sysdeps/unix/sysv/linux/alpha/osf_getrusage.c | 2 +- sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c | 2 +- sysdeps/unix/sysv/linux/alpha/osf_setitimer.c | 8 ++++---- sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c | 2 +- sysdeps/unix/sysv/linux/alpha/osf_utimes.c | 4 ++-- sysdeps/unix/sysv/linux/alpha/osf_wait4.c | 2 +- sysdeps/unix/sysv/linux/alpha/tv32-compat.h | 14 +++++++------- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/osf_adjtime.c b/sysdeps/unix/sysv/linux/alpha/osf_adjtime.c index 9825a4734d..bd8fe5f92d 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_adjtime.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_adjtime.c @@ -57,13 +57,13 @@ int attribute_compat_text_section __adjtime_tv32 (const struct timeval32 *itv, struct timeval32 *otv) { - struct timeval itv64 = valid_timeval32_to_timeval (*itv); + struct timeval itv64 = alpha_valid_timeval32_to_timeval (*itv); struct timeval otv64; if (__adjtime (&itv64, &otv64) == -1) return -1; - *otv = valid_timeval_to_timeval32 (otv64); + *otv = alpha_valid_timeval_to_timeval32 (otv64); return 0; } @@ -91,7 +91,7 @@ __adjtimex_tv32 (struct timex32 *tx) tx64.calcnt = tx->calcnt; tx64.errcnt = tx->errcnt; tx64.stbcnt = tx->stbcnt; - tx64.time = valid_timeval32_to_timeval (tx->time); + tx64.time = alpha_valid_timeval32_to_timeval (tx->time); int status = __adjtimex (&tx64); if (status < 0) @@ -116,7 +116,7 @@ __adjtimex_tv32 (struct timex32 *tx) tx->calcnt = tx64.calcnt; tx->errcnt = tx64.errcnt; tx->stbcnt = tx64.stbcnt; - tx->time = valid_timeval_to_timeval32 (tx64.time); + tx->time = alpha_valid_timeval_to_timeval32 (tx64.time); return status; } diff --git a/sysdeps/unix/sysv/linux/alpha/osf_getitimer.c b/sysdeps/unix/sysv/linux/alpha/osf_getitimer.c index e9de2b287b..3c1bfdca38 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_getitimer.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_getitimer.c @@ -33,9 +33,9 @@ __getitimer_tv32 (int which, struct itimerval32 *curr_value) /* Write all fields of 'curr_value' regardless of overflow. */ curr_value->it_interval - = valid_timeval_to_timeval32 (curr_value_64.it_interval); + = alpha_valid_timeval_to_timeval32 (curr_value_64.it_interval); curr_value->it_value - = valid_timeval_to_timeval32 (curr_value_64.it_value); + = alpha_valid_timeval_to_timeval32 (curr_value_64.it_value); return 0; } diff --git a/sysdeps/unix/sysv/linux/alpha/osf_getrusage.c b/sysdeps/unix/sysv/linux/alpha/osf_getrusage.c index 74c6fb49aa..571bf3559a 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_getrusage.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_getrusage.c @@ -31,7 +31,7 @@ __getrusage_tv32 (int who, struct rusage32 *usage32) if (__getrusage (who, &usage64) == -1) return -1; - rusage64_to_rusage32 (usage32, &usage64); + alpha_rusage64_to_rusage32 (usage32, &usage64); return 0; } diff --git a/sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c b/sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c index df7f06765b..9c800e1a0d 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c @@ -38,7 +38,7 @@ __gettimeofday_tv32 (struct timeval32 *restrict tv32, void *restrict tz) struct timespec ts; __clock_gettime (CLOCK_REALTIME, &ts); - *tv32 = valid_timespec_to_timeval32 (ts); + *tv32 = alpha_valid_timespec_to_timeval32 (ts); return 0; } diff --git a/sysdeps/unix/sysv/linux/alpha/osf_setitimer.c b/sysdeps/unix/sysv/linux/alpha/osf_setitimer.c index 7df2d1b71c..0e70a6ebda 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_setitimer.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_setitimer.c @@ -30,9 +30,9 @@ __setitimer_tv32 (int which, const struct itimerval32 *restrict new_value, { struct itimerval new_value_64; new_value_64.it_interval - = valid_timeval32_to_timeval (new_value->it_interval); + = alpha_valid_timeval32_to_timeval (new_value->it_interval); new_value_64.it_value - = valid_timeval32_to_timeval (new_value->it_value); + = alpha_valid_timeval32_to_timeval (new_value->it_value); if (old_value == NULL) return __setitimer (which, &new_value_64, NULL); @@ -43,9 +43,9 @@ __setitimer_tv32 (int which, const struct itimerval32 *restrict new_value, /* Write all fields of 'old_value' regardless of overflow. */ old_value->it_interval - = valid_timeval_to_timeval32 (old_value_64.it_interval); + = alpha_valid_timeval_to_timeval32 (old_value_64.it_interval); old_value->it_value - = valid_timeval_to_timeval32 (old_value_64.it_value); + = alpha_valid_timeval_to_timeval32 (old_value_64.it_value); return 0; } diff --git a/sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c b/sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c index 6e17a95a47..092a6e6f7b 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c @@ -42,7 +42,7 @@ __settimeofday_tv32 (const struct timeval32 *tv32, return __settimezone (tz); } - struct timespec ts = valid_timeval32_to_timespec (*tv32); + struct timespec ts = alpha_valid_timeval32_to_timespec (*tv32); return __clock_settime (CLOCK_REALTIME, &ts); } diff --git a/sysdeps/unix/sysv/linux/alpha/osf_utimes.c b/sysdeps/unix/sysv/linux/alpha/osf_utimes.c index 6c3fad0132..006427c7fa 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_utimes.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_utimes.c @@ -28,8 +28,8 @@ attribute_compat_text_section __utimes_tv32 (const char *filename, const struct timeval32 times32[2]) { struct timeval times[2]; - times[0] = valid_timeval32_to_timeval (times32[0]); - times[1] = valid_timeval32_to_timeval (times32[1]); + times[0] = alpha_valid_timeval32_to_timeval (times32[0]); + times[1] = alpha_valid_timeval32_to_timeval (times32[1]); return __utimes (filename, times); } diff --git a/sysdeps/unix/sysv/linux/alpha/osf_wait4.c b/sysdeps/unix/sysv/linux/alpha/osf_wait4.c index 6af8347871..c773be0d3a 100644 --- a/sysdeps/unix/sysv/linux/alpha/osf_wait4.c +++ b/sysdeps/unix/sysv/linux/alpha/osf_wait4.c @@ -33,7 +33,7 @@ __wait4_tv32 (pid_t pid, int *status, int options, struct rusage32 *usage32) pid_t child = __wait4 (pid, status, options, &usage64); if (child >= 0 && usage32 != NULL) - rusage64_to_rusage32 (usage32, &usage64); + alpha_rusage64_to_rusage32 (usage32, &usage64); return child; } diff --git a/sysdeps/unix/sysv/linux/alpha/tv32-compat.h b/sysdeps/unix/sysv/linux/alpha/tv32-compat.h index 8e34ed1c1b..dbc020ddf8 100644 --- a/sysdeps/unix/sysv/linux/alpha/tv32-compat.h +++ b/sysdeps/unix/sysv/linux/alpha/tv32-compat.h @@ -70,13 +70,13 @@ struct rusage32 overflow, they write { INT32_MAX, TV_USEC_MAX } to the output. */ static inline struct timeval -valid_timeval32_to_timeval (const struct timeval32 tv) +alpha_valid_timeval32_to_timeval (const struct timeval32 tv) { return (struct timeval) { tv.tv_sec, tv.tv_usec }; } static inline struct timeval32 -valid_timeval_to_timeval32 (const struct timeval tv64) +alpha_valid_timeval_to_timeval32 (const struct timeval tv64) { if (__glibc_unlikely (tv64.tv_sec > (time_t) INT32_MAX)) return (struct timeval32) { INT32_MAX, TV_USEC_MAX}; @@ -84,27 +84,27 @@ valid_timeval_to_timeval32 (const struct timeval tv64) } static inline struct timespec -valid_timeval32_to_timespec (const struct timeval32 tv) +alpha_valid_timeval32_to_timespec (const struct timeval32 tv) { return (struct timespec) { tv.tv_sec, tv.tv_usec * 1000 }; } static inline struct timeval32 -valid_timespec_to_timeval32 (const struct timespec ts) +alpha_valid_timespec_to_timeval32 (const struct timespec ts) { return (struct timeval32) { (time_t) ts.tv_sec, ts.tv_nsec / 1000 }; } static inline void -rusage64_to_rusage32 (struct rusage32 *restrict r32, +alpha_rusage64_to_rusage32 (struct rusage32 *restrict r32, const struct rusage *restrict r64) { /* Make sure the entire output structure is cleared, including padding and reserved fields. */ memset (r32, 0, sizeof *r32); - r32->ru_utime = valid_timeval_to_timeval32 (r64->ru_utime); - r32->ru_stime = valid_timeval_to_timeval32 (r64->ru_stime); + r32->ru_utime = alpha_valid_timeval_to_timeval32 (r64->ru_utime); + r32->ru_stime = alpha_valid_timeval_to_timeval32 (r64->ru_stime); r32->ru_maxrss = r64->ru_maxrss; r32->ru_ixrss = r64->ru_ixrss; r32->ru_idrss = r64->ru_idrss; From patchwork Mon Feb 3 18:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1232968 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109129-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=mVyulxh4; dkim=pass (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=hQn3IJkZ; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48BGnF4Kc2z9sRK for ; Tue, 4 Feb 2020 05:38:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=nM+vAmurG2oUgoqcjaeHqrlkKQxihtTA2bWAp9wdURDo2yY28MC1E gvWGXRLSvy4tBcZHlE0UIDrxBrlUzp+b4cyNbZW2E1rYZHktFqT4U5KXMkXX/ZWx H8a6FHcNlHXz5qXhEqtGt34rmzyccAM/ZFc+s6RcXkoJg2e7JKXL2M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=oXS6L/B++Z3S2C1o8CpPlKQjmWQ=; b=mVyulxh4CJ85xHTqxrvWLeubuywR RY31q16pqgkfAqCCPoOB9vM4fr4EhosnJ0W7PNLeQ+BNEAKuTOaxpY40A64dfjRr SQBu/neiueC7fnntQ25Oe66izW7Zeye+wMz4B3uRcuNzHFXEv3ElfoCRjhj+4VVW 39cusT+z526aqrw= Received: (qmail 24511 invoked by alias); 3 Feb 2020 18:38:44 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24314 invoked by uid 89); 3 Feb 2020 18:38:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: esa3.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1580755122; x=1612291122; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kP4bNIW271AJtaXfqnO4HEqg4KTH7NFIKmsYZdN6iYM=; b=hQn3IJkZr/xM09v+zHm8LJT4+86wYgOyaO/rvin9jUg4fsUwSFXid5Ga /+fr3auzzn6x4J2CEUeV6p9iuBdaXZ3v0v15JJYTwEjHhpikcE0668v4d P8VU16S/4eA+dyKbzDCweIZjPzysaDLdl3FlSVE8Hy6FdBbz67+CqYLAo wbcGFZPqeOPbQGp9m9r/+epKdu8InzPRp3PbxAZVH8CtdEYI5nQ46pg/M pVE8Ef0FUzTUXru8X3zv0epsVMlv/Mz3ar1TCnq5w09mxS+2c1i/ywT91 sHp6Fjjko1bNwJ/Og1nFRyGOE2ULMXLEm5Kf2CBQC3IEpUKvPH5ZnN7Cq Q==; IronPort-SDR: 6XonrMSs/1WCGBv8ZyR20+QmI3eZKMnhRrG/4DgRqsuD6+nRxcknPxNUGTBkn8mnN5SgvSdzhm NqrLiGeAYDC4c/liAX4Sga87i5DOO3AF+D49jyHpgOLqchg8RZn4UlpGYMFZFNjqBoyZtbUSmY ZkdzbPtv0XY7ulDnMK4uY9HJc/p4gfGGKDMNXaA5koXsOJyQJMy2oIVG9JRmjEH+k6Wh3L0BX7 oVGj1fbkOsmVyqBzfOnAOoE9ZF/2tyRyh719PgOwDsmdGDig+GodaBA6rvuY8Ky8a3lVqNTkb/ L+s= IronPort-SDR: 1e/lJFf8NdAzjxgM6oiTiLXdngdAccSX0gwX9W1sSrqQv+hYAmbZ5cgtdRegXal5gfxCB9CCsI Luj+dBCJe9OVq0uChtnC60EJ+mIjwN0Bqbwr8rUyxPHUbUh9CY0ewQuChWm5geNnMD4Cw5NWdm bYxca23w2B1l4qiQJ328Obqf88DfGnW5MUBjVcQgOuDGHxfN7uwVt6MS79N/33plBIVFM1USiY ofdJ85rz5YupcRQVO8Vp5qBcg0nqiJWfQBr2APy5GQd8j2a0Izh6Xup5o3AeyFVwknpqxn4RXc AAM3yg+4FmBN4TuOezFfXFh7 IronPort-SDR: QKZZ7ML5Eyajjz/LES4PfU4ffS2IJAjZMu9BB6yxYTQzK8tWpNj1OLo3SQYHU7y5vrnjc0ek7q 8h+4jzQqsJHswnaXKeOl4XYCpR0UbB9Oi9h52qoJpKScvYtSIB51AZbpexePgpLTbCiIr9HKT7 Tdt7j4ecYRysYpqwXWNy6aRUxip5QaeJ+nVPOs4nYOBZATjMPDfWAugLFLbrLuqwtxqRpcD3CN VAsvOuvP6u45jnWHMy13LjBqUzfe6zRuGUWUTrvEGVlxEax0+GvX/7J1KCy9xBcV0j0KHem1cH gXc= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, lukma@denx.de, Alistair Francis Subject: [PATCH 2/6] time: Add a timeval with a long tv_sec and tv_usec Date: Mon, 3 Feb 2020 10:31:49 -0800 Message-Id: <20200203183153.11635-3-alistair.francis@wdc.com> In-Reply-To: <20200203183153.11635-1-alistair.francis@wdc.com> References: <20200203183153.11635-1-alistair.francis@wdc.com> MIME-Version: 1.0 On y2038 safe 32-bit systems the Linux kernel expects itimerval to use a 32-bit time_t, even though the other time_t's are 64-bit. To address this let's add a timeval_long struct to be used internally. --- include/time.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/include/time.h b/include/time.h index d425c69ede..c2c05bb671 100644 --- a/include/time.h +++ b/include/time.h @@ -388,6 +388,49 @@ timespec64_to_timeval64 (const struct __timespec64 ts64) return tv64; } +/* A version of 'struct timeval' with `long` time_t + and suseconds_t. */ +struct __timeval32 +{ + long tv_sec; /* Seconds. */ + long tv_usec; /* Microseconds. */ +}; + +/* Conversion functions for converting to/from __timeval32 +. If the seconds field of a __timeval32 would + overflow, they write { INT32_MAX, 999999 } to the output. */ +static inline struct __timeval64 +valid_timeval32_to_timeval64 (const struct __timeval32 tv) +{ + return (struct __timeval64) { tv.tv_sec, tv.tv_usec }; +} + +static inline struct __timeval32 +valid_timeval64_to_timeval32 (const struct __timeval64 tv64) +{ + if (__glibc_unlikely (tv64.tv_sec > (time_t) 2147483647)) + return (struct __timeval32) { 2147483647, 999999}; + return (struct __timeval32) { tv64.tv_sec, tv64.tv_usec }; +} + +static inline struct timeval +valid_timeval32_to_timeval (const struct __timeval32 tv) +{ + return (struct timeval) { tv.tv_sec, tv.tv_usec }; +} + +static inline struct timespec +valid_timeval32_to_timespec (const struct __timeval32 tv) +{ + return (struct timespec) { tv.tv_sec, tv.tv_usec * 1000 }; +} + +static inline struct __timeval32 +valid_timespec_to_timeval32 (const struct timespec ts) +{ + return (struct __timeval32) { (time_t) ts.tv_sec, ts.tv_nsec / 1000 }; +} + /* Check if a value is in the valid nanoseconds range. Return true if it is, false otherwise. */ static inline bool From patchwork Mon Feb 3 18:31:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1232969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109130-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=sXf44mpU; dkim=pass (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=ThxT8wQq; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48BGnP5M9Wz9sRR for ; Tue, 4 Feb 2020 05:39:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=qZyHUlw+5qXoyJwdvQTayha4ek5SFoUWfZp2K6Zc/YPZtL2TrtIYm 5Suf6J9dbOh9hINxY4wQdBrrPepWt6EkW6So7C/PO5DIgKrdq6xImoC65lIh5RSO CX9I0CZtMCkNbaBPkPG27ABrt1tHcdWZDKTPhrQL45sNJiVt3xUoZ4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=LWSiAuwstxxFd+aD4VcFq9+Iqag=; b=sXf44mpUNR1X9T1O3XkOW69FR4Ir GsAgjZfZ3pLaNAhTzP7rKKa+RI9z7bTNJgu9yBnQmEwSJyKj8STuf8ZIqPoKpKwH 1Vpb6xcvy7xiwBzm09ZfIrdudlv+zVD9aXuofFjSC3ekf/77/ED6ROUkUAM2H4v2 GRzzxAsmKPazQyc= Received: (qmail 24599 invoked by alias); 3 Feb 2020 18:38:44 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24501 invoked by uid 89); 3 Feb 2020 18:38:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: esa3.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1580755123; x=1612291123; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1uyMLdxdmSWrKz/l/SFAaTHCbMQl6FVJf70FTz1xxS0=; b=ThxT8wQqK1QjhMBz0ib13Wj1MlvxKJdjrPfRO88twd9wSekgUMcQk/Zj /uCQGoeu+cagS98PJGPjw1lISv4IzdArDPxww90W9k5KCWIsaVw0t4d6D 8eSn8D+mzfaM45gmJs6EXpBka2frgns0knN4rS0EkPJSG6Q+1XXrAufxC RAtwAlFiXKi5IRJZrgp/hAAH5zgaXCJREZNsMT39ARsEHmmMvNxrQNkhq y+l2BLIxdIgwbHgU0CM/SN3eIVPLlUf9EPy+8FHmjNs6zlxBsZn+sf1EE HYpopsBRt5dw6R2/TrBRlny2hOVHD9ZbSvKqS4mSe8XOckvfECK4bMxtA g==; IronPort-SDR: A+ruuLjGNCjvnlo/I8lPjD55ollANHh52VEW6OYcHhnraSl5ZdWvHwLz2AA3FwoYFFirefl4bG +KubSNFqVpZjpj/sCj0sN31NuWENBLP43qtM9nSn0HIN9ExNDwIwgZCwHihLFU7YRvlkWoUnhd IvAxcHnzVlOM4hKmQ9lKySlfmlZNgWnPznF8f44atgPYoyC3aVzalw95kEgriNDl2lrMW8e9OY ZvpRamPmuZ9ThEztbrtnDxerehcaP3ygEV1kO0Jb3qmRdv2XKL26VIv05ZESTpGvoHaCr1OC63 9t0= IronPort-SDR: I+SZ0EylQ5QVJ3NktvNvFD0rQl6XzV65h9zrMRB0ne8RNOi61IQH6vKT25Z1Fp23ptmRRSlMA0 /7PhnGtq2ZckBZq39tjoDyGk+6zWXt2g7ijLii6kdKMcAJvzlPJ1f5yQSMZxQA5pnHKayh+Q7x T0Ea4qW46nR2NKJPpurI6nLZfZLQhBbTSxAvfEzBYb1DUN6E1BxsAjfrwS7d8EO/EyPpFepAuZ UFrq4HiQp1EC9ABI1I07vs2FmoWZUaXAenvM7DzkG9gQINAn6R6jJ6b9U6L7ldw3ldsbCN0IUp z11UyTze8RGUi9v7tsq3TMsM IronPort-SDR: 6TAcmR/00zchABLsH4zDqEVlE4nTSZcKceKsbiiz03RFUfdZe5kfdTT4Cbxu0s7II3Yumdz5ID BQuLIsXznwGj33IrOn3d2fXbvIMBGqnRMhjppPC8D5bIGDVHXsvVB1ac2o6tRIYx1doJcIIV2h 0S5gZUenB1+mivc1mS5lelFu+tj4zumidhWTpoAtJNj70T2LP4yYdwgsZiqpaytJcCVP+R/AfQ LjiXeuABX3HH3Eft3M78JccrInF4XtmOMbqQK/aHieGszdTr1Ww6J1gm7tPlYUF+q/mM5G2A9A YLM= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, lukma@denx.de, Alistair Francis Subject: [PATCH 3/6] time: Add a __itimerval64 struct Date: Mon, 3 Feb 2020 10:31:50 -0800 Message-Id: <20200203183153.11635-4-alistair.francis@wdc.com> In-Reply-To: <20200203183153.11635-1-alistair.francis@wdc.com> References: <20200203183153.11635-1-alistair.francis@wdc.com> MIME-Version: 1.0 Add a __itimerval64 which always uses a 64-bit time_t. Reviewed-by: Lukasz Majewski --- include/time.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/time.h b/include/time.h index c2c05bb671..898ff0fb2d 100644 --- a/include/time.h +++ b/include/time.h @@ -107,6 +107,17 @@ struct __timeval64 }; #endif +#if __TIMESIZE == 64 +# define __itimerval64 itimerval +#else +/* The glibc's internal representation of the struct itimerval. */ +struct __itimerval64 +{ + struct __timeval64 it_interval; + struct __timeval64 it_value; +}; +#endif + #if __TIMESIZE == 64 # define __ctime64 ctime #else From patchwork Mon Feb 3 18:31:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1232971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109132-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=A2t4HwmJ; dkim=pass (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=OlGfIh8C; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48BGnl6vGxz9sRK for ; Tue, 4 Feb 2020 05:39:23 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=crEmvyjWJrpAvl9AnyIGACbflsdWinQY18oZG27ny9M//oUgzA2ld itA1sC/11oeI6RdvNA+xq1Vm1UNmSXD/D2oBsNF659fajRejoKy17+k3FKrmCjQC +RY6ehrld5Z4mwbwdmnRNyCn0O7YEDTAQa2pLW4zk4gQf3zV4abvi0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=HAR4216eZA+S2JlwW+N6a+9ZNfM=; b=A2t4HwmJ8RPISh/nAcPGEYQiXw2y aNldQ7PLSNwjAbGb5SCn6w+sprTsertpV9RlT4mXcQJlbmNTGhDwPQQrKaWpfmCn FpD3Lz69Gd95lffyNdNtPn7a1PG2XMr8DUaryE7aaWGyUh+pyuB/Tw3zZpCrPUX1 vp8E2Mrmta3xeGY= Received: (qmail 25051 invoked by alias); 3 Feb 2020 18:38:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24934 invoked by uid 89); 3 Feb 2020 18:38:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy=sk:struct_, interval X-HELO: esa3.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1580755124; x=1612291124; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Xg2AIssQp4zHTINVrzHk65k0TN1rxEU2PvAHfM5RAtE=; b=OlGfIh8CtTx0Fh+/FxqfyfR7Q4Xz5J+WL0LL4S95p6C1XOfJqRaEoXgb asTYDNKrs5zNklAqo2pyDS9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JQUAfnh6JF12fz9J6tJBgfxNvDXvZ0nrWWnBLjZ3p7YeuwiQi1onUuA5LJ/o9km xVDmYo68mGxkwP7RMZN//SK+K/za6IjJiuNoZNnEzHZT44J28BvJfw2bYyug0EuQztTAJoz3Vi vX4= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, lukma@denx.de, Alistair Francis Subject: [PATCH 4/6] linux: Use 32-bit time_t for itimerval Date: Mon, 3 Feb 2020 10:31:51 -0800 Message-Id: <20200203183153.11635-5-alistair.francis@wdc.com> In-Reply-To: <20200203183153.11635-1-alistair.francis@wdc.com> References: <20200203183153.11635-1-alistair.francis@wdc.com> MIME-Version: 1.0 The Linux kernel expects itimerval to use a 32-bit time_t, even on archs with a 64-bit time_t (like RV32). To address this let's convert itimerval to/from 32-bit and 64-bit to ensure the kernel always gets a 32-bit time_t. This means that all 32-bit architectures with a 64-bit time_t will be able to use this generic implementation. This code is based on similar code in alpha, but adjusted to pass the 32-bit time_t to the kernel. We can't directly call the __getitimer/__setitimer functions as they expect a struct itimerval but we need to pass in a struct itimerval32. --- include/time.h | 12 +++ .../linux/generic/wordsize-32/getitimer.c | 54 +++++++++++++ .../linux/generic/wordsize-32/setitimer.c | 77 +++++++++++++++++++ .../linux/generic/wordsize-32/tv32-compat.h | 35 +++++++++ 4 files changed, 178 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/getitimer.c create mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/setitimer.c create mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/tv32-compat.h diff --git a/include/time.h b/include/time.h index 898ff0fb2d..e1d80b4190 100644 --- a/include/time.h +++ b/include/time.h @@ -6,6 +6,7 @@ # include # include # include