hw/char/sh_serial: Add device id to trace output
Normally there are at least two sh_serial instances. Add device id to trace messages to make it clear which instance they belong to otherwise its not possible to tell which serial device is accessed. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <cc1f9ff9f4259ae799750e452f8871849c7a104c.1635541329.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
beeb520925
commit
44ae04f032
|
@ -94,9 +94,10 @@ static void sh_serial_write(void *opaque, hwaddr offs,
|
||||||
uint64_t val, unsigned size)
|
uint64_t val, unsigned size)
|
||||||
{
|
{
|
||||||
SHSerialState *s = opaque;
|
SHSerialState *s = opaque;
|
||||||
|
DeviceState *d = DEVICE(s);
|
||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
|
|
||||||
trace_sh_serial_write(size, offs, val);
|
trace_sh_serial_write(d->id, size, offs, val);
|
||||||
switch (offs) {
|
switch (offs) {
|
||||||
case 0x00: /* SMR */
|
case 0x00: /* SMR */
|
||||||
s->smr = val & ((s->feat & SH_SERIAL_FEAT_SCIF) ? 0x7b : 0xff);
|
s->smr = val & ((s->feat & SH_SERIAL_FEAT_SCIF) ? 0x7b : 0xff);
|
||||||
|
@ -212,6 +213,7 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,
|
||||||
unsigned size)
|
unsigned size)
|
||||||
{
|
{
|
||||||
SHSerialState *s = opaque;
|
SHSerialState *s = opaque;
|
||||||
|
DeviceState *d = DEVICE(s);
|
||||||
uint32_t ret = UINT32_MAX;
|
uint32_t ret = UINT32_MAX;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -304,7 +306,7 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
trace_sh_serial_read(size, offs, ret);
|
trace_sh_serial_read(d->id, size, offs, ret);
|
||||||
|
|
||||||
if (ret > UINT16_MAX) {
|
if (ret > UINT16_MAX) {
|
||||||
qemu_log_mask(LOG_GUEST_ERROR,
|
qemu_log_mask(LOG_GUEST_ERROR,
|
||||||
|
|
|
@ -103,5 +103,5 @@ exynos_uart_rx_timeout(uint32_t channel, uint32_t stat, uint32_t intsp) "UART%d:
|
||||||
cadence_uart_baudrate(unsigned baudrate) "baudrate %u"
|
cadence_uart_baudrate(unsigned baudrate) "baudrate %u"
|
||||||
|
|
||||||
# sh_serial.c
|
# sh_serial.c
|
||||||
sh_serial_read(unsigned size, uint64_t offs, uint64_t val) " size %d offs 0x%02" PRIx64 " -> 0x%02" PRIx64
|
sh_serial_read(char *id, unsigned size, uint64_t offs, uint64_t val) " %s size %d offs 0x%02" PRIx64 " -> 0x%02" PRIx64
|
||||||
sh_serial_write(unsigned size, uint64_t offs, uint64_t val) "size %d offs 0x%02" PRIx64 " <- 0x%02" PRIx64
|
sh_serial_write(char *id, unsigned size, uint64_t offs, uint64_t val) "%s size %d offs 0x%02" PRIx64 " <- 0x%02" PRIx64
|
||||||
|
|
Loading…
Reference in New Issue