fn plic_irq_enable(interrupt: Interrupt, enabled: bool) {
    let targetid = mhartid::read() * 2;
    let irq_nr = interrupt.nr();
    unsafe {
        let plic = pac::PLIC::ptr();
        let bit = 1 << ((irq_nr as u32) % 32);
        if enabled {
            (*plic).target_enables[targetid].enable[(irq_nr as usize) / 32]
                .modify(|r, w| w.bits(r.bits() | bit));
        } else {
            (*plic).target_enables[targetid].enable[(irq_nr as usize) / 32]
                .modify(|r, w| w.bits(r.bits() & !bit));
        }
    }
}
/** Enable or disable a PLIC interrupt for the current core */
Enable or disable a PLIC interrupt for the current core
Enable or disable a PLIC interrupt for the current core
fn plic_irq_enable(interrupt: Interrupt, enabled: bool) {
    let targetid = mhartid::read() * 2;
    let irq_nr = interrupt.nr();
    unsafe {
        let plic = pac::PLIC::ptr();
        let bit = 1 << ((irq_nr as u32) % 32);
        if enabled {
            (*plic).target_enables[targetid].enable[(irq_nr as usize) / 32]
                .modify(|r, w| w.bits(r.bits() | bit));
        } else {
            (*plic).target_enables[targetid].enable[(irq_nr as usize) / 32]
                .modify(|r, w| w.bits(r.bits() & !bit));
        }
    }
}
fn plic_irq_enable ( interrupt : Interrupt , enabled : bool ) { let targetid = mhartid :: read ( ) * 2 ; let irq_nr = interrupt . nr ( ) ; unsafe { let plic = pac :: PLIC :: ptr ( ) ; let bit = 1 << ( ( irq_nr as u32 ) % 32 ) ; if enabled { ( * plic ) . target_enables [ targetid ] . enable [ ( irq_nr as usize ) / 32 ] . modify ( | r , w | w . bits ( r . bits ( ) | bit ) ) ; } else { ( * plic ) . target_enables [ targetid ] . enable [ ( irq_nr as usize ) / 32 ] . modify ( | r , w | w . bits ( r . bits ( ) & ! bit ) ) ; } } }
Enable or disable a PLIC interrupt for the current core
Enable or disable a PLIC interrupt for the current core
interrupt
Interrupt
enabled
bool
interrupt
Interrupt
enabled
bool