提交 c3143ba8 编写于 作者: P Peter Crosthwaite 提交者: Peter Maydell

dma/pl330: printf format type sweep.

Use PRI formats as appropriate rather than raw %x and %d. This fixes
debug printfery on some host platforms. Fix types of debug only
variables as appropriate.
Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Message-id: dbb5f5fd048b2d4a3cb5c6357577d11211a7a585.1393372019.git.peter.crosthwaite@xilinx.com
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 024c6e2e
...@@ -577,7 +577,7 @@ static inline void pl330_queue_remove_tagged(PL330Queue *s, uint8_t tag) ...@@ -577,7 +577,7 @@ static inline void pl330_queue_remove_tagged(PL330Queue *s, uint8_t tag)
static inline void pl330_fault(PL330Chan *ch, uint32_t flags) static inline void pl330_fault(PL330Chan *ch, uint32_t flags)
{ {
DB_PRINT("ch: %p, flags: %x\n", ch, flags); DB_PRINT("ch: %p, flags: %" PRIx32 "\n", ch, flags);
ch->fault_type |= flags; ch->fault_type |= flags;
if (ch->state == pl330_chan_fault) { if (ch->state == pl330_chan_fault) {
return; return;
...@@ -723,7 +723,8 @@ static void pl330_dmald(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) ...@@ -723,7 +723,8 @@ static void pl330_dmald(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len)
ch->stall = pl330_queue_put_insn(&ch->parent->read_queue, ch->src, ch->stall = pl330_queue_put_insn(&ch->parent->read_queue, ch->src,
size, num, inc, 0, ch->tag); size, num, inc, 0, ch->tag);
if (!ch->stall) { if (!ch->stall) {
DB_PRINT("channel:%d address:%08x size:%d num:%d %c\n", DB_PRINT("channel:%" PRId8 " address:%08" PRIx32 " size:%" PRIx32
" num:%" PRId32 " %c\n",
ch->tag, ch->src, size, num, inc ? 'Y' : 'N'); ch->tag, ch->src, size, num, inc ? 'Y' : 'N');
ch->src += inc ? size * num - (ch->src & (size - 1)) : 0; ch->src += inc ? size * num - (ch->src & (size - 1)) : 0;
} }
...@@ -868,7 +869,7 @@ static void pl330_dmasev(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) ...@@ -868,7 +869,7 @@ static void pl330_dmasev(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len)
} }
if (ch->parent->inten & (1 << ev_id)) { if (ch->parent->inten & (1 << ev_id)) {
ch->parent->int_status |= (1 << ev_id); ch->parent->int_status |= (1 << ev_id);
DB_PRINT("event interrupt raised %d\n", ev_id); DB_PRINT("event interrupt raised %" PRId8 "\n", ev_id);
qemu_irq_raise(ch->parent->irq[ev_id]); qemu_irq_raise(ch->parent->irq[ev_id]);
} }
ch->parent->ev_status |= (1 << ev_id); ch->parent->ev_status |= (1 << ev_id);
...@@ -895,7 +896,8 @@ static void pl330_dmast(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) ...@@ -895,7 +896,8 @@ static void pl330_dmast(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len)
ch->stall = pl330_queue_put_insn(&ch->parent->write_queue, ch->dst, ch->stall = pl330_queue_put_insn(&ch->parent->write_queue, ch->dst,
size, num, inc, 0, ch->tag); size, num, inc, 0, ch->tag);
if (!ch->stall) { if (!ch->stall) {
DB_PRINT("channel:%d address:%08x size:%d num:%d %c\n", DB_PRINT("channel:%" PRId8 " address:%08" PRIx32 " size:%" PRIx32
" num:%" PRId32 " %c\n",
ch->tag, ch->dst, size, num, inc ? 'Y' : 'N'); ch->tag, ch->dst, size, num, inc ? 'Y' : 'N');
ch->dst += inc ? size * num - (ch->dst & (size - 1)) : 0; ch->dst += inc ? size * num - (ch->dst & (size - 1)) : 0;
} }
...@@ -1154,7 +1156,7 @@ static int pl330_exec_cycle(PL330Chan *channel) ...@@ -1154,7 +1156,7 @@ static int pl330_exec_cycle(PL330Chan *channel)
dma_memory_read(&address_space_memory, q->addr, buf, len); dma_memory_read(&address_space_memory, q->addr, buf, len);
if (PL330_ERR_DEBUG > 1) { if (PL330_ERR_DEBUG > 1) {
DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", DB_PRINT("PL330 read from memory @%08" PRIx32 " (size = %08x):\n",
q->addr, len); q->addr, len);
qemu_hexdump((char *)buf, stderr, "", len); qemu_hexdump((char *)buf, stderr, "", len);
} }
...@@ -1186,8 +1188,8 @@ static int pl330_exec_cycle(PL330Chan *channel) ...@@ -1186,8 +1188,8 @@ static int pl330_exec_cycle(PL330Chan *channel)
if (fifo_res == PL330_FIFO_OK || q->z) { if (fifo_res == PL330_FIFO_OK || q->z) {
dma_memory_write(&address_space_memory, q->addr, buf, len); dma_memory_write(&address_space_memory, q->addr, buf, len);
if (PL330_ERR_DEBUG > 1) { if (PL330_ERR_DEBUG > 1) {
DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", DB_PRINT("PL330 read from memory @%08" PRIx32
q->addr, len); " (size = %08x):\n", q->addr, len);
qemu_hexdump((char *)buf, stderr, "", len); qemu_hexdump((char *)buf, stderr, "", len);
} }
if (q->inc) { if (q->inc) {
...@@ -1276,7 +1278,7 @@ static void pl330_debug_exec(PL330State *s) ...@@ -1276,7 +1278,7 @@ static void pl330_debug_exec(PL330State *s)
args[2] = (s->dbg[1] >> 8) & 0xff; args[2] = (s->dbg[1] >> 8) & 0xff;
args[3] = (s->dbg[1] >> 16) & 0xff; args[3] = (s->dbg[1] >> 16) & 0xff;
args[4] = (s->dbg[1] >> 24) & 0xff; args[4] = (s->dbg[1] >> 24) & 0xff;
DB_PRINT("chan id: %d\n", chan_id); DB_PRINT("chan id: %" PRIx8 "\n", chan_id);
if (s->dbg[0] & 1) { if (s->dbg[0] & 1) {
ch = &s->chan[chan_id]; ch = &s->chan[chan_id];
} else { } else {
...@@ -1466,8 +1468,8 @@ static inline uint32_t pl330_iomem_read_imp(void *opaque, ...@@ -1466,8 +1468,8 @@ static inline uint32_t pl330_iomem_read_imp(void *opaque,
static uint64_t pl330_iomem_read(void *opaque, hwaddr offset, static uint64_t pl330_iomem_read(void *opaque, hwaddr offset,
unsigned size) unsigned size)
{ {
int ret = pl330_iomem_read_imp(opaque, offset); uint32_t ret = pl330_iomem_read_imp(opaque, offset);
DB_PRINT("addr: %08x data: %08x\n", (unsigned)offset, ret); DB_PRINT("addr: %08" HWADDR_PRIx " data: %08" PRIx32 "\n", offset, ret);
return ret; return ret;
} }
...@@ -1553,7 +1555,7 @@ static void pl330_realize(DeviceState *dev, Error **errp) ...@@ -1553,7 +1555,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
s->cfg[1] |= 5; s->cfg[1] |= 5;
break; break;
default: default:
error_setg(errp, "Bad value for i-cache_len property: %d\n", error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "\n",
s->i_cache_len); s->i_cache_len);
return; return;
} }
...@@ -1588,7 +1590,7 @@ static void pl330_realize(DeviceState *dev, Error **errp) ...@@ -1588,7 +1590,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
s->cfg[CFG_CRD] |= 0x4; s->cfg[CFG_CRD] |= 0x4;
break; break;
default: default:
error_setg(errp, "Bad value for data_width property: %d\n", error_setg(errp, "Bad value for data_width property: %" PRIx8 "\n",
s->data_width); s->data_width);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册