Skip to content

Register interrupt controller for RV64 #487

Description

@ytakano
  1. Implement InterruptController trait for RV64.

pubtraitInterruptController:Sync + Send{
fnenable_irq(&mutself,irq:u16);
fndisable_irq(&mutself,irq:u16);
fnpending_irqs(&self) -> Box<dynIterator<Item = u16>>;
/// Send an inter-process interrupt to `target` CPU.
fnsend_ipi(&mutself,irq:u16,cpu_id:u32);
/// Send an inter-process interrupt to all CPUs.
fnsend_ipi_broadcast(&mutself,irq:u16);
/// Send an inter-process interrupt to all CPUs except the sender CPU.
fnsend_ipi_broadcast_without_self(&mutself,irq:u16);
/// Initialization for non-primary core.
fninit_non_primary(&mutself){}
/// End of interrupt.
/// This will be used by only x86_64.
fneoi(&mutself){}
/// Return the range of IRQs, which can be registered.
/// The range is [start, end).
fnirq_range(&self) -> (u16,u16);
/// Return the range of IRQs, which can be used for PnP devices.
/// The range is [start, end).
fnirq_range_for_pnp(&self) -> (u16,u16);
/// Set the PCIe MSI or MSI-X interrupt
#[allow(unused_variables)]
fnset_pcie_msi(
&self,
segment_number:usize,
target:u32,
irq:u16,
message_data:&mutu32,
message_address:&mutu32,
message_address_upper:Option<&mutu32>,
) -> Result<IRQ,&'staticstr>{
Err("Interrupt controller does not support PCIe MSI or MSI-X.")
}
}

  1. Register the interrupt controller.

pubunsafefnregister_interrupt_controller(controller:Box<dynInterruptController>){

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions