Skip to content

Fixed the IRQ_BEGIN/END macros in arm-cr/qk/gnu port#61

Open
mikael-s-persson wants to merge 2 commits into
QuantumLeaps:masterfrom
mikael-s-persson:fix/arm_cr_qk_gnu_asm
Open

Fixed the IRQ_BEGIN/END macros in arm-cr/qk/gnu port#61
mikael-s-persson wants to merge 2 commits into
QuantumLeaps:masterfrom
mikael-s-persson:fix/arm_cr_qk_gnu_asm

Conversation

@mikael-s-persson

Copy link
Copy Markdown

I fixed the QK_IRQ_BEGIN/END macros in the arm-cr/qk/gnu port. It needed the same indirection as in ti port to separate the C code (incl. user code) from the assembly blocks within the naked function. Mixing C code and assembly in a naked function has always been undefined behavior, and LLVM family of compilers will refuse to compile that, while GCC just screams loudly.
Also, I updated the VFP instructions to unified (UAL) mnemonics, since the GNU compilers I have used (GCC and Clang) have poor, partial and increasingly-deprecated support for legacy mnemonics and requiring UAL support is certainly no more restrictive than requiring C11, since the former much predates the latter, afaik.
I also removed the __attribute__ ((interrupt ("irq"))) which makes no sense for a naked function (and ultimately has no effect, except generating compiler warnings) with a hand-written prologue/epilogue.

As far as I know, this should all work (it's the exact same mechanism as in TI port, which I have tested extensively), but I don't really have a hardware setup to test this on (or at least, the setup is not complete yet). All I can say is that the resulting assembly (from objdump-disassembly) is identical between TI and GNU ports when it comes to the ISRs defined with these macros after this change.

quantum-leaps and others added 2 commits June 7, 2026 20:09
… indirection as in ti port for separating C code from assembly blocks in naked function. Also, updated the VFP instructions to UAL mnemonics, since the GNU compilers I have used (GCC and Clang) have poor and deprecated support for legacy mnemonics and use UAL since around 2011.
@quantum-leaps

Copy link
Copy Markdown
Contributor

Hi Mikael,
Thank you for looking into the QP port to ARM Cortex-R. I will try to test your PR on the TI Hercules board. I'll post here when I have some results.
--MMS

@quantum-leaps quantum-leaps force-pushed the master branch 2 times, most recently from 90a452e to 6e3af9f Compare June 18, 2026 12:29
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.

2 participants