Module Name:    src
Committed By:   matt
Date:           Wed Jul 17 23:25:25 UTC 2013

Modified Files:
        src/sys/arch/evbppc/mpc85xx: machdep.c

Log Message:
kcpuset_t changes


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbppc/mpc85xx/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbppc/mpc85xx/machdep.c
diff -u src/sys/arch/evbppc/mpc85xx/machdep.c:1.29 src/sys/arch/evbppc/mpc85xx/machdep.c:1.30
--- src/sys/arch/evbppc/mpc85xx/machdep.c:1.29	Sun Jul 29 21:39:43 2012
+++ src/sys/arch/evbppc/mpc85xx/machdep.c	Wed Jul 17 23:25:25 2013
@@ -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 <net/if_media.h>
 #include <dev/mii/miivar.h>
 
-#include <powerpc/cpuset.h>
 #include <powerpc/pcb.h>
 #include <powerpc/spr.h>
 #include <powerpc/booke/spr.h>
@@ -807,7 +806,7 @@ e500_cpu_spinup(device_t self, struct cp
 	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 cp
 			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 cp
 			__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 cp
 			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 cp
 				    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 cp
 			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 cp
 			 * 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",

Reply via email to