From 19c0b0267ea0a98940cdbedb23fb6005b42e672c Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 17 Jul 2013 23:25:25 +0000 Subject: [PATCH] kcpuset_t changes --- sys/arch/evbppc/mpc85xx/machdep.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/arch/evbppc/mpc85xx/machdep.c b/sys/arch/evbppc/mpc85xx/machdep.c index 336500490109..bb8b1a25168d 100644 --- a/sys/arch/evbppc/mpc85xx/machdep.c +++ b/sys/arch/evbppc/mpc85xx/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.29 2012/07/29 21:39:43 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.30 2013/07/17 23:25:25 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -75,7 +75,6 @@ __KERNEL_RCSID(0, "$NetSBD$"); #include #include -#include #include #include #include @@ -807,7 +806,7 @@ e500_cpu_spinup(device_t self, struct cpu_info *ci) struct uboot_spinup_entry * const e = (void *)spinup_table_addr; volatile struct cpu_hatch_data * const h = &cpu_hatch_data; const size_t id = cpu_index(ci); - volatile __cpuset_t * const hatchlings = &cpuset_info.cpus_hatched; + kcpuset_t * const hatchlings = cpuset_info.cpus_hatched; if (h->hatch_sp == 0) { int error = uvm_pglistalloc(PAGE_SIZE, PAGE_SIZE, @@ -839,6 +838,9 @@ e500_cpu_spinup(device_t self, struct cpu_info *ci) h->hatch_running = -1; h->hatch_pir = e[i].entry_pir; h->hatch_hid0 = mfspr(SPR_HID0); + u_int tlbidx; + e500_tlb_lookup_xtlb(0, &tlbidx); + h->hatch_tlbidx = tlbidx; KASSERT(h->hatch_sp != 0); /* * Get new timebase. We don't want to deal with @@ -859,7 +861,6 @@ e500_cpu_spinup(device_t self, struct cpu_info *ci) __asm("sync;isync"); dcache_wbinv((vaddr_t)h, sizeof(*h)); -#if 1 /* * And here we go... */ @@ -872,19 +873,23 @@ e500_cpu_spinup(device_t self, struct cpu_info *ci) for (u_int timo = 0; timo++ < 10000; ) { dcache_inv((vaddr_t)&e[i], sizeof(e[i])); if (e[i].entry_addr_lower == 3) { +#if 0 printf( "%s: cpu%u started in %u spins\n", __func__, cpu_index(ci), timo); +#endif break; } } for (u_int timo = 0; timo++ < 10000; ) { dcache_inv((vaddr_t)h, sizeof(*h)); if (h->hatch_running == 0) { +#if 0 printf( "%s: cpu%u cracked in %u spins: (running=%d)\n", __func__, cpu_index(ci), timo, h->hatch_running); +#endif break; } } @@ -895,7 +900,6 @@ e500_cpu_spinup(device_t self, struct cpu_info *ci) h->hatch_running, e[i].entry_addr_lower); goto out; } -#endif /* * First then we do is to synchronize timebases. @@ -908,6 +912,8 @@ e500_cpu_spinup(device_t self, struct cpu_info *ci) dcache_wbinv((vaddr_t)h, sizeof(*h)); __asm("sync;isync"); __insn_barrier(); + printf("%s: cpu%u set to running\n", + __func__, cpu_index(ci)); for (u_int timo = 10000; timo-- > 0; ) { dcache_inv((vaddr_t)h, sizeof(*h)); @@ -937,7 +943,7 @@ e500_cpu_spinup(device_t self, struct cpu_info *ci) * should be long enough. */ for (u_int timo = 10000; timo-- > 0; ) { - if (CPUSET_HAS_P(*hatchlings, id)) { + if (kcpuset_isset(hatchlings, id)) { aprint_normal_dev(self, "hatch successful (%u spins, " "timebase adjusted by %"PRId64")\n",