Skip to content

riscv-macros: add all the macros required by riscv-rt#389

Merged
romancardenas merged 5 commits intorust-embedded:masterfrom
romancardenas:riscv-macros
Feb 9, 2026
Merged

riscv-macros: add all the macros required by riscv-rt#389
romancardenas merged 5 commits intorust-embedded:masterfrom
romancardenas:riscv-macros

Conversation

@romancardenas
Copy link
Contributor

@romancardenas romancardenas commented Feb 2, 2026

This PR reimplements all the macros previously on riscv-rt-macros to riscv-macros.

The macro code is now more modular, which will potentially help us maintaining the source code as well as adding new attribute macros if needed. Note also that, now, the attribute macros for riscv-rt functions output multiple errors in a single run. This will improve the developer experience, as with a single compilation attempt, they can see all the errors and address them before re-trying.

This PR also deprecates riscv-rt-macros in favor of riscv-macros.

Now, riscv-rt does not re-export the pre_init attribute macro, which was already deprecated. Users now have to use core::arch::global_asm!

This PR substitutes #386 , as it contains the same changes but with a clean commit history. I hope it is relatively easy to review now!

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Macros are not my area of expertise, but this looks okay from my first glance, and reasonably well tested. Thanks!

@romancardenas romancardenas added this pull request to the merge queue Feb 9, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 9, 2026
`riscv-macros`: add all the macros required by `riscv-rt`
@romancardenas romancardenas removed this pull request from the merge queue due to a manual request Feb 9, 2026
@romancardenas romancardenas added this pull request to the merge queue Feb 9, 2026
Merged via the queue into rust-embedded:master with commit 187453b Feb 9, 2026
165 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.

2 participants