aboutsummaryrefslogtreecommitdiff
path: root/rust/hw/timer
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2025-09-08 12:49:56 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-09-17 19:00:57 +0200
commit5e588c9d08b0da64fab7f370e65744cb7a4174ef (patch)
treea5b5408764725a1ce8d15b3d3a1b135ee104ec0d /rust/hw/timer
parentee4ffbf239cbd9de8c6b6cc33283b7a64a95a956 (diff)
downloadqemu-5e588c9d08b0da64fab7f370e65744cb7a4174ef.zip
qemu-5e588c9d08b0da64fab7f370e65744cb7a4174ef.tar.gz
qemu-5e588c9d08b0da64fab7f370e65744cb7a4174ef.tar.bz2
rust: split "hwcore" crate
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Link: https://lore.kernel.org/r/20250827104147.717203-16-marcandre.lureau@redhat.com Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/hw/timer')
-rw-r--r--rust/hw/timer/hpet/Cargo.toml1
-rw-r--r--rust/hw/timer/hpet/meson.build1
-rw-r--r--rust/hw/timer/hpet/src/device.rs26
3 files changed, 14 insertions, 14 deletions
diff --git a/rust/hw/timer/hpet/Cargo.toml b/rust/hw/timer/hpet/Cargo.toml
index a95b127..e28d66f 100644
--- a/rust/hw/timer/hpet/Cargo.toml
+++ b/rust/hw/timer/hpet/Cargo.toml
@@ -19,6 +19,7 @@ qom = { path = "../../../qom" }
system = { path = "../../../system" }
qemu_api = { path = "../../../qemu-api" }
qemu_api_macros = { path = "../../../qemu-api-macros" }
+hwcore = { path = "../../../hw/core" }
[lints]
workspace = true
diff --git a/rust/hw/timer/hpet/meson.build b/rust/hw/timer/hpet/meson.build
index c4ffe02..e6f99b6 100644
--- a/rust/hw/timer/hpet/meson.build
+++ b/rust/hw/timer/hpet/meson.build
@@ -12,6 +12,7 @@ _libhpet_rs = static_library(
qemu_api_macros,
qom_rs,
system_rs,
+ hwcore_rs,
],
)
diff --git a/rust/hw/timer/hpet/src/device.rs b/rust/hw/timer/hpet/src/device.rs
index 841c2ba..3031539 100644
--- a/rust/hw/timer/hpet/src/device.rs
+++ b/rust/hw/timer/hpet/src/device.rs
@@ -12,17 +12,15 @@ use std::{
use bql::{BqlCell, BqlRefCell};
use common::{bitops::IntegerExt, uninit_field_mut};
+use hwcore::{
+ bindings::{qdev_prop_bit, qdev_prop_bool, qdev_prop_uint32, qdev_prop_usize},
+ declare_properties, define_property, DeviceImpl, DeviceMethods, DeviceState, InterruptSource,
+ Property, ResetType, ResettablePhasesImpl, SysBusDevice, SysBusDeviceImpl, SysBusDeviceMethods,
+};
use migration::{
self, impl_vmstate_struct, vmstate_fields, vmstate_of, vmstate_subsections, vmstate_validate,
VMStateDescription, VMStateDescriptionBuilder,
};
-use qemu_api::{
- bindings::{qdev_prop_bit, qdev_prop_bool, qdev_prop_uint32, qdev_prop_usize},
- irq::InterruptSource,
- prelude::*,
- qdev::{DeviceImpl, DeviceState, Property, ResetType, ResettablePhasesImpl},
- sysbus::{SysBusDevice, SysBusDeviceImpl},
-};
use qom::{prelude::*, ObjectImpl, ParentField, ParentInit};
use system::{
bindings::{address_space_memory, address_space_stl_le, hwaddr},
@@ -904,9 +902,9 @@ impl ObjectImpl for HPETState {
}
// TODO: Make these properties user-configurable!
-qemu_api::declare_properties! {
+declare_properties! {
HPET_PROPERTIES,
- qemu_api::define_property!(
+ define_property!(
c"timers",
HPETState,
num_timers,
@@ -914,7 +912,7 @@ qemu_api::declare_properties! {
u8,
default = HPET_MIN_TIMERS
),
- qemu_api::define_property!(
+ define_property!(
c"msi",
HPETState,
flags,
@@ -923,7 +921,7 @@ qemu_api::declare_properties! {
bit = HPET_FLAG_MSI_SUPPORT_SHIFT as u8,
default = false,
),
- qemu_api::define_property!(
+ define_property!(
c"hpet-intcap",
HPETState,
int_route_cap,
@@ -931,7 +929,7 @@ qemu_api::declare_properties! {
u32,
default = 0
),
- qemu_api::define_property!(
+ define_property!(
c"hpet-offset-saved",
HPETState,
hpet_offset_saved,
@@ -1004,8 +1002,8 @@ const VMSTATE_HPET: VMStateDescription<HPETState> =
.build();
// SAFETY: HPET_PROPERTIES is a valid Property array constructed with the
-// qemu_api::declare_properties macro.
-unsafe impl qemu_api::qdev::DevicePropertiesImpl for HPETState {
+// hwcore::declare_properties macro.
+unsafe impl hwcore::DevicePropertiesImpl for HPETState {
const PROPERTIES: &'static [Property] = &HPET_PROPERTIES;
}