Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: Check code format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --target ${{ matrix.targets }} --all-features -- -A clippy::new_without_default
run: cargo clippy --target ${{ matrix.targets }} --all-features -- -D warnings
- name: Build
run: cargo build --target ${{ matrix.targets }} --all-features
run: cargo build --target ${{ matrix.targets }} --all-features
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
40 changes: 40 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/gic_v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,18 @@ impl GicDistributor {

fn mpidr_affinity_level(mpidr: u64, level: u32) -> u64 {
match level {
3 => mpidr >> 32 & 0xff,
2 => mpidr >> 16 & 0xff,
1 => mpidr >> 8 & 0xff,
3 => (mpidr >> 32) & 0xff,
2 => (mpidr >> 16) & 0xff,
1 => (mpidr >> 8) & 0xff,
0 => mpidr & 0xff,
_ => panic!("invalid affinity level"),
}
}

fn mpidr_to_affinity_level(mpidr: u64) -> u64 {
Self::mpidr_affinity_level(mpidr, 3) << 32
| Self::mpidr_affinity_level(mpidr, 2) << 16
| Self::mpidr_affinity_level(mpidr, 1) << 8
(Self::mpidr_affinity_level(mpidr, 3) << 32)
| (Self::mpidr_affinity_level(mpidr, 2) << 16)
| (Self::mpidr_affinity_level(mpidr, 1) << 8)
| Self::mpidr_affinity_level(mpidr, 0)
}

Expand Down Expand Up @@ -327,7 +327,7 @@ impl GicRedistributor {

fn base_init(&mut self) {
let typer = self.gicr_regs().TYPER.get() as usize;
let mut ppinum = typer >> 27 & 0x1f;
let mut ppinum = (typer >> 27) & 0x1f;
ppinum = match ppinum {
0 => 16,
1 | 2 => 16 + 32 * ppinum,
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
//! Please contact the developer if you need this function

#![no_std]
#![feature(const_ptr_as_ref)]
#![feature(const_option)]
#![feature(const_nonnull_new)]

use core::fmt;
use core::fmt::{Debug, Formatter};
Expand Down