fn finalize_device(gic_device: &Box<dyn GICDevice>) -> Result<()>
    where
        Self: Sized,
    {
        /* We need to tell the kernel how many irqs to support with this vgic.
         * See the `layout` module for details.
         */
        let nr_irqs: u32 = super::super::layout::IRQ_MAX - super::super::layout::IRQ_BASE + 1;
        let nr_irqs_ptr = &nr_irqs as *const u32;
        Self::set_device_attribute(
            gic_device.device_fd(),
            kvm_bindings::KVM_DEV_ARM_VGIC_GRP_NR_IRQS,
            0,
            nr_irqs_ptr as u64,
            0,
        )?;

        /* Finalize the GIC.
         * See https://code.woboq.org/linux/linux/virt/kvm/arm/vgic/vgic-kvm-device.c.html#211.
         */
        Self::set_device_attribute(
            gic_device.device_fd(),
            kvm_bindings::KVM_DEV_ARM_VGIC_GRP_CTRL,
            u64::from(kvm_bindings::KVM_DEV_ARM_VGIC_CTRL_INIT),
            0,
            0,
        )?;

        Ok(())
    }
/// Finalize the setup of a GIC device
Finalize the setup of a GIC device
Finalize the setup of a GIC device
fn finalize_device(gic_device: &Box<dyn GICDevice>) -> Result<()>
    where
        Self: Sized,
    {
        /* We need to tell the kernel how many irqs to support with this vgic.
         * See the `layout` module for details.
         */
        let nr_irqs: u32 = super::super::layout::IRQ_MAX - super::super::layout::IRQ_BASE + 1;
        let nr_irqs_ptr = &nr_irqs as *const u32;
        Self::set_device_attribute(
            gic_device.device_fd(),
            kvm_bindings::KVM_DEV_ARM_VGIC_GRP_NR_IRQS,
            0,
            nr_irqs_ptr as u64,
            0,
        )?;
        /* Finalize the GIC.
         * See https://code.woboq.org/linux/linux/virt/kvm/arm/vgic/vgic-kvm-device.c.html#211.
         */
        Self::set_device_attribute(
            gic_device.device_fd(),
            kvm_bindings::KVM_DEV_ARM_VGIC_GRP_CTRL,
            u64::from(kvm_bindings::KVM_DEV_ARM_VGIC_CTRL_INIT),
            0,
            0,
        )?;
        Ok(())
    }
fn finalize_device ( gic_device : & Box < dyn GICDevice > ) -> Result < ( ) > where Self : Sized , { /* We need to tell the kernel how many irqs to support with this vgic.
         * See the `layout` module for details.
         */ let nr_irqs : u32 = super :: super :: layout :: IRQ_MAX - super :: super :: layout :: IRQ_BASE + 1 ; let nr_irqs_ptr = & nr_irqs as * const u32 ; Self :: set_device_attribute ( gic_device . device_fd ( ) , kvm_bindings :: KVM_DEV_ARM_VGIC_GRP_NR_IRQS , 0 , nr_irqs_ptr as u64 , 0 , ) ? ; /* Finalize the GIC.
         * See https://code.woboq.org/linux/linux/virt/kvm/arm/vgic/vgic-kvm-device.c.html#211.
         */ Self :: set_device_attribute ( gic_device . device_fd ( ) , kvm_bindings :: KVM_DEV_ARM_VGIC_GRP_CTRL , u64 :: from ( kvm_bindings :: KVM_DEV_ARM_VGIC_CTRL_INIT ) , 0 , 0 , ) ? ; Ok ( ( ) ) }
Finalize the setup of a GIC device
Finalize the setup of a GIC device
gic_device
&Box<dyn GICDevice>