Add weak interrupt handler prototypes for RTOS-essential ISRs#20
Merged
JohnAmadis merged 3 commits intomainfrom Feb 22, 2026
Merged
Add weak interrupt handler prototypes for RTOS-essential ISRs#20JohnAmadis merged 3 commits intomainfrom
JohnAmadis merged 3 commits intomainfrom
Conversation
…c, systick) Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add weak prototypes for essential interrupts
Add weak interrupt handler prototypes for RTOS-essential ISRs
Feb 22, 2026
JohnAmadis
requested changes
Feb 22, 2026
include/dmosi.h
Outdated
| * Override this weak implementation with the RTOS-specific context-switch | ||
| * handler. | ||
| */ | ||
| DMOD_BUILTIN_API( dmosi, 1.0, void, _pendsv_handler, (void) ); |
Contributor
There was a problem hiding this comment.
Przecież pisalem o uniwersalnych nazwach niezależnych od architektury. To co - na riscv tak samo to nazwiesz? Postaraj się bardziej, tak to każdy głupi potrafi zrobić
Contributor
Author
There was a problem hiding this comment.
Renamed to architecture-independent functional names (cc2170f):
dmosi_context_switch_handler— context switch (ARM:PendSV_Handler, RISC-V: software interrupt)dmosi_syscall_handler— system/supervisor call (ARM:SVC_Handler, RISC-V: ecall / machine-mode trap)dmosi_tick_handler— RTOS time tick (ARM:SysTick_Handler, RISC-V: machine timer interrupt)
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
JohnAmadis
approved these changes
Feb 22, 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.
RTOS implementations require specific interrupt handlers (context switch, supervisor call, system tick) that are named differently across architectures and RTOS vendors. This adds architecture-independent, dmosi-standardized weak (no-op) prototypes so RTOS ports can override them with strong implementations without needing to know the underlying naming conventions.
Changes
include/dmosi.h— NewInterrupt Handler APIsection withDMOD_BUILTIN_APIdeclarations using architecture-independent names:dmosi_context_switch_handler()— RTOS context switching (ARM Cortex-M:PendSV_Handler; RISC-V: software interrupt ISR)dmosi_syscall_handler()— RTOS system/supervisor call (ARM Cortex-M:SVC_Handler; RISC-V: ecall / machine-mode trap handler)dmosi_tick_handler()— RTOS periodic time tick (ARM Cortex-M:SysTick_Handler; RISC-V: machine timer interrupt handler)src/dmosi.c— Empty weak implementations viaDMOD_INPUT_WEAK_API_DECLARATION, consistent with all other APIs in the file.README.md— Documents the new API as section 7 with a cross-architecture mapping table.Usage
An RTOS port overrides the relevant handlers as strong symbols:
The startup/vector table then aliases the architecture-specific ISR names to the dmosi names, keeping all RTOS integration behind the dmosi interface regardless of the target architecture.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.