summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-08-09 05:53:12 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-08-09 05:53:12 +0000
commit8cf4d8a30e39504811d870b9f299723b11160df1 (patch)
treec7baf8e918fe439c8ba00d7bec5f52e7d6d59379 /sys/arch
parent7c88a893af6f66fd4a908d753c3497ba21edbfb1 (diff)
Fix format strings to make the kernel build on arm64 again after the
recent kprintf changes in clang. ok deraadt@ kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm64/arm64/cpu.c9
-rw-r--r--sys/arch/arm64/arm64/pmap.c26
-rw-r--r--sys/arch/arm64/arm64/trap.c6
-rw-r--r--sys/arch/arm64/dev/agintc.c4
4 files changed, 23 insertions, 22 deletions
diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c
index 2079734e9e8..20fea0d14bc 100644
--- a/sys/arch/arm64/arm64/cpu.c
+++ b/sys/arch/arm64/arm64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.5 2017/05/06 11:27:34 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.6 2017/08/09 05:53:11 jsg Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@@ -124,12 +124,13 @@ cpu_identify(struct cpu_info *ci)
}
if (impl_name && part_name) {
- printf(" %s %s r%dp%d", impl_name, part_name, CPU_VAR(midr),
+ printf(" %s %s r%llup%llu", impl_name, part_name, CPU_VAR(midr),
CPU_REV(midr));
if (CPU_IS_PRIMARY(ci))
- snprintf(cpu_model, sizeof(cpu_model), "%s %s r%dp%d",
- impl_name, part_name, CPU_VAR(midr), CPU_REV(midr));
+ snprintf(cpu_model, sizeof(cpu_model),
+ "%s %s r%llup%llu", impl_name, part_name,
+ CPU_VAR(midr), CPU_REV(midr));
} else {
printf(" Unknown, MIDR 0x%llx", midr);
diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c
index e19594d487f..ed16adf2f9d 100644
--- a/sys/arch/arm64/arm64/pmap.c
+++ b/sys/arch/arm64/arm64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.36 2017/05/21 19:14:36 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.37 2017/08/09 05:53:11 jsg Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
*
@@ -1063,9 +1063,9 @@ pmap_bootstrap(long kvo, paddr_t lpt1, long kernelstart, long kernelend,
* bootstrap vm table, which we may need to preserve until
* later.
*/
- printf("removing %llx-%llx\n", ram_start, kernelstart+kvo);
+ printf("removing %lx-%lx\n", ram_start, kernelstart+kvo);
pmap_remove_avail(ram_start, kernelstart+kvo);
- printf("removing %llx-%llx\n", kernelstart+kvo, kernelend+kvo);
+ printf("removing %lx-%lx\n", kernelstart+kvo, kernelend+kvo);
pmap_remove_avail(kernelstart+kvo, kernelend+kvo);
/*
@@ -1452,8 +1452,8 @@ pmap_pte_insert(struct pte_desc *pted)
uint64_t *pl3;
if (pmap_vp_lookup(pm, pted->pted_va, &pl3) == NULL) {
- panic("pmap_pte_insert: have a pted, but missing a vp"
- " for %x va pmap %x", __func__, pted->pted_va, pm);
+ panic("%s: have a pted, but missing a vp"
+ " for %lx va pmap %p", __func__, pted->pted_va, pm);
}
pmap_pte_update(pted, pl3);
@@ -1515,17 +1515,17 @@ pmap_pte_remove(struct pte_desc *pted, int remove_pted)
else
vp1 = pm->pm_vp.l1;
if (vp1->vp[VP_IDX1(pted->pted_va)] == NULL) {
- panic("have a pted, but missing the l2 for %x va pmap %x",
+ panic("have a pted, but missing the l2 for %lx va pmap %p",
pted->pted_va, pm);
}
vp2 = vp1->vp[VP_IDX1(pted->pted_va)];
if (vp2 == NULL) {
- panic("have a pted, but missing the l2 for %x va pmap %x",
+ panic("have a pted, but missing the l2 for %lx va pmap %p",
pted->pted_va, pm);
}
vp3 = vp2->vp[VP_IDX2(pted->pted_va)];
if (vp3 == NULL) {
- panic("have a pted, but missing the l2 for %x va pmap %x",
+ panic("have a pted, but missing the l2 for %lx va pmap %p",
pted->pted_va, pm);
}
vp3->l3[VP_IDX3(pted->pted_va)] = 0;
@@ -1907,7 +1907,7 @@ pmap_steal_avail(size_t size, int align, void **kva)
}
}
}
- panic ("unable to allocate region with size %x align %x",
+ panic ("unable to allocate region with size %lx align %x",
size, align);
}
@@ -1987,7 +1987,7 @@ pmap_show_mapping(uint64_t va)
pm = curproc->p_vmspace->vm_map.pmap;
if (pm->have_4_level_pt) {
- printf(" vp0 = %llx off %x\n", pm->pm_vp.l0, VP_IDX0(va)*8);
+ printf(" vp0 = %p off %x\n", pm->pm_vp.l0, VP_IDX0(va)*8);
vp1 = pm->pm_vp.l0->vp[VP_IDX0(va)];
if (vp1 == NULL)
return;
@@ -1998,16 +1998,16 @@ pmap_show_mapping(uint64_t va)
__asm volatile ("mrs %x0, ttbr0_el1" : "=r"(ttbr0));
__asm volatile ("mrs %x0, tcr_el1" : "=r"(tcr));
printf(" ttbr0 %llx %llx tcr %llx\n", ttbr0, pm->pm_pt0pa, tcr);
- printf(" vp1 = %llx\n", vp1);
+ printf(" vp1 = %p\n", vp1);
vp2 = vp1->vp[VP_IDX1(va)];
- printf(" vp2 = %llx lp2 = %llx idx1 off %x\n",
+ printf(" vp2 = %p lp2 = %llx idx1 off %x\n",
vp2, vp1->l1[VP_IDX1(va)], VP_IDX1(va)*8);
if (vp2 == NULL)
return;
vp3 = vp2->vp[VP_IDX2(va)];
- printf(" vp3 = %llx lp3 = %llx idx2 off %x\n",
+ printf(" vp3 = %p lp3 = %llx idx2 off %x\n",
vp3, vp2->l2[VP_IDX2(va)], VP_IDX2(va)*8);
if (vp3 == NULL)
return;
diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c
index df83fbc4010..d45c3873f62 100644
--- a/sys/arch/arm64/arm64/trap.c
+++ b/sys/arch/arm64/arm64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.8 2017/07/20 19:57:35 kettenis Exp $ */
+/* $OpenBSD: trap.c,v 1.9 2017/08/09 05:53:11 jsg Exp $ */
/*-
* Copyright (c) 2014 Andrew Turner
* All rights reserved.
@@ -271,7 +271,7 @@ do_el1h_sync(struct trapframe *frame)
db_trapper(frame->tf_elr, 0/*XXX*/, frame, exception);
}
#endif
- panic("Unknown kernel exception %x esr_el1 %lx lr %lxpc %lx\n",
+ panic("Unknown kernel exception %x esr_el1 %llx lr %lxpc %lx\n",
exception,
esr, frame->tf_lr, frame->tf_elr);
}
@@ -318,7 +318,7 @@ do_el0_sync(struct trapframe *frame)
// USERLAND MUST NOT PANIC MACHINE
{
// only here to debug !?!?
- printf("exception %x esr_el1 %lx\n", exception, esr);
+ printf("exception %x esr_el1 %llx\n", exception, esr);
dumpregs(frame);
}
sigexit(p, SIGILL);
diff --git a/sys/arch/arm64/dev/agintc.c b/sys/arch/arm64/dev/agintc.c
index ab133236d96..ef581bb783f 100644
--- a/sys/arch/arm64/dev/agintc.c
+++ b/sys/arch/arm64/dev/agintc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agintc.c,v 1.4 2017/04/30 21:52:40 kettenis Exp $ */
+/* $OpenBSD: agintc.c,v 1.5 2017/08/09 05:53:11 jsg Exp $ */
/*
* Copyright (c) 2007, 2009, 2011, 2017 Dale Rahn <drahn@dalerahn.com>
*
@@ -367,7 +367,7 @@ agintc_cpuinit(void)
printf("cpu mpidr not found mpidr %llx affinity %08x\n",
mpidr, affinity);
for (i = 0; i < sc->sc_num_redist; i++)
- printf("rdist%d: %08x\n", i, sc->sc_affinity[i]);
+ printf("rdist%d: %016llx\n", i, sc->sc_affinity[i]);
panic("failed to indentify cpunumber %d \n", ci->ci_cpuid);
}