[SerialICE] New patch to review for serialice: 459e9ef Change IO write logging order

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sun Apr 22 17:47:29 CEST 2012


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/920

-gerrit

commit 459e9ef54e9251d983b324aeec8af3a07fcc2077
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Sun Apr 22 16:33:58 2012 +0300

    Change IO write logging order
    
    Apply the write filter before log, so logged value will match the
    value going to the target.
    
    Follow the style of IO read functions in the implementation.
    
    Change-Id: I3740ff417522eadddf2c058535c4d0b4bf4ae56f
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 qemu-0.15.x/serialice.c |   45 +++++++++++++++++++++++++++------------------
 1 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/qemu-0.15.x/serialice.c b/qemu-0.15.x/serialice.c
index 9963c7d..a91f9c6 100644
--- a/qemu-0.15.x/serialice.c
+++ b/qemu-0.15.x/serialice.c
@@ -776,46 +776,55 @@ uint32_t serialice_inl(uint16_t port)
 void serialice_outb(uint8_t data, uint16_t port)
 {
     uint32_t filtered_data = (uint32_t) data;
+    int filtered;
 
-    serialice_log(LOG_WRITE | LOG_IO, data, port, 1);
+    filtered = serialice_io_write_filter(&filtered_data, port, 1);
 
-    if (serialice_io_write_filter(&filtered_data, port, 1)) {
-        return;
+    if (filtered) {
+        data = (uint8_t) filtered_data;
+    } else {
+        data = (uint8_t) filtered_data;
+        sprintf(s->command, "*wi%04x.b=%02x", port, data);
+        serialice_command(s->command, 0);
     }
 
-    data = (uint8_t) filtered_data;
-    sprintf(s->command, "*wi%04x.b=%02x", port, data);
-    serialice_command(s->command, 0);
+    serialice_log(LOG_WRITE | LOG_IO, data, port, 1);
 }
 
 void serialice_outw(uint16_t data, uint16_t port)
 {
     uint32_t filtered_data = (uint32_t) data;
+    int filtered;
 
-    serialice_log(LOG_WRITE | LOG_IO, data, port, 2);
+    filtered = serialice_io_write_filter(&filtered_data, port, 2);
 
-    if (serialice_io_write_filter(&filtered_data, port, 2)) {
-        return;
+    if (filtered) {
+        data = (uint16_t) filtered_data;
+    } else {
+        data = (uint16_t) filtered_data;
+        sprintf(s->command, "*wi%04x.w=%04x", port, data);
+        serialice_command(s->command, 0);
     }
 
-    data = (uint16_t) filtered_data;
-    sprintf(s->command, "*wi%04x.w=%04x", port, data);
-    serialice_command(s->command, 0);
+    serialice_log(LOG_WRITE | LOG_IO, data, port, 2);
 }
 
 void serialice_outl(uint32_t data, uint16_t port)
 {
     uint32_t filtered_data = data;
+    int filtered;
 
-    serialice_log(LOG_WRITE | LOG_IO, data, port, 4);
+    filtered = serialice_io_write_filter(&filtered_data, port, 4);
 
-    if (serialice_io_write_filter(&filtered_data, port, 4)) {
-        return;
+    if (filtered) {
+        data = filtered_data;
+    } else {
+        data = filtered_data;
+        sprintf(s->command, "*wi%04x.l=%08x", port, data);
+        serialice_command(s->command, 0);
     }
 
-    data = filtered_data;
-    sprintf(s->command, "*wi%04x.l=%08x", port, data);
-    serialice_command(s->command, 0);
+    serialice_log(LOG_WRITE | LOG_IO, data, port, 4);
 }
 
 uint8_t serialice_readb(uint32_t addr)



More information about the SerialICE mailing list