Source-Changes-HG archive

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

[src/trunk]: src/sys move some per-cpu data definitions to MI place so that t...



details:   https://anonhg.NetBSD.org/src/rev/70222479cd48
branches:  trunk
changeset: 570074:70222479cd48
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Sep 22 11:32:02 2004 +0000

description:
move some per-cpu data definitions to MI place so that they can be modified
without touching all ports.  discussed on tech-kern@.

diffstat:

 sys/arch/alpha/include/cpu.h   |  24 ++---------
 sys/arch/amd64/include/cpu.h   |  21 ++--------
 sys/arch/amiga/include/cpu.h   |  10 +---
 sys/arch/arm/include/cpu.h     |  10 +---
 sys/arch/atari/include/cpu.h   |  10 +---
 sys/arch/cesfic/include/cpu.h  |  10 +---
 sys/arch/hp300/include/cpu.h   |  10 +---
 sys/arch/hp700/include/cpu.h   |  10 +---
 sys/arch/i386/include/cpu.h    |  24 ++---------
 sys/arch/luna68k/include/cpu.h |  10 +---
 sys/arch/mac68k/include/cpu.h  |  10 +---
 sys/arch/mips/include/cpu.h    |  10 +---
 sys/arch/mvme68k/include/cpu.h |  10 +---
 sys/arch/news68k/include/cpu.h |  10 +---
 sys/arch/next68k/include/cpu.h |  10 +---
 sys/arch/pc532/include/cpu.h   |  10 +---
 sys/arch/pdp10/include/cpu.h   |  11 +----
 sys/arch/powerpc/include/cpu.h |  10 +---
 sys/arch/sh3/include/cpu.h     |  10 +---
 sys/arch/sh5/include/cpu.h     |  10 +---
 sys/arch/sparc/sparc/cpuvar.h  |  10 +---
 sys/arch/sparc64/include/cpu.h |  19 ++-------
 sys/arch/sun3/include/cpu.h    |  10 +---
 sys/arch/sun68k/include/cpu.h  |  10 +---
 sys/arch/vax/include/cpu.h     |  13 ++----
 sys/arch/x68k/include/cpu.h    |  10 +---
 sys/arch/xen/include/cpu.h     |  24 ++---------
 sys/kern/kern_microtime.c      |  10 ++++-
 sys/sys/cc_microtime.h         |  53 +++++++++++++++++++++++++++
 sys/sys/cpu_data.h             |  82 ++++++++++++++++++++++++++++++++++++++++++
 30 files changed, 235 insertions(+), 246 deletions(-)

diffs (truncated from 1091 to 300 lines):

diff -r 1231dea4371f -r 70222479cd48 sys/arch/alpha/include/cpu.h
--- a/sys/arch/alpha/include/cpu.h      Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/alpha/include/cpu.h      Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.62 2004/01/04 11:33:29 jdolecek Exp $ */
+/* $NetBSD: cpu.h,v 1.63 2004/09/22 11:32:02 yamt Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -128,7 +128,8 @@
 #include <machine/alpha_cpu.h>
 
 #ifdef _KERNEL
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
+#include <sys/cc_microtime.h>
 #include <machine/frame.h>
 
 /*
@@ -143,12 +144,9 @@
        /*
         * Public members.
         */
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
-#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
-       u_long ci_spin_locks;           /* # of spin locks held */
-       u_long ci_simple_locks;         /* # of simple locks held */
-#endif
        struct lwp *ci_curlwp;          /* current owner of the processor */
+       struct cpu_data ci_data;        /* MI per-cpu data */
+       struct cc_microtime_state ci_cc;/* cc_microtime state */
        struct cpu_info *ci_next;       /* next cpu_info structure */
 
        /*
@@ -165,14 +163,6 @@
        u_long ci_intrdepth;            /* interrupt trap depth */
        struct trapframe *ci_db_regs;   /* registers for debuggers */
 
-       /*
-        * Variables used by cc_microtime().
-        */
-       struct timeval ci_cc_time;
-       long ci_cc_cc;
-       long ci_cc_ms_delta;
-       long ci_cc_denom;
-
 #if defined(MULTIPROCESSOR)
        __volatile u_long ci_flags;     /* flags; see below */
        __volatile u_long ci_ipis;      /* interprocessor interrupts pending */
@@ -314,12 +304,8 @@
 struct rpb;
 struct trapframe;
 
-extern struct timeval cc_microset_time;
-
 int    badaddr(void *, size_t);
 #define microtime(tv)  cc_microtime(tv)
-void   cc_microtime __P((struct timeval *));
-void   cc_microset(struct cpu_info *);
 
 #endif /* _KERNEL */
 #endif /* _ALPHA_CPU_H_ */
diff -r 1231dea4371f -r 70222479cd48 sys/arch/amd64/include/cpu.h
--- a/sys/arch/amd64/include/cpu.h      Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/amd64/include/cpu.h      Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.3 2003/12/30 12:33:15 pk Exp $       */
+/*     $NetBSD: cpu.h,v 1.4 2004/09/22 11:32:02 yamt Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -53,20 +53,20 @@
 
 #include <sys/device.h>
 #include <sys/lock.h>
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
+#include <sys/cc_microtime.h>
 
 struct cpu_info {
        struct device *ci_dev;
        struct cpu_info *ci_self;
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
+       struct cpu_data ci_data;        /* MI per-cpu data */
+       struct cc_microtime_state ci_cc;/* cc_microtime stete */
        struct cpu_info *ci_next;
 
        struct lwp *ci_curlwp;
        struct simplelock ci_slock;
        u_int ci_cpuid;
        u_int ci_apicid;
-       u_long ci_spin_locks;
-       u_long ci_simple_locks;
 
        u_int64_t ci_scratch;
 
@@ -104,11 +104,6 @@
 
        struct x86_cache_info ci_cinfo[CAI_COUNT];
 
-       struct timeval  ci_cc_time;
-       int64_t         ci_cc_cc;
-       int64_t         ci_cc_ms_delta;
-       int64_t         ci_cc_denom;
-
        char            *ci_gdt;
 
        struct x86_64_tss       ci_doubleflt_tss;
@@ -261,12 +256,6 @@
 extern char cpu_vendor[];
 extern int cpuid_level;
 
-/* kern_microtime.c */
-
-extern struct timeval cc_microset_time;
-void   cc_microtime __P((struct timeval *));
-void   cc_microset __P((struct cpu_info *));
-
 /* identcpu.c */
 
 void   identifycpu __P((struct cpu_info *));
diff -r 1231dea4371f -r 70222479cd48 sys/arch/amiga/include/cpu.h
--- a/sys/arch/amiga/include/cpu.h      Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/amiga/include/cpu.h      Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.57 2004/01/04 11:33:29 jdolecek Exp $        */
+/*     $NetBSD: cpu.h,v 1.58 2004/09/22 11:32:02 yamt Exp $    */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -92,13 +92,9 @@
 #include <m68k/cpu.h>
 #define        M68K_MMU_MOTOROLA
 
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
 struct cpu_info {
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
-#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
-       u_long ci_spin_locks;           /* # of spin locks held */
-       u_long ci_simple_locks;         /* # of simple locks held */
-#endif
+       struct cpu_data ci_data;        /* MI per-cpu data */
 };
 
 #ifdef _KERNEL
diff -r 1231dea4371f -r 70222479cd48 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/arm/include/cpu.h        Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.35 2004/01/04 11:33:29 jdolecek Exp $        */
+/*     $NetBSD: cpu.h,v 1.36 2004/09/22 11:32:02 yamt Exp $    */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -196,13 +196,9 @@
  */
 
 #include <sys/device.h>
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
 struct cpu_info {
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
-#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
-       u_long ci_spin_locks;           /* # of spin locks held */
-       u_long ci_simple_locks;         /* # of simple locks held */
-#endif
+       struct cpu_data ci_data;        /* MI per-cpu data */
        struct device *ci_dev;          /* Device corresponding to this CPU */
        u_int32_t ci_arm_cpuid;         /* aggregate CPU id */
        u_int32_t ci_arm_cputype;       /* CPU type */
diff -r 1231dea4371f -r 70222479cd48 sys/arch/atari/include/cpu.h
--- a/sys/arch/atari/include/cpu.h      Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/atari/include/cpu.h      Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.43 2004/01/04 11:33:30 jdolecek Exp $        */
+/*     $NetBSD: cpu.h,v 1.44 2004/09/22 11:32:02 yamt Exp $    */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -93,13 +93,9 @@
 #include <m68k/cpu.h>
 #define        M68K_MMU_MOTOROLA
 
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
 struct cpu_info {
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
-#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
-       u_long ci_spin_locks;           /* # of spin locks held */
-       u_long ci_simple_locks;         /* # of simple locks held */
-#endif
+       struct cpu_data ci_data;        /* MI per-cpu data */
 };
 
 #ifdef _KERNEL
diff -r 1231dea4371f -r 70222479cd48 sys/arch/cesfic/include/cpu.h
--- a/sys/arch/cesfic/include/cpu.h     Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/cesfic/include/cpu.h     Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.8 2004/01/04 11:33:30 jdolecek Exp $ */
+/*     $NetBSD: cpu.h,v 1.9 2004/09/22 11:32:02 yamt Exp $     */
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -88,13 +88,9 @@
  */
 #include <m68k/cpu.h>
 
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
 struct cpu_info {
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
-#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
-       u_long ci_spin_locks;           /* # of spin locks held */
-       u_long ci_simple_locks;         /* # of simple locks held */
-#endif
+       struct cpu_data ci_data;        /* MI per-cpu data */
 };
 
 #ifdef _KERNEL
diff -r 1231dea4371f -r 70222479cd48 sys/arch/hp300/include/cpu.h
--- a/sys/arch/hp300/include/cpu.h      Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/hp300/include/cpu.h      Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.44 2004/08/28 19:46:41 thorpej Exp $ */
+/*     $NetBSD: cpu.h,v 1.45 2004/09/22 11:32:02 yamt Exp $    */
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -98,13 +98,9 @@
  */
 #include <machine/intr.h>
 
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
 struct cpu_info {
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
-#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
-       u_long ci_spin_locks;           /* # of spin locks held */
-       u_long ci_simple_locks;         /* # of simple locks held */
-#endif
+       struct cpu_data ci_data;        /* MI per-cpu data */
 };
 
 #ifdef _KERNEL
diff -r 1231dea4371f -r 70222479cd48 sys/arch/hp700/include/cpu.h
--- a/sys/arch/hp700/include/cpu.h      Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/hp700/include/cpu.h      Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.12 2004/07/24 18:59:05 chs Exp $     */
+/*     $NetBSD: cpu.h,v 1.13 2004/09/22 11:32:02 yamt Exp $    */
 
 /*     $OpenBSD: cpu.h,v 1.20 2001/01/29 00:01:58 mickey Exp $ */
 
@@ -188,13 +188,9 @@
 #define        need_resched(ci)        (want_resched = 1, setsoftast())
 #define        need_proftick(p)        ((p)->p_flag |= P_OWEUPC, setsoftast())
 
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
 struct cpu_info {
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
-#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
-       u_long ci_spin_locks;           /* # of spin locks held */
-       u_long ci_simple_locks;         /* # of simple locks held */
-#endif
+       struct cpu_data ci_data;        /* MI per-cpu data */
 };
 
 #include <machine/intr.h>
diff -r 1231dea4371f -r 70222479cd48 sys/arch/i386/include/cpu.h
--- a/sys/arch/i386/include/cpu.h       Wed Sep 22 09:56:18 2004 +0000
+++ b/sys/arch/i386/include/cpu.h       Wed Sep 22 11:32:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.115 2004/05/16 12:32:53 yamt Exp $   */
+/*     $NetBSD: cpu.h,v 1.116 2004/09/22 11:32:02 yamt Exp $   */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -56,7 +56,8 @@
 
 #include <sys/device.h>
 #include <sys/lock.h>                  /* will also get LOCKDEBUG */
-#include <sys/sched.h>
+#include <sys/cpu_data.h>
+#include <sys/cc_microtime.h>
 
 #include <lib/libkern/libkern.h>       /* offsetof */
 
@@ -72,7 +73,6 @@
        struct cpu_info *ci_self;       /* self-pointer */
        void    *ci_tlog_base;          /* Trap log base */
        int32_t ci_tlog_offset;         /* Trap log current offset */
-       struct schedstate_percpu ci_schedstate; /* scheduler state */
        struct cpu_info *ci_next;       /* next cpu */
 
        /*
@@ -82,8 +82,8 @@
        struct simplelock ci_slock;     /* lock on this data structure */



Home | Main Index | Thread Index | Old Index