From: Alex DAMIAN <alexandru.damian@intel.com>
To: kraxel@redhat.com, blauwirbel@gmail.com, pbonzini@redhat.com,
jan.kiszka@siemens.com, qemu-devel@nongnu.org
Cc: Alexandru DAMIAN <alexandru.damian@intel.com>
Subject: [Qemu-devel] [PATCH] vga.c: Debug messages go to stderr
Date: Tue, 2 Apr 2013 13:53:52 +0300 [thread overview]
Message-ID: <1364900032-32400-1-git-send-email-alexandru.damian@intel.com> (raw)
From: Alexandru DAMIAN <alexandru.damian@intel.com>
Move debug messages to stderr since often in vga code debug
stdio is used as serial console.
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
hw/vga.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/hw/vga.c b/hw/vga.c
index 59bfb22..2e337b8 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -391,7 +391,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr)
case VGA_SEQ_D:
val = s->sr[s->sr_index];
#ifdef DEBUG_VGA_REG
- printf("vga: read SR%x = 0x%02x\n", s->sr_index, val);
+ fprintf(stderr, "vga: read SR%x = 0x%02x\n", s->sr_index, val);
#endif
break;
case VGA_PEL_IR:
@@ -419,7 +419,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr)
case VGA_GFX_D:
val = s->gr[s->gr_index];
#ifdef DEBUG_VGA_REG
- printf("vga: read GR%x = 0x%02x\n", s->gr_index, val);
+ fprintf(stderr, "vga: read GR%x = 0x%02x\n", s->gr_index, val);
#endif
break;
case VGA_CRT_IM:
@@ -430,7 +430,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr)
case VGA_CRT_DC:
val = s->cr[s->cr_index];
#ifdef DEBUG_VGA_REG
- printf("vga: read CR%x = 0x%02x\n", s->cr_index, val);
+ fprintf(stderr, "vga: read CR%x = 0x%02x\n", s->cr_index, val);
#endif
break;
case VGA_IS1_RM:
@@ -445,7 +445,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr)
}
}
#if defined(DEBUG_VGA)
- printf("VGA: read addr=0x%04x data=0x%02x\n", addr, val);
+ fprintf(stderr, "VGA: read addr=0x%04x data=0x%02x\n", addr, val);
#endif
return val;
}
@@ -462,7 +462,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
return;
}
#ifdef DEBUG_VGA
- printf("VGA: write addr=0x%04x data=0x%02x\n", addr, val);
+ fprintf(stderr, "VGA: write addr=0x%04x data=0x%02x\n", addr, val);
#endif
switch(addr) {
@@ -506,7 +506,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
break;
case VGA_SEQ_D:
#ifdef DEBUG_VGA_REG
- printf("vga: write SR%x = 0x%02x\n", s->sr_index, val);
+ fprintf(stderr, "vga: write SR%x = 0x%02x\n", s->sr_index, val);
#endif
s->sr[s->sr_index] = val & sr_mask[s->sr_index];
if (s->sr_index == VGA_SEQ_CLOCK_MODE) {
@@ -537,7 +537,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
break;
case VGA_GFX_D:
#ifdef DEBUG_VGA_REG
- printf("vga: write GR%x = 0x%02x\n", s->gr_index, val);
+ fprintf(stderr, "vga: write GR%x = 0x%02x\n", s->gr_index, val);
#endif
s->gr[s->gr_index] = val & gr_mask[s->gr_index];
vga_update_memory_access(s);
@@ -549,7 +549,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
case VGA_CRT_DM:
case VGA_CRT_DC:
#ifdef DEBUG_VGA_REG
- printf("vga: write CR%x = 0x%02x\n", s->cr_index, val);
+ fprintf(stderr, "vga: write CR%x = 0x%02x\n", s->cr_index, val);
#endif
/* handle CR0-7 protection */
if ((s->cr[VGA_CRTC_V_SYNC_END] & VGA_CR11_LOCK_CR0_CR7) &&
@@ -848,7 +848,7 @@ void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val)
uint32_t write_mask, bit_mask, set_mask;
#ifdef DEBUG_VGA_MEM
- printf("vga: [0x" TARGET_FMT_plx "] = 0x%02x\n", addr, val);
+ fprintf(stderr, "vga: [0x" TARGET_FMT_plx "] = 0x%02x\n", addr, val);
#endif
/* convert to VGA memory offset */
memory_map_mode = (s->gr[VGA_GFX_MISC] >> 2) & 3;
@@ -881,7 +881,7 @@ void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val)
if (s->sr[VGA_SEQ_PLANE_WRITE] & mask) {
s->vram_ptr[addr] = val;
#ifdef DEBUG_VGA_MEM
- printf("vga: chain4: [0x" TARGET_FMT_plx "]\n", addr);
+ fprintf(stderr, "vga: chain4: [0x" TARGET_FMT_plx "]\n", addr);
#endif
s->plane_updated |= mask; /* only used to detect font change */
memory_region_set_dirty(&s->vram, addr, 1);
@@ -894,7 +894,7 @@ void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val)
addr = ((addr & ~1) << 1) | plane;
s->vram_ptr[addr] = val;
#ifdef DEBUG_VGA_MEM
- printf("vga: odd/even: [0x" TARGET_FMT_plx "]\n", addr);
+ fprintf(stderr, "vga: odd/even: [0x" TARGET_FMT_plx "]\n", addr);
#endif
s->plane_updated |= mask; /* only used to detect font change */
memory_region_set_dirty(&s->vram, addr, 1);
@@ -969,7 +969,7 @@ void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val)
(((uint32_t *)s->vram_ptr)[addr] & ~write_mask) |
(val & write_mask);
#ifdef DEBUG_VGA_MEM
- printf("vga: latch: [0x" TARGET_FMT_plx "] mask=0x%08x val=0x%08x\n",
+ fprintf(stderr, "vga: latch: [0x" TARGET_FMT_plx "] mask=0x%08x val=0x%08x\n",
addr * 4, write_mask, val);
#endif
memory_region_set_dirty(&s->vram, addr << 2, sizeof(uint32_t));
--
1.7.10.4
next reply other threads:[~2013-04-02 10:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-02 10:53 Alex DAMIAN [this message]
2013-04-02 11:58 ` [Qemu-devel] [PATCH] vga.c: Debug messages go to stderr Gerd Hoffmann
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=1364900032-32400-1-git-send-email-alexandru.damian@intel.com \
--to=alexandru.damian@intel.com \
--cc=blauwirbel@gmail.com \
--cc=jan.kiszka@siemens.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.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).