qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] pc: improve onboard I/O port debugging
@ 2010-05-15  9:50 Blue Swirl
  0 siblings, 0 replies; only message in thread
From: Blue Swirl @ 2010-05-15  9:50 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/pc.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index db2b9a2..938b2e0 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -51,6 +51,16 @@
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS

+/* debug board I/O ports */
+//#define DEBUG_IOPORTS
+
+#ifdef DEBUG_IOPORTS
+#define DPRINTF_IO(fmt, ...)                                       \
+    do { printf("IOPORT: " fmt , ## __VA_ARGS__); } while (0)
+#else
+#define DPRINTF_IO(fmt, ...)
+#endif
+
 #define BIOS_FILENAME "bios.bin"

 #define PC_MAX_BIOS_SIZE (4 * 1024 * 1024)
@@ -103,6 +113,7 @@ static void isa_irq_handler(void *opaque, int n, int level)

 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
 {
+    DPRINTF_IO("write addr %x data %x\n", addr, data);
 }

 /* MSDOS compatibility mode FPU exception support */
@@ -384,13 +395,18 @@ int ioport_get_a20(void)

 static void ioport92_write(void *opaque, uint32_t addr, uint32_t val)
 {
+    DPRINTF_IO("write addr %x data %x\n", addr, val);
     ioport_set_a20((val >> 1) & 1);
     /* XXX: bit 0 is fast reset */
 }

 static uint32_t ioport92_read(void *opaque, uint32_t addr)
 {
-    return ioport_get_a20() << 1;
+    uint32_t ret;
+
+    ret = ioport_get_a20() << 1;
+    DPRINTF_IO("read addr %x data %x\n", addr, ret);
+    return ret;
 }

 /***********************************************************/
-- 
1.6.2.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-15  9:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-15  9:50 [Qemu-devel] [PATCH 1/2] pc: improve onboard I/O port debugging Blue Swirl

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).