From owner-svn-src-head@freebsd.org Tue Sep 8 13:21:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C76C3C8F03; Tue, 8 Sep 2020 13:21:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm5Q31LcKz3Vnp; Tue, 8 Sep 2020 13:21:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12D4711051; Tue, 8 Sep 2020 13:21:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088DLEA2084596; Tue, 8 Sep 2020 13:21:14 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088DLDm9084590; Tue, 8 Sep 2020 13:21:13 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009081321.088DLDm9084590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 8 Sep 2020 13:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365455 - in head/sys: dev/xilinx riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: dev/xilinx riscv/riscv X-SVN-Commit-Revision: 365455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 13:21:15 -0000 Author: mhorne Date: Tue Sep 8 13:21:13 2020 New Revision: 365455 URL: https://svnweb.freebsd.org/changeset/base/365455 Log: RISC-V: fix some mismatched format specifiers RISC-V is currently built with -Wno-format, which is how these went undetected. Address them now before re-enabling those warnings. Differential Revision: https://reviews.freebsd.org/D26319 Modified: head/sys/dev/xilinx/axidma.c head/sys/riscv/riscv/db_disasm.c head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/sbi.c head/sys/riscv/riscv/trap.c Modified: head/sys/dev/xilinx/axidma.c ============================================================================== --- head/sys/dev/xilinx/axidma.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/dev/xilinx/axidma.c Tue Sep 8 13:21:13 2020 (r365455) @@ -363,7 +363,7 @@ axidma_desc_alloc(struct axidma_softc *sc, struct xdma chan->mem_vaddr = kva_alloc(chan->mem_size); pmap_kenter_device(chan->mem_vaddr, chan->mem_size, chan->mem_paddr); - device_printf(sc->dev, "Allocated chunk %lx %d\n", + device_printf(sc->dev, "Allocated chunk %lx %lu\n", chan->mem_paddr, chan->mem_size); for (i = 0; i < nsegments; i++) { Modified: head/sys/riscv/riscv/db_disasm.c ============================================================================== --- head/sys/riscv/riscv/db_disasm.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/db_disasm.c Tue Sep 8 13:21:13 2020 (r365455) @@ -416,7 +416,7 @@ oprint(struct riscv_op *op, vm_offset_t loc, int insn) imm |= ((insn >> 12) & 0x1) << 5; if (imm & (1 << 5)) imm |= (0x7ffffff << 5); /* sign ext */ - db_printf("0x%lx", imm); + db_printf("0x%x", imm); break; case 'o': imm = ((insn >> 2) & 0x1f) << 0; @@ -524,7 +524,7 @@ oprint(struct riscv_op *op, vm_offset_t loc, int insn) imm = (insn >> 12) & 0xfffff; if (imm & (1 << 20)) imm |= (0xfff << 20); /* sign extend */ - db_printf("0x%lx", imm); + db_printf("0x%x", imm); break; case 'j': /* imm[11:0] << 20 */ Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/intr_machdep.c Tue Sep 8 13:21:13 2020 (r365455) @@ -73,9 +73,9 @@ struct intc_irqsrc isrcs[INTC_NIRQS]; static void riscv_mask_irq(void *source) { - uintptr_t irq; + int irq; - irq = (uintptr_t)source; + irq = (int)(uintptr_t)source; switch (irq) { case IRQ_TIMER_SUPERVISOR: @@ -95,9 +95,9 @@ riscv_mask_irq(void *source) static void riscv_unmask_irq(void *source) { - uintptr_t irq; + int irq; - irq = (uintptr_t)source; + irq = (int)(uintptr_t)source; switch (irq) { case IRQ_TIMER_SUPERVISOR: Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/pmap.c Tue Sep 8 13:21:13 2020 (r365455) @@ -590,7 +590,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, if (physmap[i + 1] > max_pa) max_pa = physmap[i + 1]; } - printf("physmap_idx %lx\n", physmap_idx); + printf("physmap_idx %u\n", physmap_idx); printf("min_pa %lx\n", min_pa); printf("max_pa %lx\n", max_pa); Modified: head/sys/riscv/riscv/sbi.c ============================================================================== --- head/sys/riscv/riscv/sbi.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/sbi.c Tue Sep 8 13:21:13 2020 (r365455) @@ -104,7 +104,7 @@ sbi_print_version(void) switch (sbi_impl_id) { case (SBI_IMPL_ID_BBL): - printf("SBI: Berkely Boot Loader %u\n", sbi_impl_version); + printf("SBI: Berkely Boot Loader %lu\n", sbi_impl_version); break; case (SBI_IMPL_ID_OPENSBI): major = sbi_impl_version >> OPENSBI_VERSION_MAJOR_OFFSET; @@ -112,7 +112,7 @@ sbi_print_version(void) printf("SBI: OpenSBI v%u.%u\n", major, minor); break; default: - printf("SBI: Unrecognized Implementation: %u\n", sbi_impl_id); + printf("SBI: Unrecognized Implementation: %lu\n", sbi_impl_id); break; } Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/trap.c Tue Sep 8 13:21:13 2020 (r365455) @@ -306,7 +306,7 @@ do_trap_supervisor(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown kernel exception %x trap value %lx\n", + panic("Unknown kernel exception %lx trap value %lx\n", exception, frame->tf_stval); } } @@ -375,7 +375,7 @@ do_trap_user(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown userland exception %x, trap value %lx\n", + panic("Unknown userland exception %lx, trap value %lx\n", exception, frame->tf_stval); } }