From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41810 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODE0X-0004WN-LL for qemu-devel@nongnu.org; Sat, 15 May 2010 05:50:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODE0W-00012u-5P for qemu-devel@nongnu.org; Sat, 15 May 2010 05:50:09 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:65138) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODE0V-00012o-Ug for qemu-devel@nongnu.org; Sat, 15 May 2010 05:50:08 -0400 Received: by pvc30 with SMTP id 30so551289pvc.4 for ; Sat, 15 May 2010 02:50:06 -0700 (PDT) MIME-Version: 1.0 Date: Sat, 15 May 2010 12:50:06 +0300 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH 1/2] pc: improve onboard I/O port debugging List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Signed-off-by: Blue Swirl --- 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