All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Alchemy: Fix calling context checks and documentation
@ 2026-11-25 21:34 Richard Weinberger (sigma star gmbh)
  2026-11-25 21:34 ` [PATCH 1/7] lib/alchemy/mutex: Allow any Xenomai thread to acquire a mutex Richard Weinberger (sigma star gmbh)
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Richard Weinberger (sigma star gmbh) @ 2026-11-25 21:34 UTC (permalink / raw)
  To: xenomai; +Cc: upstream+xenomai, Richard Weinberger

From: Richard Weinberger <richard@nod.at>

Several Alchemy services refuse callers which are not Copperplate
tasks, although they do not need a Copperplate TCB at all, or only
need one when actually waiting. As a result, Cobalt POSIX threads,
which are Xenomai threads according to the API documentation, get
-EPERM from rt_mutex_acquire(), rt_task_yield(), rt_pipe_read() or
rt_event_wait(), and even from queue/buffer/heap calls which could
be satisfied immediately.

Also the documentation is inaccurate. It keeps referring to "Xenomai
threads" where a Copperplate task, or even an Alchemy task, is
actually required.

At first I thought fixing the documentation would be the best way to
go. Then I remembered a customer application which does mix the
Alchemy and POSIX skins, so I gave improving the Alchemy layer a try.

Patch 6/7 is worthy of discussion, I'm not so sure whether it really
brings a real gain.

Thanks,
//richard

Richard Weinberger (7):
  lib/alchemy/mutex: Allow any Xenomai thread to acquire a mutex
  lib/alchemy/task: Allow rt_task_yield() from any thread
  lib/alchemy: Document the actual calling context requirements
  lib/alchemy/pipe: Do not require a Xenomai task for blocking reads
  lib/alchemy/event: Require a Xenomai task only for waiting over
    Mercury
  lib/alchemy: Require a Xenomai task only when actually waiting
  testsuite/smokey/alchemytests: Test Alchemy services from POSIX
    threads

 include/alchemy/mutex.h                      |   3 +-
 lib/alchemy/alarm.c                          |   9 -
 lib/alchemy/buffer.c                         |  23 +-
 lib/alchemy/cond.c                           |   3 +-
 lib/alchemy/event.c                          |  11 +-
 lib/alchemy/heap.c                           |  13 +-
 lib/alchemy/mutex.c                          |  22 +-
 lib/alchemy/pipe.c                           |  15 +-
 lib/alchemy/queue.c                          |  23 +-
 lib/alchemy/sem.c                            |   3 +-
 lib/alchemy/task.c                           |  86 +++---
 lib/copperplate/eventobj.c                   |   5 +
 lib/copperplate/init.c                       |  10 +
 testsuite/smokey/alchemytests/Makefile.am    |  10 +
 testsuite/smokey/alchemytests/alchemytests.c |   2 +
 testsuite/smokey/alchemytests/mutex-3.c      | 158 +++++++++++
 testsuite/smokey/alchemytests/posix-1.c      | 259 +++++++++++++++++++
 17 files changed, 561 insertions(+), 94 deletions(-)
 create mode 100644 testsuite/smokey/alchemytests/mutex-3.c
 create mode 100644 testsuite/smokey/alchemytests/posix-1.c

-- 
2.55.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-26  7:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 21:34 [PATCH 0/7] Alchemy: Fix calling context checks and documentation Richard Weinberger (sigma star gmbh)
2026-11-25 21:34 ` [PATCH 1/7] lib/alchemy/mutex: Allow any Xenomai thread to acquire a mutex Richard Weinberger (sigma star gmbh)
2026-11-26  6:14   ` Jan Kiszka
2026-11-26  7:53     ` Richard Weinberger
2026-11-25 21:34 ` [PATCH 2/7] lib/alchemy/task: Allow rt_task_yield() from any thread Richard Weinberger (sigma star gmbh)
2026-11-25 21:34 ` [PATCH 3/7] lib/alchemy: Document the actual calling context requirements Richard Weinberger (sigma star gmbh)
2026-11-25 21:34 ` [PATCH 4/7] lib/alchemy/pipe: Do not require a Xenomai task for blocking reads Richard Weinberger (sigma star gmbh)
2026-11-25 21:34 ` [PATCH 5/7] lib/alchemy/event: Require a Xenomai task only for waiting over Mercury Richard Weinberger (sigma star gmbh)
2026-11-25 21:34 ` [PATCH 6/7] lib/alchemy: Require a Xenomai task only when actually waiting Richard Weinberger (sigma star gmbh)
2026-11-26  6:09   ` Jan Kiszka
2026-11-25 21:34 ` [PATCH 7/7] testsuite/smokey/alchemytests: Test Alchemy services from POSIX threads Richard Weinberger (sigma star gmbh)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.