Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm Cache the cpu type and cpu revision in cpu_info.



details:   https://anonhg.NetBSD.org/src/rev/b9af756698e6
branches:  trunk
changeset: 524390:b9af756698e6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Mar 24 22:02:58 2002 +0000

description:
Cache the cpu type and cpu revision in cpu_info.

diffstat:

 sys/arch/arm/arm32/cpu.c   |  9 +++++----
 sys/arch/arm/include/cpu.h |  6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 74c825d3f4cc -r b9af756698e6 sys/arch/arm/arm32/cpu.c
--- a/sys/arch/arm/arm32/cpu.c  Sun Mar 24 21:59:48 2002 +0000
+++ b/sys/arch/arm/arm32/cpu.c  Sun Mar 24 22:02:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.29 2002/03/16 18:47:51 bjh21 Exp $   */
+/*     $NetBSD: cpu.c,v 1.30 2002/03/24 22:02:58 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.29 2002/03/16 18:47:51 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.30 2002/03/24 22:02:58 thorpej Exp $");
 
 #include <sys/systm.h>
 #include <sys/malloc.h>
@@ -86,11 +86,12 @@
        /* Get the cpu ID from coprocessor 15 */
 
        curcpu()->ci_cpuid = cpu_id();
+       curcpu()->ci_cputype = curcpu()->ci_cpuid & CPU_ID_CPU_MASK;
+       curcpu()->ci_cpurev = curcpu()->ci_cpuid & CPU_ID_REVISION_MASK;
 
        identify_arm_cpu(dv, curcpu());
 
-       if ((curcpu()->ci_cpuid & CPU_ID_CPU_MASK) == CPU_ID_SA110
-           && (curcpu()->ci_cpuid & CPU_ID_REVISION_MASK) < 3) {
+       if (curcpu()->ci_cputype == CPU_ID_SA110 && curcpu()->ci_cpurev < 3) {
                printf("%s: SA-110 with bugged STM^ instruction\n",
                       dv->dv_xname);
        }
diff -r 74c825d3f4cc -r b9af756698e6 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Sun Mar 24 21:59:48 2002 +0000
+++ b/sys/arch/arm/include/cpu.h        Sun Mar 24 22:02:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.23 2002/03/24 15:49:40 bjh21 Exp $   */
+/*     $NetBSD: cpu.h,v 1.24 2002/03/24 22:02:59 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -178,7 +178,9 @@
        u_long ci_simple_locks;         /* # of simple locks held */
 #endif
        struct device *ci_dev;          /* Device corresponding to this CPU */
-       u_int32_t ci_cpuid;             /* The CPU id */
+       u_int32_t ci_cpuid;             /* aggregate CPU id */
+       u_int32_t ci_cputype;           /* CPU type */
+       u_int32_t ci_cpurev;            /* CPU revision */
        u_int32_t ci_ctrl;              /* The CPU control register */
        struct evcnt ci_arm700bugcount;
 };



Home | Main Index | Thread Index | Old Index