From d8788e7fd759d16b070fc25d4e88ad93722f5743 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 10 Mar 2008 22:20:14 +0000 Subject: [PATCH] Use cpu index instead of the machine dependend, not very expressive cpuid when naming user-visible kernel entities. --- sys/kern/kern_cctr.c | 8 ++++---- sys/kern/kern_idle.c | 6 +++--- sys/kern/kern_softint.c | 14 +++++++------- sys/kern/sched_m2.c | 10 +++++----- sys/kern/subr_pool.c | 6 +++--- sys/kern/subr_workqueue.c | 6 +++--- sys/kern/subr_xcall.c | 6 +++--- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/sys/kern/kern_cctr.c b/sys/kern/kern_cctr.c index 7707bbe7e1d7..80ac77af1345 100644 --- a/sys/kern/kern_cctr.c +++ b/sys/kern/kern_cctr.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cctr.c,v 1.3 2007/11/08 20:10:26 drochner Exp $ */ +/* $NetBSD: kern_cctr.c,v 1.4 2008/03/10 22:20:14 martin Exp $ */ /*- @@ -83,7 +83,7 @@ #include /* __FBSDID("$FreeBSD: src/sys/i386/i386/tsc.c,v 1.204 2003/10/21 18:28:34 silby Exp $"); */ -__KERNEL_RCSID(0, "$NetBSD: kern_cctr.c,v 1.3 2007/11/08 20:10:26 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cctr.c,v 1.4 2008/03/10 22:20:14 martin Exp $"); #include "opt_multiprocessor.h" @@ -294,9 +294,9 @@ cc_calibrate_cpu(struct cpu_info *ci) factor = -factor; if (factor > old_factor / 10) - printf("cc_calibrate_cpu[%lu]: 10%% exceeded - delta %" + printf("cc_calibrate_cpu[%u]: 10%% exceeded - delta %" PRId64 ", denom %" PRId64 ", factor %" PRId64 - ", old factor %" PRId64"\n", ci->ci_cpuid, + ", old factor %" PRId64"\n", ci->ci_index, delta, denom, (delta * 1000) / denom, old_factor); #endif /* TIMECOUNTER_DEBUG */ } diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index b625d09f3c3a..1157b1bac38c 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_idle.c,v 1.11 2008/02/14 14:26:57 ad Exp $ */ +/* $NetBSD: kern_idle.c,v 1.12 2008/03/10 22:20:14 martin Exp $ */ /*- * Copyright (c)2002, 2006, 2007 YAMAMOTO Takashi, @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.11 2008/02/14 14:26:57 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.12 2008/03/10 22:20:14 martin Exp $"); #include #include @@ -92,7 +92,7 @@ create_idle_lwp(struct cpu_info *ci) KASSERT(ci->ci_data.cpu_idlelwp == NULL); error = kthread_create(PRI_IDLE, KTHREAD_MPSAFE | KTHREAD_IDLE, - ci, idle_loop, NULL, &l, "idle/%d", (int)ci->ci_cpuid); + ci, idle_loop, NULL, &l, "idle/%u", ci->ci_index); if (error != 0) panic("create_idle_lwp: error %d", error); lwp_lock(l); diff --git a/sys/kern/kern_softint.c b/sys/kern/kern_softint.c index 66123b165c49..441475c17bea 100644 --- a/sys/kern/kern_softint.c +++ b/sys/kern/kern_softint.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_softint.c,v 1.11 2008/02/06 15:34:36 yamt Exp $ */ +/* $NetBSD: kern_softint.c,v 1.12 2008/03/10 22:20:14 martin Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -183,7 +183,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.11 2008/02/06 15:34:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.12 2008/03/10 22:20:14 martin Exp $"); #include #include @@ -254,16 +254,16 @@ softint_init_isr(softcpu_t *sc, const char *desc, pri_t pri, u_int level) error = kthread_create(pri, KTHREAD_MPSAFE | KTHREAD_INTR | KTHREAD_IDLE, ci, softint_thread, si, &si->si_lwp, - "soft%s/%d", desc, (int)ci->ci_cpuid); + "soft%s/%u", desc, ci->ci_index); if (error != 0) panic("softint_init_isr: error %d", error); - snprintf(si->si_name, sizeof(si->si_name), "%s/%d", desc, - (int)ci->ci_cpuid); + snprintf(si->si_name, sizeof(si->si_name), "%s/%u", desc, + ci->ci_index); evcnt_attach_dynamic(&si->si_evcnt, EVCNT_TYPE_INTR, NULL, "softint", si->si_name); - snprintf(si->si_name_block, sizeof(si->si_name_block), "%s block/%d", - desc, (int)ci->ci_cpuid); + snprintf(si->si_name_block, sizeof(si->si_name_block), "%s block/%u", + desc, ci->ci_index); evcnt_attach_dynamic(&si->si_evcnt_block, EVCNT_TYPE_INTR, NULL, "softint", si->si_name_block); diff --git a/sys/kern/sched_m2.c b/sys/kern/sched_m2.c index 2f73bfe920d2..88f00534b736 100644 --- a/sys/kern/sched_m2.c +++ b/sys/kern/sched_m2.c @@ -1,4 +1,4 @@ -/* $NetBSD: sched_m2.c,v 1.20 2008/02/14 14:26:57 ad Exp $ */ +/* $NetBSD: sched_m2.c,v 1.21 2008/03/10 22:20:14 martin Exp $ */ /* * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.20 2008/02/14 14:26:57 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.21 2008/03/10 22:20:14 martin Exp $"); #include @@ -1045,7 +1045,7 @@ sched_print_runqueue(void (*pr)(const char *, ...)) for (CPU_INFO_FOREACH(cii, ci)) { ci_rq = ci->ci_schedstate.spc_sched_info; - (*pr)("Run-queue (CPU = %d):\n", ci->ci_cpuid); + (*pr)("Run-queue (CPU = %u):\n", ci->ci_index); (*pr)(" pid.lid = %d.%d, threads count = %u, " "avgcount = %u, highest pri = %d\n", ci->ci_curlwp->l_proc->p_pid, ci->ci_curlwp->l_lid, @@ -1066,12 +1066,12 @@ sched_print_runqueue(void (*pr)(const char *, ...)) LIST_FOREACH(l, &p->p_lwps, l_sibling) { sil = l->l_sched_info; ci = l->l_cpu; - (*pr)(" | %5d %4u %4u 0x%8.8x %3s %4u %11p %3d " + (*pr)(" | %5d %4u %4u 0x%8.8x %3s %4u %11p %3u " "%u ST=%d RT=%d %d\n", (int)l->l_lid, l->l_priority, lwp_eprio(l), l->l_flag, l->l_stat == LSRUN ? "RQ" : (l->l_stat == LSSLEEP ? "SQ" : "-"), - sil->sl_timeslice, l, ci->ci_cpuid, + sil->sl_timeslice, l, ci->ci_index, (u_int)(hardclock_ticks - sil->sl_lrtime), sil->sl_slpsum, sil->sl_rtsum, sil->sl_flags); } diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index f7511137374d..434f9e76e531 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.152 2008/03/02 12:19:58 yamt Exp $ */ +/* $NetBSD: subr_pool.c,v 1.153 2008/03/10 22:20:14 martin Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002, 2007 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.152 2008/03/02 12:19:58 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.153 2008/03/10 22:20:14 martin Exp $"); #include "opt_ddb.h" #include "opt_pool.h" @@ -3062,7 +3062,7 @@ found: snprintf(cpucachestr, sizeof(cpucachestr), "cached by CPU %u", - (u_int)ci->ci_cpuid); + ci->ci_index); goto print; } } diff --git a/sys/kern/subr_workqueue.c b/sys/kern/subr_workqueue.c index 5cdc38090acb..8c5cda97ee96 100644 --- a/sys/kern/subr_workqueue.c +++ b/sys/kern/subr_workqueue.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_workqueue.c,v 1.22 2007/12/05 07:06:54 ad Exp $ */ +/* $NetBSD: subr_workqueue.c,v 1.23 2008/03/10 22:20:14 martin Exp $ */ /*- * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi, @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.22 2007/12/05 07:06:54 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.23 2008/03/10 22:20:14 martin Exp $"); #include #include @@ -168,7 +168,7 @@ workqueue_initqueue(struct workqueue *wq, struct workqueue_queue *q, ktf = ((wq->wq_flags & WQ_MPSAFE) != 0 ? KTHREAD_MPSAFE : 0); if (ci) { error = kthread_create(wq->wq_prio, ktf, ci, workqueue_worker, - wq, &q->q_worker, "%s/%u", wq->wq_name, (u_int)ci->ci_cpuid); + wq, &q->q_worker, "%s/%u", wq->wq_name, ci->ci_index); } else { error = kthread_create(wq->wq_prio, ktf, ci, workqueue_worker, wq, &q->q_worker, "%s", wq->wq_name); diff --git a/sys/kern/subr_xcall.c b/sys/kern/subr_xcall.c index 2a7a2545af7b..33c75851d938 100644 --- a/sys/kern/subr_xcall.c +++ b/sys/kern/subr_xcall.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_xcall.c,v 1.5 2007/11/06 00:42:44 ad Exp $ */ +/* $NetBSD: subr_xcall.c,v 1.6 2008/03/10 22:20:14 martin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.5 2007/11/06 00:42:44 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.6 2008/03/10 22:20:14 martin Exp $"); #include #include @@ -131,7 +131,7 @@ xc_init_cpu(struct cpu_info *ci) cv_init(&ci->ci_data.cpu_xcall, "xcall"); error = kthread_create(PRI_XCALL, KTHREAD_MPSAFE, ci, xc_thread, - NULL, NULL, "xcall/%d", (int)ci->ci_cpuid); + NULL, NULL, "xcall/%u", ci->ci_index); if (error != 0) panic("xc_init_cpu: error %d", error); }