diff options
author | Zhao Liu <zhao1.liu@intel.com> | 2025-02-10 11:00:48 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-13 12:51:34 +0100 |
commit | 0534248a6b515cb4dea29a6fd6c256dc77f2a953 (patch) | |
tree | 58220c8a0536afd3d2370da287a9f55356b087c0 /rust/hw/timer/hpet/src/lib.rs | |
parent | eadb83f9a3722045e291b6a73994004007dc4657 (diff) | |
download | qemu-0534248a6b515cb4dea29a6fd6c256dc77f2a953.zip qemu-0534248a6b515cb4dea29a6fd6c256dc77f2a953.tar.gz qemu-0534248a6b515cb4dea29a6fd6c256dc77f2a953.tar.bz2 |
rust/timer/hpet: define hpet_fw_cfg
Define HPETFwEntry structure with the same memory layout as
hpet_fw_entry in C.
Further, define the global hpet_cfg variable in Rust which is the
same as the C version. This hpet_cfg variable in Rust will replace
the C version one and allows both Rust code and C code to access it.
The Rust version of hpet_cfg is self-contained, avoiding unsafe
access to C code.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-8-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/hw/timer/hpet/src/lib.rs')
-rw-r--r-- | rust/hw/timer/hpet/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rust/hw/timer/hpet/src/lib.rs b/rust/hw/timer/hpet/src/lib.rs new file mode 100644 index 0000000..44e9f3f --- /dev/null +++ b/rust/hw/timer/hpet/src/lib.rs @@ -0,0 +1,10 @@ +// Copyright (C) 2024 Intel Corporation. +// Author(s): Zhao Liu <zhai1.liu@intel.com> +// SPDX-License-Identifier: GPL-2.0-or-later + +//! # HPET QEMU Device Model +//! +//! This library implements a device model for the IA-PC HPET (High +//! Precision Event Timers) device in QEMU. + +pub mod fw_cfg; |