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

Modified Files:
        src/sys/arch/powerpc/booke: booke_machdep.c booke_pmap.c
        src/sys/arch/powerpc/include: cpu.h types.h
        src/sys/arch/powerpc/include/booke: pmap.h
Removed Files:
        src/sys/arch/powerpc/include: cpuset.h

Log Message:
kcpuset_t changes for the pmap and removal of __cpuset_t


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/booke/booke_pmap.c
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.1 -r0 src/sys/arch/powerpc/include/cpuset.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/include/booke/pmap.h

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/powerpc/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.17 src/sys/arch/powerpc/booke/booke_machdep.c:1.18
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.17	Mon Oct 29 05:23:44 2012
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Wed Jul 17 23:27:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_machdep.c,v 1.17 2012/10/29 05:23:44 matt Exp $	*/
+/*	$NetBSD: booke_machdep.c,v 1.18 2013/07/17 23:27:02 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.17 2012/10/29 05:23:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.18 2013/07/17 23:27:02 matt Exp $");
 
 #include "opt_modular.h"
 
@@ -54,7 +54,6 @@ __KERNEL_RCSID(0, "$NetBSD: booke_machde
 
 #include <uvm/uvm_extern.h>
 
-#include <powerpc/cpuset.h>
 #include <powerpc/pcb.h>
 #include <powerpc/spr.h>
 #include <powerpc/booke/spr.h>
@@ -222,6 +221,12 @@ booke_cpu_startup(const char *model)
 		ci->ci_idepth = -1;
 		ci->ci_pmap_kern_segtab = curcpu()->ci_pmap_kern_segtab;
 	}
+
+	kcpuset_create(&cpuset_info.cpus_running, true);
+	kcpuset_create(&cpuset_info.cpus_hatched, true);
+	kcpuset_create(&cpuset_info.cpus_paused, true);
+	kcpuset_create(&cpuset_info.cpus_resumed, true);
+	kcpuset_create(&cpuset_info.cpus_halted, true);
 #endif /* MULTIPROCESSOR */
 }
 
@@ -458,18 +463,18 @@ cpu_evcnt_attach(struct cpu_info *ci)
 register_t
 cpu_hatch(void)
 {
-	volatile struct cpuset_info * const csi = &cpuset_info;
+	struct cpuset_info * const csi = &cpuset_info;
 	const size_t id = cpu_number();
 
 	/*
 	 * We've hatched so tell the spinup code.
 	 */
-	CPUSET_ADD(csi->cpus_hatched, id);
+	kcpuset_set(csi->cpus_hatched, id);
 
 	/*
 	 * Loop until running bit for this cpu is set.
 	 */
-	while (!CPUSET_HAS_P(csi->cpus_running, id)) {
+	while (!kcpuset_isset(csi->cpus_running, id)) {
 		continue;
 	}
 
@@ -490,24 +495,27 @@ cpu_boot_secondary_processors(void)
 	volatile struct cpuset_info * const csi = &cpuset_info;
 	CPU_INFO_ITERATOR cii;
 	struct cpu_info *ci;
-	__cpuset_t running = CPUSET_NULLSET;
+	kcpuset_t *running;
+
+	kcpuset_create(&running, true);
 
 	for (CPU_INFO_FOREACH(cii, ci)) {
 		/*
 		 * Skip this CPU if it didn't sucessfully hatch.
 		 */
-		if (! CPUSET_HAS_P(csi->cpus_hatched, cpu_index(ci)))
+		if (!kcpuset_isset(csi->cpus_hatched, cpu_index(ci)))
 			continue;
 
 		KASSERT(!CPU_IS_PRIMARY(ci));
 		KASSERT(ci->ci_data.cpu_idlelwp);
 
-		CPUSET_ADD(running, cpu_index(ci));
+		kcpuset_set(running, cpu_index(ci));
 	}
-	KASSERT(CPUSET_EQUAL_P(csi->cpus_hatched, running));
-	if (!CPUSET_EMPTY_P(running)) {
-		CPUSET_ADDSET(csi->cpus_running, running);
+	KASSERT(kcpuset_match(csi->cpus_hatched, running));
+	if (!kcpuset_iszero(running)) {
+		kcpuset_merge(csi->cpus_running, running);
 	}
+	kcpuset_destroy(running);
 }
 #endif
 

Index: src/sys/arch/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.16 src/sys/arch/powerpc/booke/booke_pmap.c:1.17
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.16	Fri Sep  7 18:05:11 2012
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Wed Jul 17 23:27:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.16 2012/09/07 18:05:11 matt Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.17 2013/07/17 23:27:02 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.16 2012/09/07 18:05:11 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.17 2013/07/17 23:27:02 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/kcore.h>
@@ -52,7 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: booke_pmap.c
  * Initialize the kernel pmap.
  */
 #ifdef MULTIPROCESSOR
-#define	PMAP_SIZE	offsetof(struct pmap, pm_pai[MAXCPUS])
+#define	PMAP_SIZE	offsetof(struct pmap, pm_pai[PMAP_TLB_MAX])
 #else
 #define	PMAP_SIZE	sizeof(struct pmap)
 #endif
@@ -90,7 +90,7 @@ pmap_procwr(struct proc *p, vaddr_t va, 
 }
 
 void
-pmap_md_page_syncicache(struct vm_page *pg, __cpuset_t onproc)
+pmap_md_page_syncicache(struct vm_page *pg, const kcpuset_t *onproc)
 {
 	/*
 	 * If onproc is empty, we could do a
@@ -160,6 +160,10 @@ pmap_bootstrap(vaddr_t startkernel, vadd
 	 */
 	pmap_kernel()->pm_segtab = stp;
 	curcpu()->ci_pmap_kern_segtab = stp;
+#ifdef MULTIPROCESSOR
+	pmap_kernel()->pm_active = kcpuset_running;
+	pmap_kernel()->pm_onproc = kcpuset_running;
+#endif
 
 	KASSERT(endkernel == trunc_page(endkernel));
 

Index: src/sys/arch/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.96 src/sys/arch/powerpc/include/cpu.h:1.97
--- src/sys/arch/powerpc/include/cpu.h:1.96	Thu Apr 25 00:08:48 2013
+++ src/sys/arch/powerpc/include/cpu.h	Wed Jul 17 23:27:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.96 2013/04/25 00:08:48 macallan Exp $	*/
+/*	$NetBSD: cpu.h,v 1.97 2013/07/17 23:27:02 matt Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -175,14 +175,14 @@ struct cpu_hatch_data {
 };
 
 struct cpuset_info {
-	__cpuset_t cpus_running;
-	__cpuset_t cpus_hatched;
-	__cpuset_t cpus_paused;
-	__cpuset_t cpus_resumed;
-	__cpuset_t cpus_halted;
+	kcpuset_t *cpus_running;
+	kcpuset_t *cpus_hatched;
+	kcpuset_t *cpus_paused;
+	kcpuset_t *cpus_resumed;
+	kcpuset_t *cpus_halted;
 };
 
-extern volatile struct cpuset_info cpuset_info;
+extern struct cpuset_info cpuset_info;
 #endif /* MULTIPROCESSOR && !_MODULE */
 
 #if defined(MULTIPROCESSOR) || defined(_MODULE)

Index: src/sys/arch/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.47 src/sys/arch/powerpc/include/types.h:1.48
--- src/sys/arch/powerpc/include/types.h:1.47	Sat May 26 00:31:07 2012
+++ src/sys/arch/powerpc/include/types.h	Wed Jul 17 23:27:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.47 2012/05/26 00:31:07 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.48 2013/07/17 23:27:02 matt Exp $	*/
 
 /*-
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -69,7 +69,6 @@ typedef __uint32_t tlb_asid_t;		/* for b
 #endif
 
 typedef volatile int __cpu_simple_lock_t;
-typedef volatile __uint32_t __cpuset_t;
 
 #define __SIMPLELOCK_LOCKED	1
 #define __SIMPLELOCK_UNLOCKED	0

Index: src/sys/arch/powerpc/include/booke/pmap.h
diff -u src/sys/arch/powerpc/include/booke/pmap.h:1.11 src/sys/arch/powerpc/include/booke/pmap.h:1.12
--- src/sys/arch/powerpc/include/booke/pmap.h:1.11	Tue Oct  2 23:51:39 2012
+++ src/sys/arch/powerpc/include/booke/pmap.h	Wed Jul 17 23:27:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.11 2012/10/02 23:51:39 christos Exp $	*/
+/*	$NetBSD: pmap.h,v 1.12 2013/07/17 23:27:02 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -53,7 +53,6 @@
 #include <uvm/uvm_page.h>
 #ifdef __PMAP_PRIVATE
 #include <powerpc/booke/cpuvar.h>
-#include <powerpc/cpuset.h>
 #endif
 
 #define	PMAP_NEED_PROCWR
@@ -71,6 +70,7 @@
 #define	KERNEL_PID	0
 
 #define	PMAP_TLB_NUM_PIDS		256
+#define	PMAP_TLB_MAX			1
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xfeeddead)
 
 #define	pmap_phys_address(x)		(x)
@@ -96,7 +96,7 @@ vaddr_t	pmap_kvptefill(vaddr_t, vaddr_t,
 #endif
 #endif
 
-void	pmap_md_page_syncicache(struct vm_page *, __cpuset_t);
+void	pmap_md_page_syncicache(struct vm_page *, const kcpuset_t *);
 vaddr_t	pmap_bootstrap(vaddr_t, vaddr_t, phys_ram_seg_t *, size_t);
 bool	pmap_extract(struct pmap *, vaddr_t, paddr_t *);
 

Reply via email to