Skip to content

Adds SMP functionality for RISC-V - #859

Open
EAlexJ wants to merge 6 commits into
eclipse-threadx:devfrom
Minres:master
Open

EAlexJ wants to merge 6 commits into
eclipse-threadx:devfrom
Minres:master

Conversation

@EAlexJ

@EAlexJ EAlexJ commented Dec 4, 2026

Copy link
Copy Markdown

This contribution provides basic SMP functionality for RISC-V.
I ran it on a virtual platform with RV32GC and RV64GC processors and an ACLINT providing timer and Inter-process interrupts.
It passes all tests with Debug and Release build options.

This port was originally based on a manual (as in human) implementation of the non-SMP kernel that used defines to provide differentiation between RV32 and RV64 using defines.

Since this was decided against in the current upstream implementation I employed AI to do the rewrite of defines to the corresponding instructions.

Limits the teardown watchdog to host ports, preserves the cleanup walk guard, and restores polling of state shared with threads and interrupts. Resets the delayed-suspension calibration counter before each sample.
Preserve the single-core sources from 227586c
as the reference for the following SMP changes.
Adapt the corresponding single-core context code to per-hart state and atomic context publication. Keep board startup, timer setup, and IPI routing in BSP hooks. Check the C layout at build time and use the upstream RV64 timer pointer extension with a 32-bit ULONG.

Verified both Debug SMP suites and both hard-float context tests on HERE VP.

Assisted-by: Codex (GPT-6) <[email protected]>
Keep the GNU single-core LONG and ULONG type aliases for RV32 SMP. The RV64 port keeps int-width aliases and native-width pointers.

Assisted-by: Codex (GPT-6) <[email protected]>
@EAlexJ
EAlexJ changed the base branch from master to dev December 4, 2026 13:47

This branch has not been deployed

No deployments
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.

1 participant