hw/char/parallel: Convert from pdebug() macro to trace events

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2018-06-21 14:12:50 -03:00 committed by Stefan Hajnoczi
parent 0060918661
commit cb2d721cb3
2 changed files with 17 additions and 3 deletions

View File

@ -30,6 +30,7 @@
#include "hw/isa/isa.h" #include "hw/isa/isa.h"
#include "hw/char/parallel.h" #include "hw/char/parallel.h"
#include "sysemu/sysemu.h" #include "sysemu/sysemu.h"
#include "trace.h"
//#define DEBUG_PARALLEL //#define DEBUG_PARALLEL
@ -110,9 +111,8 @@ parallel_ioport_write_sw(void *opaque, uint32_t addr, uint32_t val)
{ {
ParallelState *s = opaque; ParallelState *s = opaque;
pdebug("write addr=0x%02x val=0x%02x\n", addr, val);
addr &= 7; addr &= 7;
trace_parallel_ioport_write("SW", addr, val);
switch(addr) { switch(addr) {
case PARA_REG_DATA: case PARA_REG_DATA:
s->dataw = val; s->dataw = val;
@ -157,6 +157,7 @@ static void parallel_ioport_write_hw(void *opaque, uint32_t addr, uint32_t val)
s->last_read_offset = ~0U; s->last_read_offset = ~0U;
addr &= 7; addr &= 7;
trace_parallel_ioport_write("HW", addr, val);
switch(addr) { switch(addr) {
case PARA_REG_DATA: case PARA_REG_DATA:
if (s->dataw == val) if (s->dataw == val)
@ -230,6 +231,8 @@ parallel_ioport_eppdata_write_hw2(void *opaque, uint32_t addr, uint32_t val)
struct ParallelIOArg ioarg = { struct ParallelIOArg ioarg = {
.buffer = &eppdata, .count = sizeof(eppdata) .buffer = &eppdata, .count = sizeof(eppdata)
}; };
trace_parallel_ioport_write("EPP", addr, val);
if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) != PARA_CTR_INIT) { if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) != PARA_CTR_INIT) {
/* Controls not correct for EPP data cycle, so do nothing */ /* Controls not correct for EPP data cycle, so do nothing */
pdebug("we%04x s\n", val); pdebug("we%04x s\n", val);
@ -253,6 +256,8 @@ parallel_ioport_eppdata_write_hw4(void *opaque, uint32_t addr, uint32_t val)
struct ParallelIOArg ioarg = { struct ParallelIOArg ioarg = {
.buffer = &eppdata, .count = sizeof(eppdata) .buffer = &eppdata, .count = sizeof(eppdata)
}; };
trace_parallel_ioport_write("EPP", addr, val);
if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) != PARA_CTR_INIT) { if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) != PARA_CTR_INIT) {
/* Controls not correct for EPP data cycle, so do nothing */ /* Controls not correct for EPP data cycle, so do nothing */
pdebug("we%08x s\n", val); pdebug("we%08x s\n", val);
@ -299,7 +304,7 @@ static uint32_t parallel_ioport_read_sw(void *opaque, uint32_t addr)
ret = s->control; ret = s->control;
break; break;
} }
pdebug("read addr=0x%02x val=0x%02x\n", addr, ret); trace_parallel_ioport_read("SW", addr, ret);
return ret; return ret;
} }
@ -371,6 +376,7 @@ static uint32_t parallel_ioport_read_hw(void *opaque, uint32_t addr)
} }
break; break;
} }
trace_parallel_ioport_read("HW", addr, ret);
s->last_read_offset = addr; s->last_read_offset = addr;
return ret; return ret;
} }
@ -399,6 +405,7 @@ parallel_ioport_eppdata_read_hw2(void *opaque, uint32_t addr)
} }
else else
pdebug("re%04x\n", ret); pdebug("re%04x\n", ret);
trace_parallel_ioport_read("EPP", addr, ret);
return ret; return ret;
} }
@ -426,11 +433,13 @@ parallel_ioport_eppdata_read_hw4(void *opaque, uint32_t addr)
} }
else else
pdebug("re%08x\n", ret); pdebug("re%08x\n", ret);
trace_parallel_ioport_read("EPP", addr, ret);
return ret; return ret;
} }
static void parallel_ioport_ecp_write(void *opaque, uint32_t addr, uint32_t val) static void parallel_ioport_ecp_write(void *opaque, uint32_t addr, uint32_t val)
{ {
trace_parallel_ioport_write("ECP", addr & 7, val);
pdebug("wecp%d=%02x\n", addr & 7, val); pdebug("wecp%d=%02x\n", addr & 7, val);
} }
@ -438,6 +447,7 @@ static uint32_t parallel_ioport_ecp_read(void *opaque, uint32_t addr)
{ {
uint8_t ret = 0xff; uint8_t ret = 0xff;
trace_parallel_ioport_read("ECP", addr & 7, ret);
pdebug("recp%d:%02x\n", addr & 7, ret); pdebug("recp%d:%02x\n", addr & 7, ret);
return ret; return ret;
} }

View File

@ -1,5 +1,9 @@
# See docs/devel/tracing.txt for syntax documentation. # See docs/devel/tracing.txt for syntax documentation.
# hw/char/parallel.c
parallel_ioport_read(const char *desc, uint16_t addr, uint8_t value) "read [%s] addr 0x%02x val 0x%02x"
parallel_ioport_write(const char *desc, uint16_t addr, uint8_t value) "write [%s] addr 0x%02x val 0x%02x"
# hw/char/serial.c # hw/char/serial.c
serial_ioport_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%02x" serial_ioport_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%02x"
serial_ioport_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0x%02x" serial_ioport_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0x%02x"