diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2025-01-17 11:26:48 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-13 12:19:34 +0100 |
commit | 5472a38cb9e10bda897fc29d4841c00476f22585 (patch) | |
tree | 5ec1135a2ec4320aead9bcf609fcfbdcb8a52e37 /rust/hw | |
parent | 68da5402df003a855c581563acc6f5f8c5d563f0 (diff) | |
download | qemu-5472a38cb9e10bda897fc29d4841c00476f22585.zip qemu-5472a38cb9e10bda897fc29d4841c00476f22585.tar.gz qemu-5472a38cb9e10bda897fc29d4841c00476f22585.tar.bz2 |
rust: qdev: switch from legacy reset to Resettable
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/hw')
-rw-r--r-- | rust/hw/char/pl011/src/device.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs index 37936a3..1d0390b 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -18,7 +18,7 @@ use qemu_api::{ c_str, impl_vmstate_forward, irq::InterruptSource, prelude::*, - qdev::{Clock, ClockEvent, DeviceImpl, DeviceState, Property}, + qdev::{Clock, ClockEvent, DeviceImpl, DeviceState, Property, ResetType, ResettablePhasesImpl}, qom::{ClassInitImpl, ObjectImpl, Owned, ParentField}, sysbus::{SysBusDevice, SysBusDeviceClass}, vmstate::VMStateDescription, @@ -171,7 +171,10 @@ impl DeviceImpl for PL011State { Some(&device_class::VMSTATE_PL011) } const REALIZE: Option<fn(&Self)> = Some(Self::realize); - const RESET: Option<fn(&Self)> = Some(Self::reset); +} + +impl ResettablePhasesImpl for PL011State { + const HOLD: Option<fn(&Self, ResetType)> = Some(Self::reset_hold); } impl PL011Registers { @@ -622,7 +625,7 @@ impl PL011State { } } - pub fn reset(&self) { + pub fn reset_hold(&self, _type: ResetType) { self.regs.borrow_mut().reset(); } @@ -737,3 +740,4 @@ impl ObjectImpl for PL011Luminary { } impl DeviceImpl for PL011Luminary {} +impl ResettablePhasesImpl for PL011Luminary {} |