Add semaphore primitives to SAL RTOS interface#302
Merged
Conversation
Closed
Copilot
AI
changed the title
[WIP] Add semaphores to SAL
Add semaphore primitives to SAL RTOS interface
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SAL exposed mutex primitives but had no semaphore support, which left synchronization incomplete for RTOS-style usage. This change adds semaphore APIs to the SAL contract and default system-side implementation.
SAL API surface (RTOS section)
inc/dmod_sal.h:Dmod_Semaphore_New(uint32_t InitialValue)Dmod_Semaphore_Wait(void* Semaphore)Dmod_Semaphore_Post(void* Semaphore)Dmod_Semaphore_Delete(void* Semaphore)Default system implementation (weak symbols)
src/system/if/dmod_if_rtos.cusing POSIX semaphores (sem_t).Public system tests
tests/system/public/tests_dmod_semaphore.cppand registered it intests/system/public/CMakeLists.txt.Integration docs
README.mdto include semaphore primitives alongside mutexes.