rust-embedded / rust-embedded/riscv

[Question] riscv-rt v-trap: two jumps to reach the interrupt handler?

Open
#405 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.1k
Forks
200
Avg merge
11d 2h
Merged PRs (30d)
2

Description

@romancardenas I have a question regarding the interrupt handler, in v-trap mode, two software jumps are needed before the handler body runs:

j _continue_interrupt_trap - from the per-interrupt entry stub
jalr ra, a0, 0 - indirect call to the actual handler
Is this intentional for code size reasons (shared save/restore stub)? wouldnt this increase the interrupt latency?

would like to understand the design rationale here, thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the v-trap per-interrupt entry stub, _continue_interrupt_trap, and the jalr ra, a0, 0 handoff described in the issue. Trace both jumps to determine whether the shared save/restore design explains the sequence and document the rationale, including any interrupt-latency trade-off.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.