Make the kernel build on arm64 again after the recent kprintf changes
in clang.

Index: arm64/cpu.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/arm64/cpu.c,v
retrieving revision 1.5
diff -u -p -r1.5 cpu.c
--- arm64/cpu.c 6 May 2017 11:27:34 -0000       1.5
+++ arm64/cpu.c 9 Aug 2017 03:44:52 -0000
@@ -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);
 
Index: arm64/pmap.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/arm64/pmap.c,v
retrieving revision 1.36
diff -u -p -r1.36 pmap.c
--- arm64/pmap.c        21 May 2017 19:14:36 -0000      1.36
+++ arm64/pmap.c        9 Aug 2017 03:44:53 -0000
@@ -1063,9 +1063,9 @@ pmap_bootstrap(long kvo, paddr_t lpt1,  
         * 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, i
        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,
                        }
                }
        }
-       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;
Index: arm64/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/arm64/trap.c,v
retrieving revision 1.8
diff -u -p -r1.8 trap.c
--- arm64/trap.c        20 Jul 2017 19:57:35 -0000      1.8
+++ arm64/trap.c        9 Aug 2017 03:44:53 -0000
@@ -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);
Index: dev/agintc.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/dev/agintc.c,v
retrieving revision 1.4
diff -u -p -r1.4 agintc.c
--- dev/agintc.c        30 Apr 2017 21:52:40 -0000      1.4
+++ dev/agintc.c        9 Aug 2017 03:44:54 -0000
@@ -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: %16llx\n", i, sc->sc_affinity[i]);
                panic("failed to indentify cpunumber %d \n", ci->ci_cpuid);
        }
 

Reply via email to