rust-embedded / rust-embedded/aarch32

Split GIC in SMP examples (in #127)

Open
#135 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
66
Forks
25
Avg merge
4d 6h
Merged PRs (30d)
4

Description

Rather than:

static GLOBAL_GIC: Mutex<RefCell<Option<arm_gic::gicv3::GicV3<'static>>>> = Mutex::new(RefCell::new(None));

We should have

static GLOBAL_GIC_DIST: Mutex<RefCell<Option<arm_gic::gicv3::GicDistributor<'static>>>> = Mutex::new(RefCell::new(None));

pub unsafe fn get_redist() -> arm_gic::gicv3::GicRedistributor<'static> {
   // Read MPIDR register, and return the GIC Redistributor object for that particular core
}

That is, we have one global, shared, Mutex-projected object for the Distributor, and local per-core objects for the Redistributor.

See https://documentation-service.arm.com/static/6273be2d7e121f01fd22f145:

Image

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 in the SMP examples and locate the GLOBAL_GIC declaration and uses of arm_gic::gicv3::GicV3. Read the GICv3 distributor and redistributor APIs, then inspect the MPIDR register access needed by get_redist. Done means the distributor is globally shared while each core obtains its own redistributor object.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.