Skip to content

Commit

Permalink
rust/pl011: Avoid bindings::*
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
trueptolemy authored and GitHub Actions Bot committed Jan 21, 2025
1 parent 6d263e6 commit ff6dded
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rust/hw/char/pl011/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ use std::{
};

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::{
Expand Down Expand Up @@ -493,7 +500,7 @@ impl PL011State {
}

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());
}
}
Expand Down

0 comments on commit ff6dded

Please sign in to comment.