qemu-rust
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/12] rust: irq: define ObjectType for IRQState


From: Zhao Liu
Subject: Re: [PATCH 10/12] rust: irq: define ObjectType for IRQState
Date: Tue, 11 Feb 2025 11:31:35 +0800

> +unsafe impl ObjectType for IRQState {
> +    type Class = ObjectClass;
> +    const TYPE_NAME: &'static CStr =
> +        unsafe { CStr::from_bytes_with_nul_unchecked(bindings::TYPE_IRQ) };
> +}
> +qom_isa!(IRQState: Object);

This is necessary for Owned<>, though IRQState has been defined in C.
It's another example to handle the C object in Rust (the previous one is
SysbusDevice).

LGTM,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]