qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] rust/hw/char/pl011/src/device: Implement logging


From: Paolo Bonzini
Subject: Re: [PATCH v2 2/2] rust/hw/char/pl011/src/device: Implement logging
Date: Wed, 11 Jun 2025 09:55:20 +0200
User-agent: Mozilla Thunderbird

On 6/10/25 22:21, Bernhard Beschow wrote:
Now that there is logging support in Rust for QEMU, use it in the pl011
device.
Adding also this to match the C code:

diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs
index 42dfa9509dc..e505abfae86 100644
--- a/rust/hw/char/pl011/src/device.rs
+++ b/rust/hw/char/pl011/src/device.rs
@@ -305,6 +305,12 @@ fn read_data_register(&mut self, update: &mut bool) -> u32 
{
     }
fn write_data_register(&mut self, value: u32) -> bool {
+        if !self.control.enable_uart() {
+            log_mask!(Log::GuestError, "PL011 data written to disabled 
UART\n");
+        }
+        if !self.control.enable_transmit() {
+            log_mask!(Log::GuestError, "PL011 data written to disabled TX 
UART\n");
+        }
         // interrupts always checked
         let _ = self.loopback_tx(value.into());
         self.int_level |= Interrupt::TX;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]