| Message ID | 20260224144856.431478-1-mez3n1151@gmail.com |
|---|---|
| State | New |
| Headers |
Return-Path: <newlib-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id E8E6A4B9DB69 for <patchwork@sourceware.org>; Tue, 24 Feb 2026 14:49:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8E6A4B9DB69 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BmJ6WEn8 X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 2A25B4B9DB54 for <newlib@sourceware.org>; Tue, 24 Feb 2026 14:49:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A25B4B9DB54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2A25B4B9DB54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771944541; cv=none; b=NDFm62mUyPNVEZlIQtyVMS2DRHVTq9IfwNiMIfzj7FyBkKtmM57Rh+UTSeZj0sJkhIqdgVC2IeBXFXh+26Rp7VkMLWX1knsZi7A76bZO62jS5ECynAdOyrEo3eKxHPPNOn8JVrwM5oCfFqwRzMqXzK07Ss1HAg3FM6Kkl3G7wJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771944541; c=relaxed/simple; bh=pKo3ickNuxvWXQuYvzo+rFKT92tA3nIM/BpgrghdY4Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kyW+WwDqIEClSRs0j/3+AMTkb0vf6J048fX3mdgAEhEaL1K5Jgue6z2NtBC7ZAfP1bdRqa1S1TVdc31HwtMmErZxr5c7sgVDBDG/ka6RqsaZ08px3CvLxsuSsb/LqkspWA1HIsh3a1k8TDLwIG14gU+ngnE+bTeR9fE6PVnvxYc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A25B4B9DB54 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4806bf39419so49399935e9.1 for <newlib@sourceware.org>; Tue, 24 Feb 2026 06:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771944540; x=1772549340; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jRSTqWWW1VNRqxKg4GKVBepLmoU+dW4CZxsIO/5VPLs=; b=BmJ6WEn8zGrBs+cD9VlnBF8hQs25EEtK2FTDLEmUY9Dm2LN5ff/gCzX/Jb79tELG6P nhsitxkdSmHkOGOgjg3c2gnrNrG2JamY9//VWBlWKg8END40Sj7wEVpR/vprFZ85F0UQ bqz4L3ZgwEuCOMYZMvRRWy787gDad5J5gGDJ2wYgH2CBdGbj1mpkWnnx6gMaQZPxsa/u fQwiD0zE6E7SelLZ2ePsubUxL9wlgNCz4p3lJ63N8giYITqio9uSYOXOUFyAglLuxhR2 yyKXW5y8YyD5EX0f8sVztJy4sk8Sh6oLe6a8XySlViHOw58AkXHNW7wXcNV0SJj1fq67 2S8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771944540; x=1772549340; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jRSTqWWW1VNRqxKg4GKVBepLmoU+dW4CZxsIO/5VPLs=; b=NHcmxZXrxfJIDf0AJbDh2/uWSl1aOJ+HzSB59FVNQhH+or7ECyD0L1ExDBpnusN9jn BA5s1vbvH1NCciWLVt9QKUvYbvFfAYw51NxnwbC8RzMHDNkpy54Tuj3C1jWmIWKtp3Qg +W4BGFj3AC9Bv9OkNADS6dzime4IRPDyyj/0n7Y9G6EtMWmWhJABnnkXcGecCDgMn9Is qj3Ef7d2BG8CUEGdN0GWWUE8nyiz2URcI8rB3WtrrUW8oxWlOYbld9aN3pruIaQhzzUS j8TFgM3xd0CkTqmwamt53VtLnRcLHcRrH706onk+qJEXEM9O8cDpYHuJotqA3d5bWSIf sQ7w== X-Gm-Message-State: AOJu0YwDSxWWGg/xu8rygAaW58AxmNBvwMwrrc6kfNpPOsrMZCTebqz5 9Cce3HPum3oPbf2CxsfLa8dosMWwHDUi+oxYVPvW1zEE/SLhoY6PgtJREmdh X-Gm-Gg: AZuq6aLZsgLYM/FAajcdckvL07mjH9NJpQpQuvFQdWMX03Q5P6hqw8zMsUzQ+lq8W7o 6em69ck6lSyM5YtvtyNS9nyft2iXrD/NlcLOyHfHAi1XclzubA79Qbx4+9Bb8Ik/CJ45xXdzd4x ZvvN2HVirQiB616CxF84LuJUEMNn3mSBeksKVzT2xgkgDhzWF9gWwszoZ2iIv+NBT5abFRBPEeJ wVj/CIL5v+KmjBH2h08pqcrWBcsCSkN0ClihWM36NjiPTgjCbxs0jX9nwMRd0Fxl5BGTeEg5ybz jzGEUFmQGolqMm3CBIBNptM3hCjh7eO5+6YO1pe75wVgTljf2AsQTLbjjsYEoxHvTfvb8qnWy6P MZxiCgpxgp0M5IWms7BaIvZmYN3kTGCDi4p+rETkXg+estT62GiRKBXmTgbV0ZyCGJfX2A3JPVq c6TRFGNatVJF75mxMkHHk= X-Received: by 2002:a05:600c:3414:b0:47e:e051:79ee with SMTP id 5b1f17b1804b1-483bd713545mr2753545e9.3.1771944539613; Tue, 24 Feb 2026 06:48:59 -0800 (PST) Received: from mez3n-82jf ([154.182.217.6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483b81fbeb4sm48824135e9.1.2026.02.24.06.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 06:48:59 -0800 (PST) From: Mazen Adel Elmessady <mez3n1151@gmail.com> To: newlib@sourceware.org Cc: joel.sherrill@gmail.com, Mazen Adel Elmessady <mez3n1151@gmail.com> Subject: [PATCH] Update: _Semaphore_Wait_timed to include clock selection Date: Tue, 24 Feb 2026 16:48:56 +0200 Message-ID: <20260224144856.431478-1-mez3n1151@gmail.com> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GB_FREEMAIL_NUM, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list <newlib.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/newlib>, <mailto:newlib-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/newlib/> List-Post: <mailto:newlib@sourceware.org> List-Help: <mailto:newlib-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/newlib>, <mailto:newlib-request@sourceware.org?subject=subscribe> Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Update: _Semaphore_Wait_timed to include clock selection
|
|
Commit Message
Mazen Adel Elmessady
Feb. 24, 2026, 2:48 p.m. UTC
Updated _Semaphore_Wait_timed (which is currently unused in RTEMS) to _Semaphore_Wait_timed_clock which to be used in RTEMS sempahore API. This will ease the support of the new clock functions added in Posix Issue 8. --- newlib/libc/sys/rtems/include/sys/lock.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Comments
Hello Mazen, it would be quite simple to implement _Semaphore_Wait_timed() if you have _Semaphore_Wait_timed_clock(). I would keep the declaration and only add _Semaphore_Wait_timed_clock(). Would it make sense to add the clock variants also for the other operations (mutex, ...)? Kind regards, Sebastian
----- Am 26. Feb 2026 um 14:29 schrieb Mazen Adel Elmessady mez3n1151@gmail.com: > Hello Sebastian, > > I already added the clock variants of (mutex, condwait, rwlock) to RTEMS a > while back, I had to update their headers in newlib too. I don't see any updates in Newlib: git log -1 newlib/libc/sys/rtems/include/sys/lock.h commit dadc9e7e4addbaad6c3249c883a80f6f8a33eafd Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Tue Nov 28 08:00:33 2017 +0100 > > Kind regards, > Mazen > > On Thu, Feb 26, 2026 at 2:07 AM Sebastian Huber < > sebastian.huber@embedded-brains.de> wrote: > >> Hello Mazen, >> >> it would be quite simple to implement _Semaphore_Wait_timed() if you have >> _Semaphore_Wait_timed_clock(). I would keep the declaration and only add >> _Semaphore_Wait_timed_clock(). >> >> Would it make sense to add the clock variants also for the other >> operations (mutex, ...)? >> >> Kind regards, >> Sebastian >> >> -- >> Visit us at EMBEDDED WORLD 2026 in Nuremberg 10 to 12 March, Hall 4 Booth >> 622! >> -- >> embedded brains GmbH & Co. KG >> Herr Sebastian HUBER >> Dornierstr. 4 >> 82178 Puchheim >> Germany >> email: sebastian.huber@embedded-brains.de >> phone: +49-89-18 94 741 - 16 >> fax: +49-89-18 94 741 - 08 >> >> Registergericht: Amtsgericht München >> Registernummer: HRB 157899 >> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler >> Unsere Datenschutzerklärung finden Sie hier: >> https://embedded-brains.de/datenschutzerklaerung/
----- Am 26. Feb 2026 um 16:37 schrieb Mazen Adel Elmessady mez3n1151@gmail.com: > Sorry, I thought you meant the Posix APIs themselves. > It would make sense to add them since they will help if we want to refactor > the code, however the Posix APIs are working as is. > If you want to I can make a separate patch file for each. Changes in Newlib are always an issue for RTEMS if you want to do a git bisect over a longer time span. I would not remove existing declarations, even if there is not yet an RTEMS implementation. We may need them in the future. If you add a timed clock function, for one synchronization object class, then I would also add declarations for all the other *_timed() functions as well. We may need them at some point in time for the C++/libgomp support in GCC.
diff --git a/newlib/libc/sys/rtems/include/sys/lock.h b/newlib/libc/sys/rtems/include/sys/lock.h index d6169025b..c2728ce5a 100644 --- a/newlib/libc/sys/rtems/include/sys/lock.h +++ b/newlib/libc/sys/rtems/include/sys/lock.h @@ -27,6 +27,7 @@ #define _SYS_LOCK_H_ #include <sys/cdefs.h> +#include <sys/_timespec.h> #include <stddef.h> __BEGIN_DECLS @@ -295,8 +296,8 @@ _Semaphore_Get_name(const struct _Semaphore_Control *_semaphore) void _Semaphore_Wait(struct _Semaphore_Control *); -int _Semaphore_Wait_timed(struct _Semaphore_Control *, - const struct timespec *); +int _Semaphore_Wait_timed_clock(struct _Semaphore_Control *, + const struct timespec *, __clockid_t); int _Semaphore_Wait_timed_ticks(struct _Semaphore_Control *, __uint32_t);