Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add a cs_hwid field to cpustate and use this to store the ci...
details: https://anonhg.NetBSD.org/src/rev/8dd4dddf05e8
branches: trunk
changeset: 769477:8dd4dddf05e8
user: jdc <jdc%NetBSD.org@localhost>
date: Sun Sep 11 14:54:49 2011 +0000
description:
Add a cs_hwid field to cpustate and use this to store the ci_cpuid (hardware
ID). Report this as the HwID in cpuctl.
OK jruoho@.
diffstat:
sys/kern/kern_cpu.c | 5 +++--
sys/sys/cpuio.h | 5 +++--
usr.sbin/cpuctl/cpuctl.c | 6 +++---
3 files changed, 9 insertions(+), 7 deletions(-)
diffs (72 lines):
diff -r 86d03679d291 -r 8dd4dddf05e8 sys/kern/kern_cpu.c
--- a/sys/kern/kern_cpu.c Sun Sep 11 10:32:23 2011 +0000
+++ b/sys/kern/kern_cpu.c Sun Sep 11 14:54:49 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_cpu.c,v 1.50 2011/08/07 21:38:32 rmind Exp $ */
+/* $NetBSD: kern_cpu.c,v 1.51 2011/09/11 14:54:49 jdc Exp $ */
/*-
* Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.50 2011/08/07 21:38:32 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.51 2011/09/11 14:54:49 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -226,6 +226,7 @@
cs->cs_lastmodhi = (int32_t)
(ci->ci_schedstate.spc_lastmod >> 32);
cs->cs_intrcnt = cpu_intr_count(ci) + 1;
+ cs->cs_hwid = ci->ci_cpuid;
break;
case IOC_CPU_MAPID:
diff -r 86d03679d291 -r 8dd4dddf05e8 sys/sys/cpuio.h
--- a/sys/sys/cpuio.h Sun Sep 11 10:32:23 2011 +0000
+++ b/sys/sys/cpuio.h Sun Sep 11 14:54:49 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuio.h,v 1.4 2009/04/19 14:11:37 ad Exp $ */
+/* $NetBSD: cpuio.h,v 1.5 2011/09/11 14:54:49 jdc Exp $ */
/*-
* Copyright (c) 2007, 2009 The NetBSD Foundation, Inc.
@@ -53,7 +53,8 @@
char cs_name[16]; /* reserved */
int32_t cs_lastmodhi; /* time of last state change */
uint32_t cs_intrcnt; /* count of interrupt handlers + 1 */
- uint32_t cs_reserved[2]; /* reserved */
+ uint32_t cs_hwid; /* hardware id */
+ uint32_t cs_reserved; /* reserved */
} cpustate_t;
#define IOC_CPU_SETSTATE _IOW('c', 0, cpustate_t)
diff -r 86d03679d291 -r 8dd4dddf05e8 usr.sbin/cpuctl/cpuctl.c
--- a/usr.sbin/cpuctl/cpuctl.c Sun Sep 11 10:32:23 2011 +0000
+++ b/usr.sbin/cpuctl/cpuctl.c Sun Sep 11 14:54:49 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuctl.c,v 1.16 2011/08/27 22:38:48 joerg Exp $ */
+/* $NetBSD: cpuctl.c,v 1.17 2011/09/11 14:54:49 jdc Exp $ */
/*-
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#ifndef lint
#include <sys/cdefs.h>
-__RCSID("$NetBSD: cpuctl.c,v 1.16 2011/08/27 22:38:48 joerg Exp $");
+__RCSID("$NetBSD: cpuctl.c,v 1.17 2011/09/11 14:54:49 jdc Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -266,7 +266,7 @@
((time_t)cs.cs_lastmodhi << 32);
ts = asctime(localtime(&lastmod));
ts[strlen(ts) - 1] = '\0';
- printf("%-4d %-4x %-12s %-10s %s %s\n", i, cs.cs_id, state,
+ printf("%-4d %-4x %-12s %-10s %s %s\n", i, cs.cs_hwid, state,
intr, ts, ibuf);
}
}
Home |
Main Index |
Thread Index |
Old Index