From: Zhao Liu <zhao1.liu@intel.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-DaudÃ" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org,
Zhao Liu <zhao1.liu@intel.com>
Subject: [PATCH RESEND 2/2] rust/pl011: Avoid bindings::*
Date: Tue, 21 Jan 2025 22:04:57 +0800 [thread overview]
Message-ID: <20250121140457.84631-3-zhao1.liu@intel.com> (raw)
In-Reply-To: <20250121140457.84631-1-zhao1.liu@intel.com>
List all the necessary bindings to better identify gaps in rust/qapi.
And include the bindings wrapped by rust/qapi instead mapping the raw
bindings directly.
Inspired-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
rust/hw/char/pl011/src/device.rs | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs
index c64af2684b7d..c95ab49fd62e 100644
--- a/rust/hw/char/pl011/src/device.rs
+++ b/rust/hw/char/pl011/src/device.rs
@@ -9,12 +9,19 @@
};
use qemu_api::{
- bindings::{self, *},
+ bindings::{
+ error_fatal, hwaddr, memory_region_init_io, qdev_init_clock_in, qdev_new,
+ qdev_prop_set_chr, qemu_chr_fe_ioctl, qemu_chr_fe_set_handlers, qemu_chr_fe_write_all,
+ qemu_irq, sysbus_connect_irq, sysbus_mmio_map, sysbus_realize_and_unref, CharBackend,
+ Chardev, Clock, ClockEvent, MemoryRegion, QEMUChrEvent, CHR_IOCTL_SERIAL_SET_BREAK,
+ },
c_str,
irq::InterruptSource,
prelude::*,
- qdev::DeviceImpl,
+ qdev::{DeviceImpl, DeviceState, Property},
qom::{ClassInitImpl, ObjectImpl, ParentField},
+ sysbus::{SysBusDevice, SysBusDeviceClass},
+ vmstate::VMStateDescription,
};
use crate::{
@@ -493,7 +500,7 @@ pub fn can_receive(&self) -> bool {
}
pub fn event(&mut self, event: QEMUChrEvent) {
- if event == bindings::QEMUChrEvent::CHR_EVENT_BREAK && !self.loopback_enabled() {
+ if event == QEMUChrEvent::CHR_EVENT_BREAK && !self.loopback_enabled() {
self.put_fifo(registers::Data::BREAK.into());
}
}
--
2.34.1
next prev parent reply other threads:[~2025-01-21 13:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 14:04 [PATCH RESEND 0/2] rust/pl011: miscellaneous cleanups Zhao Liu
2025-01-21 14:04 ` [PATCH RESEND 1/2] rust/qdev: Make REALIZE safe Zhao Liu
2025-01-21 14:04 ` Zhao Liu [this message]
2025-01-21 15:58 ` [PATCH RESEND 0/2] rust/pl011: miscellaneous cleanups Paolo Bonzini
2025-01-22 2:30 ` Zhao Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250121140457.84631-3-zhao1.liu@intel.com \
--to=zhao1.liu@intel.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).