All of lore.kernel.org
 help / color / mirror / Atom feed
* [EVL] A POSIX interface has landed
@ 2026-11-22 20:31 Philippe Gerum
  2026-11-22 20:50 ` Florian Bezdeka
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Gerum @ 2026-11-22 20:31 UTC (permalink / raw)
  To: Xenomai; +Cc: Jan Kiszka, Florian Bezdeka


After several iterations, pauses and rewrites, a POSIX-conforming
interface is finally available with libevl, alongside the original EVL
API. 'libcobalt.so' is generated and installed with its headers
side-by-side with 'libevl.so'. We can use any of them or both,
separately or combined in a single application. The main goal is to
cover what x3's libcobalt provides feature-wise, and even more in some
cases. An optional compat mode wraps some v3-specific services when
needed. The target spec is a subset of POSIX.1-2024 for evl, although
this only meant adding pthread_cond_clockwait(),
pthread_mutex_clocklock() and sem_clockwait() so far.

libcobalt is not an emulation of POSIX calls on top of the original API,
it is a standalone implementation sharing a set of intrinsics with the
latter. These low-level intrinsics talk to the evl core, keeping the
nitty-gritty details out of the window dressing, i.e. the user-facing
APIs.  They are part of libevl.so, and both APIs use them the way they
see fit. If you plan to write your own real-time API leveraging the evl
core services, go with the intrinsics in libevl, this is their basic
purpose.

Documentation is not there yet (how odd?!). This said, there is an
ongoing work revamping the x4 website in order to introduce this new API
and some kind of versioning as well, so everything will land in one go.

Crash course: libevl builds the POSIX API by default, you only need to
pass -Dcompat=true to meson for enabling the full v3 compat shim. Once
installed, use `pkgconfig --libs|--cflags cobalt` to retrieve the build
flags for using libcobalt. evl-test runs the POSIX test suite if present
along with the test suite of the original API.  That's it (_that_ was
short!).

The implementation required additional services from the core, so
changes went to linux-evl as well. The core stays POSIX-free, but it
does provide a couple of new general-purpose services which are
convenient for implementing a POSIX API in user-space (e.g. see the new
'depot' element).

NOTE: The code stops short of one aspect: it does not provide symbol
wrapping like v3 does (using ld's --wrap trick); explicit annotation
using __EVL(call), __COBALT(call) or __RT(call) [all aliases] is
required at the moment. This is deliberate, this needs more thought
because symbol wrapping the way v3 implements it proved to have nasty
pitfalls over the years, as it comes with hidden edge cases. I plan to
RFC on this in a separate thread.

I merged the POSIX support and its test suite to the next/ branches in
linux-evl and libevl; the kernel part should move to the plain rebase
branches once the CI says that all is fine with its test configs. At the
moment, evl-6.12.y-cip, evl-6.18.y and evl-7.2 are up to date with the
POSIX support. evl-v7.3 is late, but almost ready and will appear in the
coming days (I'm almost late for v7.4 which means that everything is
going -*cough*- as planned). Keep Calm and Rebase.

-- 
Philippe.

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

* Re: [EVL] A POSIX interface has landed
  2026-11-22 20:31 [EVL] A POSIX interface has landed Philippe Gerum
@ 2026-11-22 20:50 ` Florian Bezdeka
  2026-11-23 19:09   ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Bezdeka @ 2026-11-22 20:50 UTC (permalink / raw)
  To: Philippe Gerum, Xenomai; +Cc: Jan Kiszka

Hi Philippe,

On Sun Nov 22, 2026 at 9:31 PM CET, Philippe Gerum wrote:
>
> After several iterations, pauses and rewrites, a POSIX-conforming
> interface is finally available with libevl, alongside the original EVL
> API. 'libcobalt.so' is generated and installed with its headers
> side-by-side with 'libevl.so'. We can use any of them or both,
> separately or combined in a single application. The main goal is to
> cover what x3's libcobalt provides feature-wise, and even more in some
> cases. An optional compat mode wraps some v3-specific services when
> needed. The target spec is a subset of POSIX.1-2024 for evl, although
> this only meant adding pthread_cond_clockwait(),
> pthread_mutex_clocklock() and sem_clockwait() so far.
>
> libcobalt is not an emulation of POSIX calls on top of the original API,
> it is a standalone implementation sharing a set of intrinsics with the
> latter. These low-level intrinsics talk to the evl core, keeping the
> nitty-gritty details out of the window dressing, i.e. the user-facing
> APIs.  They are part of libevl.so, and both APIs use them the way they
> see fit. If you plan to write your own real-time API leveraging the evl
> core services, go with the intrinsics in libevl, this is their basic
> purpose.
>
> Documentation is not there yet (how odd?!). This said, there is an
> ongoing work revamping the x4 website in order to introduce this new API
> and some kind of versioning as well, so everything will land in one go.
>
> Crash course: libevl builds the POSIX API by default, you only need to
> pass -Dcompat=true to meson for enabling the full v3 compat shim. Once
> installed, use `pkgconfig --libs|--cflags cobalt` to retrieve the build
> flags for using libcobalt. evl-test runs the POSIX test suite if present
> along with the test suite of the original API.  That's it (_that_ was
> short!).
>
> The implementation required additional services from the core, so
> changes went to linux-evl as well. The core stays POSIX-free, but it
> does provide a couple of new general-purpose services which are
> convenient for implementing a POSIX API in user-space (e.g. see the new
> 'depot' element).
>
> NOTE: The code stops short of one aspect: it does not provide symbol
> wrapping like v3 does (using ld's --wrap trick); explicit annotation
> using __EVL(call), __COBALT(call) or __RT(call) [all aliases] is
> required at the moment. This is deliberate, this needs more thought
> because symbol wrapping the way v3 implements it proved to have nasty
> pitfalls over the years, as it comes with hidden edge cases. I plan to
> RFC on this in a separate thread.

Is that the only blocker for running the x3 testsuite over x4?

__RT() and __STD() kept me busy so often, I'm wondering if we should
really implement both of them - if at all - again. 

Shouldn't be __STD() be enough? (You get __RT() by default, but there
should be a way to call the "hidden" libc services.)

>
> I merged the POSIX support and its test suite to the next/ branches in
> linux-evl and libevl; the kernel part should move to the plain rebase
> branches once the CI says that all is fine with its test configs. At the
> moment, evl-6.12.y-cip, evl-6.18.y and evl-7.2 are up to date with the
> POSIX support. evl-v7.3 is late, but almost ready and will appear in the
> coming days (I'm almost late for v7.4 which means that everything is
> going -*cough*- as planned). Keep Calm and Rebase.

I should try to reserve some time to look into this in more detail.
Sounds very promising so far.

Florian

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

* Re: [EVL] A POSIX interface has landed
  2026-11-22 20:50 ` Florian Bezdeka
@ 2026-11-23 19:09   ` Philippe Gerum
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Gerum @ 2026-11-23 19:09 UTC (permalink / raw)
  To: Florian Bezdeka; +Cc: Xenomai, Jan Kiszka

Florian Bezdeka <florian.bezdeka@siemens.com> writes:

> Hi Philippe,
>
> On Sun Nov 22, 2026 at 9:31 PM CET, Philippe Gerum wrote:
>>
>> After several iterations, pauses and rewrites, a POSIX-conforming
>> interface is finally available with libevl, alongside the original EVL
>> API. 'libcobalt.so' is generated and installed with its headers
>> side-by-side with 'libevl.so'. We can use any of them or both,
>> separately or combined in a single application. The main goal is to
>> cover what x3's libcobalt provides feature-wise, and even more in some
>> cases. An optional compat mode wraps some v3-specific services when
>> needed. The target spec is a subset of POSIX.1-2024 for evl, although
>> this only meant adding pthread_cond_clockwait(),
>> pthread_mutex_clocklock() and sem_clockwait() so far.
>>
>> libcobalt is not an emulation of POSIX calls on top of the original API,
>> it is a standalone implementation sharing a set of intrinsics with the
>> latter. These low-level intrinsics talk to the evl core, keeping the
>> nitty-gritty details out of the window dressing, i.e. the user-facing
>> APIs.  They are part of libevl.so, and both APIs use them the way they
>> see fit. If you plan to write your own real-time API leveraging the evl
>> core services, go with the intrinsics in libevl, this is their basic
>> purpose.
>>
>> Documentation is not there yet (how odd?!). This said, there is an
>> ongoing work revamping the x4 website in order to introduce this new API
>> and some kind of versioning as well, so everything will land in one go.
>>
>> Crash course: libevl builds the POSIX API by default, you only need to
>> pass -Dcompat=true to meson for enabling the full v3 compat shim. Once
>> installed, use `pkgconfig --libs|--cflags cobalt` to retrieve the build
>> flags for using libcobalt. evl-test runs the POSIX test suite if present
>> along with the test suite of the original API.  That's it (_that_ was
>> short!).
>>
>> The implementation required additional services from the core, so
>> changes went to linux-evl as well. The core stays POSIX-free, but it
>> does provide a couple of new general-purpose services which are
>> convenient for implementing a POSIX API in user-space (e.g. see the new
>> 'depot' element).
>>
>> NOTE: The code stops short of one aspect: it does not provide symbol
>> wrapping like v3 does (using ld's --wrap trick); explicit annotation
>> using __EVL(call), __COBALT(call) or __RT(call) [all aliases] is
>> required at the moment. This is deliberate, this needs more thought
>> because symbol wrapping the way v3 implements it proved to have nasty
>> pitfalls over the years, as it comes with hidden edge cases. I plan to
>> RFC on this in a separate thread.
>
> Is that the only blocker for running the x3 testsuite over x4?
>

To run it mostly unmodified, testbed apart? I believe so.  The POSIX
test scenarios in x3 have been implemented in the x4 test suite using
explicit annotation, and those tests are all green. So far, so good.

> __RT() and __STD() kept me busy so often, I'm wondering if we should
> really implement both of them - if at all - again. 
>
> Shouldn't be __STD() be enough? (You get __RT() by default, but there
> should be a way to call the "hidden" libc services.)
>

The issue with __STD() as the only explicit marker would be that we
would then exclusively rely on symbol wrapping to reach libcobalt
services, which raises some problems. I'll follow up on this in a
separate thread.

-- 
Philippe.

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

end of thread, other threads:[~2026-11-23 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 20:31 [EVL] A POSIX interface has landed Philippe Gerum
2026-11-22 20:50 ` Florian Bezdeka
2026-11-23 19:09   ` Philippe Gerum

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.