MCPcopy Index your code
hub / github.com/cloud-hypervisor/cloud-hypervisor / create_virtio_node

Function create_virtio_node

arch/src/aarch64/fdt.rs:764–779  ·  view source on GitHub ↗
(
    fdt: &mut FdtWriter,
    dev_info: &T,
)

Source from the content-addressed store, hash-verified

762}
763
764fn create_virtio_node<T: DeviceInfoForFdt + Clone + Debug>(
765 fdt: &mut FdtWriter,
766 dev_info: &T,
767) -> FdtWriterResult<()> {
768 let device_reg_prop = [dev_info.addr(), dev_info.length()];
769 let irq = [GIC_FDT_IRQ_TYPE_SPI, dev_info.irq(), IRQ_TYPE_EDGE_RISING];
770
771 let virtio_node = fdt.begin_node(&format!("virtio_mmio@{:x}", dev_info.addr()))?;
772 fdt.property_string("compatible", "virtio,mmio")?;
773 fdt.property_array_u64("reg", &device_reg_prop)?;
774 fdt.property_array_u32("interrupts", &irq)?;
775 fdt.property_u32("interrupt-parent", GIC_PHANDLE)?;
776 fdt.end_node(virtio_node)?;
777
778 Ok(())
779}
780
781fn create_serial_node<T: DeviceInfoForFdt + Clone + Debug>(
782 fdt: &mut FdtWriter,

Callers 1

create_devices_nodeFunction · 0.85

Calls 3

addrMethod · 0.45
lengthMethod · 0.45
irqMethod · 0.45

Tested by

no test coverage detected