From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 1/2] pc: improve onboard I/O port debugging
Date: Sat, 15 May 2010 12:50:06 +0300 [thread overview]
Message-ID: <AANLkTimUpFhHAWmEYU75sGWfldzFptqNbUshgr7MuD6K@mail.gmail.com> (raw)
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
reply other threads:[~2010-05-15 9:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimUpFhHAWmEYU75sGWfldzFptqNbUshgr7MuD6K@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).