From patchwork Tue Mar 3 21:58:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mazen Adel Elmessady X-Patchwork-Id: 131039 Return-Path: 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 DC5194BA23C5 for ; Tue, 3 Mar 2026 21:59:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC5194BA23C5 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=kw6LH0D9 X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 0434C4BA2E0A for ; Tue, 3 Mar 2026 21:58:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0434C4BA2E0A 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 0434C4BA2E0A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772575138; cv=none; b=Z+Tmxy/PzM/i9fnTtfdaTZRXTHATMyhG7PQZ0bXrljRRAOXej+xVFCwbBaQazhy79qSZixsbkSTvD9cltRcu3SVCwmxYfJOg1GhG7xeTbDZL1wCJNcGF3PMJoS2yGkOCWMaLAmDDhPLzoXTWf3NB4mwgu7jXPN531VHJqio+RFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772575138; c=relaxed/simple; bh=NTVswi2N+h7+/8uE/E9agKxxfOjtjoZy1LVDC+xe4xs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YU1P+ly/7+bEjwG9czDiZIaCZBYXbhfVg0u5rIonORTjtnI7YigWFdlqvEkRAsKfBvPSjc/qOluiCZQDMlQz26N+iNKQpPMH9CaHhu81u1wy8IeOPzQt9UERwqwHZfQfJyVdo4ic7AV++GnJsk1w7bD0CMieG/WvGr0n7/b8/ic= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0434C4BA2E0A Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-482f454be5bso65841585e9.0 for ; Tue, 03 Mar 2026 13:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772575137; x=1773179937; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7Z0qaSaiVXqkMY/BnZ+ypYrALOwzZtoNuDHEIIReM3I=; b=kw6LH0D9+JAi8wRCNniGostT0redBGbBIrWgdCJdQDqwY+UBqEbg/+NjfNbdVNzAWM FUBJE5bvFSYL+Bv5EIy45P+vxK0QP9nyOGp6jKCIJ6B2OFV5sSuF4P+Z3ExZberY6/Vl UW6yTCG4EKGgDVztHQWTmsHnIsrTemMjiazM5eA8KCa7SjC87PY2vnI+/jVRyxSlwJLQ kTVeaTjU8w8lndKiytTlDNDWvzPUmBV2wEzEZ3/6y7XP+PsoSsOTCztMxfI6hyak6YGa +sTd5Zv7byLw8lEiJ914/3qWmerQA9NvqTC8YyEMe4caM1ZKLYNCDDwN+Ylwcla/LUSY euIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772575137; x=1773179937; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message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X-Received: by 2002:a05:600c:3147:b0:46e:59bd:f7e2 with SMTP id 5b1f17b1804b1-48513a79425mr59786965e9.11.1772575136545; Tue, 03 Mar 2026 13:58:56 -0800 (PST) Received: from mez3n-82jf ([102.46.33.88]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485135c2b5dsm22855975e9.24.2026.03.03.13.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 13:58:56 -0800 (PST) From: Mazen Adel Elmessady To: newlib@sourceware.org Cc: joel.sherrill@gmail.com, Mazen Adel Elmessady Subject: [PATCH v3] sys/lock.h: Add clock selection APIs for the Date: Tue, 3 Mar 2026 23:58:50 +0200 Message-ID: <20260303215850.77326-1-mez3n1151@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260224144856.431478-1-mez3n1151@gmail.com> References: <20260224144856.431478-1-mez3n1151@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org 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. V2: Kept _Semaphore_Wait_timed while adding _Semaphore_Wait_timed_clock V3: Added _Mutex_Acquire_timed_clock() _Mutex_recursive_Acquire_timed_clock() _Condition_Wait_timed_clock() _Condition_Wait_recursive_timed_clock() To include all the clock selection APIs for all of the synchronization object class --- newlib/libc/sys/rtems/include/sys/lock.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/newlib/libc/sys/rtems/include/sys/lock.h b/newlib/libc/sys/rtems/include/sys/lock.h index d6169025b..79fb6b2de 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 +#include #include __BEGIN_DECLS @@ -137,6 +138,9 @@ void _Mutex_Acquire(struct _Mutex_Control *); int _Mutex_Acquire_timed(struct _Mutex_Control *, const struct timespec *); +int _Mutex_Acquire_timed_clock(struct _Mutex_Control *, + const struct timespec *, __clockid_t) + int _Mutex_Acquire_timed_ticks(struct _Mutex_Control *, __uint32_t); int _Mutex_Try_acquire(struct _Mutex_Control *); @@ -187,6 +191,9 @@ void _Mutex_recursive_Acquire(struct _Mutex_recursive_Control *); int _Mutex_recursive_Acquire_timed(struct _Mutex_recursive_Control *, const struct timespec *); +int _Mutex_recursive_Acquire_timed_clock(struct _Mutex_recursive_Control *, + const struct timespec *, __clockid_t); + int _Mutex_recursive_Acquire_timed_ticks(struct _Mutex_recursive_Control *, __uint32_t); @@ -237,6 +244,9 @@ void _Condition_Wait(struct _Condition_Control *, struct _Mutex_Control *); int _Condition_Wait_timed(struct _Condition_Control *, struct _Mutex_Control *, const struct timespec *); +int _Condition_Wait_timed_clock(struct _Condition_Control *, + struct _Mutex_Control *, const struct timespec *, __clockid_t); + int _Condition_Wait_timed_ticks(struct _Condition_Control *, struct _Mutex_Control *, __uint32_t); @@ -246,6 +256,9 @@ void _Condition_Wait_recursive(struct _Condition_Control *, int _Condition_Wait_recursive_timed(struct _Condition_Control *, struct _Mutex_recursive_Control *, const struct timespec *); +int _Condition_Wait_recursive_timed_clock(struct _Condition_Control *, + struct _Mutex_recursive_Control *, const struct timespec *, __clockid_t); + int _Condition_Wait_recursive_timed_ticks(struct _Condition_Control *, struct _Mutex_recursive_Control *, __uint32_t); @@ -298,6 +311,9 @@ 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); int _Semaphore_Try_wait(struct _Semaphore_Control *);