From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KDFEn-0003q9-8N for qemu-devel@nongnu.org; Mon, 30 Jun 2008 04:59:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KDFEm-0003pj-EO for qemu-devel@nongnu.org; Mon, 30 Jun 2008 04:59:52 -0400 Received: from [199.232.76.173] (port=41880 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KDFEm-0003pd-2H for qemu-devel@nongnu.org; Mon, 30 Jun 2008 04:59:52 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53826 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KDFEl-00048Z-KK for qemu-devel@nongnu.org; Mon, 30 Jun 2008 04:59:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KDFEk-0006gp-K8 for qemu-devel@nongnu.org; Mon, 30 Jun 2008 08:59:50 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KDFEk-0006gl-Ae for qemu-devel@nongnu.org; Mon, 30 Jun 2008 08:59:50 +0000 MIME-Version: 1.0 Errors-To: edgar_igl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: "Edgar E. Iglesias" Message-Id: Date: Mon, 30 Jun 2008 08:59:50 +0000 Subject: [Qemu-devel] [4804] Avoid CRIS related warnings by Jan Kiszka. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4804 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4804 Author: edgar_igl Date: 2008-06-30 08:59:49 +0000 (Mon, 30 Jun 2008) Log Message: ----------- Avoid CRIS related warnings by Jan Kiszka. Modified Paths: -------------- trunk/hw/etraxfs_dma.c trunk/hw/etraxfs_eth.c trunk/hw/etraxfs_timer.c trunk/target-cris/mmu.c trunk/target-cris/translate.c Modified: trunk/hw/etraxfs_dma.c =================================================================== --- trunk/hw/etraxfs_dma.c 2008-06-29 15:25:29 UTC (rev 4803) +++ trunk/hw/etraxfs_dma.c 2008-06-30 08:59:49 UTC (rev 4804) @@ -214,6 +214,7 @@ return (addr - base) >> 13; } +#ifdef USE_THIS_DEAD_CODE static void channel_load_g(struct fs_dma_ctrl *ctrl, int c) { target_phys_addr_t addr = channel_reg(ctrl, c, RW_GROUP); @@ -227,23 +228,24 @@ static void dump_c(int ch, struct dma_descr_context *c) { printf("%s ch=%d\n", __func__, ch); - printf("next=%x\n", (uint32_t) c->next); - printf("saved_data=%x\n", (uint32_t) c->saved_data); - printf("saved_data_buf=%x\n", (uint32_t) c->saved_data_buf); + printf("next=%p\n", c->next); + printf("saved_data=%p\n", c->saved_data); + printf("saved_data_buf=%p\n", c->saved_data_buf); printf("eol=%x\n", (uint32_t) c->eol); } static void dump_d(int ch, struct dma_descr_data *d) { printf("%s ch=%d\n", __func__, ch); - printf("next=%x\n", (uint32_t) d->next); - printf("buf=%x\n", (uint32_t) d->buf); - printf("after=%x\n", (uint32_t) d->after); + printf("next=%p\n", d->next); + printf("buf=%p\n", d->buf); + printf("after=%p\n", d->after); printf("intr=%x\n", (uint32_t) d->intr); printf("out_eop=%x\n", (uint32_t) d->out_eop); printf("in_eop=%x\n", (uint32_t) d->in_eop); printf("eol=%x\n", (uint32_t) d->eol); } +#endif static void channel_load_c(struct fs_dma_ctrl *ctrl, int c) { @@ -256,10 +258,10 @@ D(dump_c(c, &ctrl->channels[c].current_c)); /* I guess this should update the current pos. */ - ctrl->channels[c].regs[RW_SAVED_DATA] = - (uint32_t)ctrl->channels[c].current_c.saved_data; + ctrl->channels[c].regs[RW_SAVED_DATA] = + (uint32_t)(unsigned long)ctrl->channels[c].current_c.saved_data; ctrl->channels[c].regs[RW_SAVED_DATA_BUF] = - (uint32_t)ctrl->channels[c].current_c.saved_data_buf; + (uint32_t)(unsigned long)ctrl->channels[c].current_c.saved_data_buf; } static void channel_load_d(struct fs_dma_ctrl *ctrl, int c) @@ -339,12 +341,12 @@ D(printf("continue %d ok %p\n", c, ctrl->channels[c].current_d.next)); ctrl->channels[c].regs[RW_SAVED_DATA] = - (uint32_t) ctrl->channels[c].current_d.next; + (uint32_t)(unsigned long)ctrl->channels[c].current_d.next; channel_load_d(ctrl, c); channel_start(ctrl, c); } ctrl->channels[c].regs[RW_SAVED_DATA_BUF] = - (uint32_t) ctrl->channels[c].current_d.buf; + (uint32_t)(unsigned long)ctrl->channels[c].current_d.buf; } static void channel_stream_cmd(struct fs_dma_ctrl *ctrl, int c, uint32_t v) @@ -402,7 +404,7 @@ (uint32_t)ctrl->channels[c].current_d.after, saved_data_buf)); - len = (uint32_t) ctrl->channels[c].current_d.after; + len = (uint32_t)(unsigned long) ctrl->channels[c].current_d.after; len -= saved_data_buf; if (len > sizeof buf) @@ -420,7 +422,8 @@ saved_data_buf += len; - if (saved_data_buf == (uint32_t)ctrl->channels[c].current_d.after) { + if (saved_data_buf == + (uint32_t)(unsigned long)ctrl->channels[c].current_d.after) { /* Done. Step to next. */ if (ctrl->channels[c].current_d.out_eop) { /* TODO: signal eop to the client. */ @@ -444,10 +447,10 @@ channel_stop(ctrl, c); } else { ctrl->channels[c].regs[RW_SAVED_DATA] = - (uint32_t) ctrl->channels[c].current_d.next; + (uint32_t)(unsigned long) ctrl->channels[c].current_d.next; /* Load new descriptor. */ channel_load_d(ctrl, c); - saved_data_buf = (uint32_t) + saved_data_buf = (uint32_t)(unsigned long) ctrl->channels[c].current_d.buf; } @@ -468,7 +471,7 @@ return 0; saved_data_buf = channel_reg(ctrl, c, RW_SAVED_DATA_BUF); - len = (uint32_t) ctrl->channels[c].current_d.after; + len = (uint32_t)(unsigned long) ctrl->channels[c].current_d.after; len -= saved_data_buf; if (len > buflen) @@ -477,7 +480,8 @@ cpu_physical_memory_write (saved_data_buf, buf, len); saved_data_buf += len; - if (saved_data_buf == (uint32_t)ctrl->channels[c].current_d.after + if (saved_data_buf == + (uint32_t)(unsigned long)ctrl->channels[c].current_d.after || eop) { uint32_t r_intr = ctrl->channels[c].regs[R_INTR]; @@ -485,7 +489,7 @@ ctrl->channels[c].current_d.after - ctrl->channels[c].current_d.buf)); ctrl->channels[c].current_d.after = - (void *) saved_data_buf; + (void *)(unsigned long) saved_data_buf; /* Done. Step to next. */ if (ctrl->channels[c].current_d.intr) { @@ -514,10 +518,10 @@ channel_stop(ctrl, c); } else { ctrl->channels[c].regs[RW_SAVED_DATA] = - (uint32_t) ctrl->channels[c].current_d.next; + (uint32_t)(unsigned long) ctrl->channels[c].current_d.next; /* Load new descriptor. */ channel_load_d(ctrl, c); - saved_data_buf = (uint32_t) + saved_data_buf = (uint32_t)(unsigned long) ctrl->channels[c].current_d.buf; } } @@ -537,8 +541,8 @@ { struct fs_dma_ctrl *ctrl = opaque; CPUState *env = ctrl->env; - cpu_abort(env, "Unsupported short access. reg=%x pc=%x.\n", - addr, env->pc); + cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx + " pc=%x.\n", addr, env->pc); return 0; } @@ -574,8 +578,8 @@ { struct fs_dma_ctrl *ctrl = opaque; CPUState *env = ctrl->env; - cpu_abort(env, "Unsupported short access. reg=%x pc=%x.\n", - addr, env->pc); + cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx + " pc=%x.\n", addr, env->pc); } static void Modified: trunk/hw/etraxfs_eth.c =================================================================== --- trunk/hw/etraxfs_eth.c 2008-06-29 15:25:29 UTC (rev 4803) +++ trunk/hw/etraxfs_eth.c 2008-06-30 08:59:49 UTC (rev 4804) @@ -154,11 +154,13 @@ bus->devs[addr & 0x1f] = phy; } +#ifdef USE_THIS_DEAD_CODE static void mdio_detach(struct qemu_mdio *bus, struct qemu_phy *phy, unsigned int addr) { bus->devs[addr & 0x1f] = NULL; } +#endif static void mdio_read_req(struct qemu_mdio *bus) { @@ -328,8 +330,8 @@ { struct fs_eth *eth = opaque; CPUState *env = eth->env; - cpu_abort(env, "Unsupported short access. reg=%x pc=%x.\n", - addr, env->pc); + cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx + " pc=%x.\n", addr, env->pc); return 0; } @@ -359,8 +361,8 @@ { struct fs_eth *eth = opaque; CPUState *env = eth->env; - cpu_abort(env, "Unsupported short access. reg=%x pc=%x.\n", - addr, env->pc); + cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx + " pc=%x.\n", addr, env->pc); } static void eth_update_ma(struct fs_eth *eth, int ma) Modified: trunk/hw/etraxfs_timer.c =================================================================== --- trunk/hw/etraxfs_timer.c 2008-06-29 15:25:29 UTC (rev 4803) +++ trunk/hw/etraxfs_timer.c 2008-06-30 08:59:49 UTC (rev 4804) @@ -80,8 +80,8 @@ { struct fs_timer_t *t = opaque; CPUState *env = t->env; - cpu_abort(env, "Unsupported short access. reg=%x pc=%x.\n", - addr, env->pc); + cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx + " pc=%x.\n", addr, env->pc); return 0; } @@ -120,8 +120,8 @@ { struct fs_timer_t *t = opaque; CPUState *env = t->env; - cpu_abort(env, "Unsupported short access. reg=%x pc=%x.\n", - addr, env->pc); + cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx + " pc=%x.\n", addr, env->pc); } #define TIMER_SLOWDOWN 1 @@ -309,7 +309,7 @@ t->rw_ack_intr = 0; break; default: - printf ("%s %x %x pc=%x\n", + printf ("%s " TARGET_FMT_plx " %x pc=%x\n", __func__, addr, value, env->pc); break; } Modified: trunk/target-cris/mmu.c =================================================================== --- trunk/target-cris/mmu.c 2008-06-29 15:25:29 UTC (rev 4803) +++ trunk/target-cris/mmu.c 2008-06-30 08:59:49 UTC (rev 4804) @@ -30,7 +30,11 @@ #include "mmu.h" #include "exec-all.h" +#ifdef DEBUG +#define D(x) x +#else #define D(x) +#endif void cris_mmu_init(CPUState *env) { @@ -95,6 +99,7 @@ *dst |= val; } +#ifdef DEBUG static void dump_tlb(CPUState *env, int mmu) { int set; @@ -113,6 +118,7 @@ } } } +#endif /* rw 0 = read, 1 = write, 2 = exec. */ static int cris_mmu_translate_page(struct cris_mmu_result_t *res, Modified: trunk/target-cris/translate.c =================================================================== --- trunk/target-cris/translate.c 2008-06-29 15:25:29 UTC (rev 4803) +++ trunk/target-cris/translate.c 2008-06-30 08:59:49 UTC (rev 4804) @@ -3075,14 +3075,15 @@ if (loglevel & CPU_LOG_TB_IN_ASM) { fprintf(logfile, - "srch=%d pc=%x %x flg=%llx bt=%x ds=%lld ccs=%x\n" + "srch=%d pc=%x %x flg=%llx bt=%x ds=%u ccs=%x\n" "pid=%x usp=%x\n" "%x.%x.%x.%x\n" "%x.%x.%x.%x\n" "%x.%x.%x.%x\n" "%x.%x.%x.%x\n", - search_pc, dc->pc, dc->ppc, tb->flags, - env->btarget, tb->flags & 7, + search_pc, dc->pc, dc->ppc, + (unsigned long long)tb->flags, + env->btarget, (unsigned)tb->flags & 7, env->pregs[PR_CCS], env->pregs[PR_PID], env->pregs[PR_USP], env->regs[0], env->regs[1], env->regs[2], env->regs[3], @@ -3228,7 +3229,7 @@ fprintf(logfile, "--------------\n"); fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start)); target_disas(logfile, pc_start, dc->pc - pc_start, 0); - fprintf(logfile, "\nisize=%d osize=%d\n", + fprintf(logfile, "\nisize=%d osize=%zd\n", dc->pc - pc_start, gen_opc_ptr - gen_opc_buf); } #endif