Module Name: src Committed By: matt Date: Sat Sep 1 00:24:44 UTC 2012
Modified Files: src/sys/kern: kern_cpu.c src/sys/sys: cpu_data.h Log Message: Add a kcpuset_t which just includes ourself. Add a ci_cpuname for convenience To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/kern/kern_cpu.c cvs rdiff -u -r1.34 -r1.35 src/sys/sys/cpu_data.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/kern/kern_cpu.c diff -u src/sys/kern/kern_cpu.c:1.57 src/sys/kern/kern_cpu.c:1.58 --- src/sys/kern/kern_cpu.c:1.57 Wed Aug 29 17:13:21 2012 +++ src/sys/kern/kern_cpu.c Sat Sep 1 00:24:43 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.57 2012/08/29 17:13:21 drochner Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.58 2012/09/01 00:24:43 matt Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.57 2012/08/29 17:13:21 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.58 2012/09/01 00:24:43 matt Exp $"); #include "opt_cpu_ucode.h" #include "opt_compat_netbsd.h" @@ -146,6 +146,12 @@ mi_cpu_attach(struct cpu_info *ci) ci->ci_index = ncpu; kcpuset_set(kcpuset_attached, cpu_index(ci)); + /* + * Create a convenience cpuset of just ourselves. + */ + kcpuset_create(&ci->ci_data.cpu_kcpuset, true); + kcpuset_set(ci->ci_data.cpu_kcpuset, cpu_index(ci)); + CIRCLEQ_INSERT_TAIL(&cpu_queue, ci, ci_data.cpu_qchain); TAILQ_INIT(&ci->ci_data.cpu_ld_locks); __cpu_simple_lock_init(&ci->ci_data.cpu_ld_lock); Index: src/sys/sys/cpu_data.h diff -u src/sys/sys/cpu_data.h:1.34 src/sys/sys/cpu_data.h:1.35 --- src/sys/sys/cpu_data.h:1.34 Sun Jan 29 22:55:40 2012 +++ src/sys/sys/cpu_data.h Sat Sep 1 00:24:44 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_data.h,v 1.34 2012/01/29 22:55:40 rmind Exp $ */ +/* $NetBSD: cpu_data.h,v 1.35 2012/09/01 00:24:44 matt Exp $ */ /*- * Copyright (c) 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -42,6 +42,7 @@ struct lwp; #include <sys/pcu.h> #include <sys/percpu_types.h> #include <sys/queue.h> +#include <sys/kcpuset.h> /* * MI per-cpu data @@ -107,6 +108,7 @@ struct cpu_data { uint64_t cpu_cc_freq; /* cycle counter frequency */ int64_t cpu_cc_skew; /* counter skew vs cpu0 */ char cpu_name[8]; /* eg, "cpu4" */ + kcpuset_t *cpu_kcpuset; /* kcpuset_t of this cpu only */ }; /* compat definitions */ @@ -114,12 +116,14 @@ struct cpu_data { #define ci_index ci_data.cpu_index #define ci_biglock_count ci_data.cpu_biglock_count #define ci_biglock_wanted ci_data.cpu_biglock_wanted +#define ci_cpuname ci_data.cpu_name #define ci_spin_locks ci_data.cpu_spin_locks #define ci_simple_locks ci_data.cpu_simple_locks #define ci_lockstat ci_data.cpu_lockstat #define ci_spin_locks2 ci_data.cpu_spin_locks2 #define ci_lkdebug_recurse ci_data.cpu_lkdebug_recurse #define ci_pcu_curlwp ci_data.cpu_pcu_curlwp +#define ci_kcpuset ci_data.cpu_kcpuset #define ci_package_id ci_data.cpu_package_id #define ci_core_id ci_data.cpu_core_id