Skip to content

Commit

Permalink
Use u64 instead of usize
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanRoyer committed Apr 5, 2023
1 parent ddf05f1 commit 25e20a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions kernel/gic/src/gic/cpu_interface_gicv3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use super::Priority;
use super::InterruptNumber;

const SGIR_TARGET_ALL_OTHER_PE: u64 = 1 << 40;
const IGRPEN_ENABLED: usize = 1;
const IGRPEN_ENABLED: u64 = 1;

/// Enables routing of group 1 interrupts for the current CPU and configures
/// the end-of-interrupt mode
pub fn init() {
let mut icc_ctlr: usize;
let mut icc_ctlr: u64;

unsafe { asm!("mrs {}, ICC_CTLR_EL1", out(reg) icc_ctlr) };
// clear bit 1 (EOIMode) so that eoi signals both
Expand All @@ -40,7 +40,7 @@ pub fn init() {
/// until this CPU or another one is ready to handle
/// them
pub fn get_minimum_priority() -> Priority {
let mut reg_value: usize;
let mut reg_value: u64;
unsafe { asm!("mrs {}, ICC_PMR_EL1", out(reg) reg_value) };
u8::MAX - (reg_value as u8)
}
Expand All @@ -50,15 +50,15 @@ pub fn get_minimum_priority() -> Priority {
/// until this CPU or another one is ready to handle
/// them
pub fn set_minimum_priority(priority: Priority) {
let reg_value = (u8::MAX - priority) as usize;
let reg_value = (u8::MAX - priority) as u64;
unsafe { asm!("msr ICC_PMR_EL1, {}", in(reg) reg_value) };
}

/// Signals to the controller that the currently processed interrupt has
/// been fully handled, by zeroing the current priority level of this CPU.
/// This implies that the CPU is ready to process interrupts again.
pub fn end_of_interrupt(int: InterruptNumber) {
let reg_value = int as usize;
let reg_value = int as u64;
unsafe { asm!("msr ICC_EOIR1_EL1, {}", in(reg) reg_value) };
}

Expand All @@ -67,8 +67,8 @@ pub fn end_of_interrupt(int: InterruptNumber) {
/// the requested interrupt is being handled by
/// this CPU.
pub fn acknowledge_interrupt() -> (InterruptNumber, Priority) {
let int_num: usize;
let priority: usize;
let int_num: u64;
let priority: u64;

// Reading the interrupt number has the side effect
// of acknowledging the interrupt.
Expand Down

0 comments on commit 25e20a7

Please sign in to comment.