Skip to content

Split osal into interface library and implementation#32

Merged
hefloryd merged 4 commits into
rtlabs-com:masterfrom
elupus:interface
May 22, 2026
Merged

Split osal into interface library and implementation#32
hefloryd merged 4 commits into
rtlabs-com:masterfrom
elupus:interface

Conversation

@elupus
Copy link
Copy Markdown
Contributor

@elupus elupus commented Nov 4, 2025

Expose a osal-interface target that is of cmake INTERFACE type. This target only defines the osal API and allow delaying the choice of linking of final osal port implementation to the link stage of the binary. This allow the Osal implementation to be defined by the integrator of used libraries.

To accomplish this:

  • osal.h becomes static and common to all targets
  • osal_sys.h is changed to an internal implementation header for the osal port
  • Buld files are restructured to keep build configuration of a port in the port directory

By default an osal cmake alias is added to remain compatible with previous solutions.

@elupus elupus force-pushed the interface branch 4 times, most recently from 8d30800 to e2a49e5 Compare November 4, 2025 16:04
os_log is a global function pointer to allow
redirecting logging to other targets since a
while back. Freertos port should support this.
Not all ports set compile options on the files, so
we should support empty lists on all of these files.
Instead of making this choice compile time,
install all supported compiler headers by default.
Copy link
Copy Markdown
Contributor

@hefloryd hefloryd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor comments

Comment thread include/sys/osal_cc_clang.h Outdated
Comment thread include/sys/osal_cc_clang.h Outdated
Comment thread src/freertos/CMakeLists.txt
Comment thread test/CMakeLists.txt Outdated
@elupus elupus force-pushed the interface branch 3 times, most recently from 7c0da1a to 357677c Compare April 27, 2026 12:29
Expose a osal-interface target that is of cmake INTERFACE type.
This target only defines the osal API and allow delaying the
choice of linking of final osal port implementation to the
link stage of the binary. This allow the Osal implementation
to be defined by the integrator of used libraries.

To accomplish this:
- osal.h becomes static and common to all targets
- osal_sys.h is changed to an internal implementation
  header for the osal port
- Build files are restructured to keep build configuration of
  a port in the port directory

By default an osal cmake alias is added to remain
compatible with previous solutions.
@elupus elupus marked this pull request as ready for review April 28, 2026 07:24
@amn-rtl
Copy link
Copy Markdown

amn-rtl commented Apr 28, 2026

Looks good.

@hefloryd hefloryd merged commit e6c3583 into rtlabs-com:master May 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants