mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
rust: pl011: Rename RX FIFO methods
In preparation of having a TX FIFO, rename the RX FIFO methods.
This is the Rust version of commit 40871ca758
("hw/char/pl011:
Rename RX FIFO methods").
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
95d313127d
commit
cc1f4b34d0
1 changed files with 4 additions and 4 deletions
|
@ -329,7 +329,7 @@ impl PL011Registers {
|
||||||
// hardware flow-control is enabled.
|
// hardware flow-control is enabled.
|
||||||
//
|
//
|
||||||
// For simplicity, the above described is not emulated.
|
// For simplicity, the above described is not emulated.
|
||||||
self.loopback_enabled() && self.put_fifo(value)
|
self.loopback_enabled() && self.fifo_rx_put(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
@ -439,7 +439,7 @@ impl PL011Registers {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn put_fifo(&mut self, value: registers::Data) -> bool {
|
pub fn fifo_rx_put(&mut self, value: registers::Data) -> bool {
|
||||||
let depth = self.fifo_depth();
|
let depth = self.fifo_depth();
|
||||||
assert!(depth > 0);
|
assert!(depth > 0);
|
||||||
let slot = (self.read_pos + self.read_count) & (depth - 1);
|
let slot = (self.read_pos + self.read_count) & (depth - 1);
|
||||||
|
@ -589,7 +589,7 @@ impl PL011State {
|
||||||
}
|
}
|
||||||
let mut regs = self.regs.borrow_mut();
|
let mut regs = self.regs.borrow_mut();
|
||||||
let c: u32 = buf[0].into();
|
let c: u32 = buf[0].into();
|
||||||
let update_irq = !regs.loopback_enabled() && regs.put_fifo(c.into());
|
let update_irq = !regs.loopback_enabled() && regs.fifo_rx_put(c.into());
|
||||||
// Release the BqlRefCell before calling self.update()
|
// Release the BqlRefCell before calling self.update()
|
||||||
drop(regs);
|
drop(regs);
|
||||||
|
|
||||||
|
@ -602,7 +602,7 @@ impl PL011State {
|
||||||
let mut update_irq = false;
|
let mut update_irq = false;
|
||||||
let mut regs = self.regs.borrow_mut();
|
let mut regs = self.regs.borrow_mut();
|
||||||
if event == Event::CHR_EVENT_BREAK && !regs.loopback_enabled() {
|
if event == Event::CHR_EVENT_BREAK && !regs.loopback_enabled() {
|
||||||
update_irq = regs.put_fifo(registers::Data::BREAK);
|
update_irq = regs.fifo_rx_put(registers::Data::BREAK);
|
||||||
}
|
}
|
||||||
// Release the BqlRefCell before calling self.update()
|
// Release the BqlRefCell before calling self.update()
|
||||||
drop(regs);
|
drop(regs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue