Source-Changes-HG archive

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

[src/trunk]: src/sys/sys Extend kinfo_proc2 with CPU id



details:   https://anonhg.NetBSD.org/src/rev/cab1470cd106
branches:  trunk
changeset: 499388:cab1470cd106
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sun Nov 19 00:54:50 2000 +0000

description:
Extend kinfo_proc2 with CPU id

diffstat:

 sys/sys/lock.h   |  14 +++++++-------
 sys/sys/proc.h   |  19 +++++++++++++++----
 sys/sys/sysctl.h |   5 ++++-
 sys/sys/systm.h  |   6 +++---
 4 files changed, 29 insertions(+), 15 deletions(-)

diffs (127 lines):

diff -r 115474f043df -r cab1470cd106 sys/sys/lock.h
--- a/sys/sys/lock.h    Sun Nov 19 00:29:51 2000 +0000
+++ b/sys/sys/lock.h    Sun Nov 19 00:54:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.h,v 1.37 2000/08/26 19:26:43 sommerfeld Exp $     */
+/*     $NetBSD: lock.h,v 1.38 2000/11/19 00:54:50 sommerfeld Exp $     */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -283,12 +283,11 @@
 void   spinlock_switchcheck(void);
 #endif
 
-#define        spinlockinit(lkp, name, flags)                                  \
-       lockinit((lkp), 0, (name), 0, (flags) | LK_SPIN)
-
-#define        spinlockmgr(lkp, flags, intrlk)                                 \
-       lockmgr((lkp), (flags) | LK_SPIN, (intrlk))
-
+void   spinlockinit(struct lock *, const char *, int);
+int    spinlockmgr(__volatile struct lock *, u_int flags, struct simplelock *);
+int    spinlock_acquire_exclusive(__volatile struct lock *, u_int);
+int    spinlock_acquire_shared(__volatile struct lock *, u_int);
+void   spinlock_release(__volatile struct lock *);
 int    spinlock_release_all(__volatile struct lock *);
 void   spinlock_acquire_count(__volatile struct lock *, int);
 
@@ -309,6 +308,7 @@
 void   simple_lock_dump(void);
 void   simple_lock_freecheck(void *, void *);
 void   simple_lock_switchcheck(void);
+void   simplelock_sleeplock_check(struct simplelock *);
 #elif defined(MULTIPROCESSOR)
 #define        simple_lock_init(alp)   __cpu_simple_lock_init(&(alp)->lock_data)
 #define        simple_lock(alp)        __cpu_simple_lock(&(alp)->lock_data)
diff -r 115474f043df -r cab1470cd106 sys/sys/proc.h
--- a/sys/sys/proc.h    Sun Nov 19 00:29:51 2000 +0000
+++ b/sys/sys/proc.h    Sun Nov 19 00:54:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.108 2000/11/16 20:04:33 jdolecek Exp $      */
+/*     $NetBSD: proc.h,v 1.109 2000/11/19 00:54:50 sommerfeld Exp $    */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -358,9 +358,6 @@
 extern struct proc proc0;              /* Process slot for swapper. */
 extern int nprocs, maxproc;            /* Current and max number of procs. */
 
-/* Process list lock; see kern_proc.c for locking protocol details. */
-extern struct lock proclist_lock;
-
 extern struct proclist allproc;                /* List of all processes. */
 extern struct proclist zombproc;       /* List of zombie processes. */
 
@@ -418,10 +415,24 @@
 
 int    proc_isunder __P((struct proc *, struct proc*));
 
+#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
+/* Process list lock; see kern_proc.c for locking protocol details. */
+extern struct lock proclist_lock;
+
 void   proclist_lock_read __P((void));
 void   proclist_unlock_read __P((void));
 int    proclist_lock_write __P((void));
 void   proclist_unlock_write __P((int));
+
+#else
+
+#define        proclist_lock_read()    /* nothing */
+#define        proclist_unlock_read()
+#define        proclist_lock_write() splclock()
+#define        proclist_unlock_write(s) splx(s)
+
+#endif
+
 void   p_sugid __P((struct proc*));
 
 /* Compatbility with old, non-interlocked tsleep call. */
diff -r 115474f043df -r cab1470cd106 sys/sys/sysctl.h
--- a/sys/sys/sysctl.h  Sun Nov 19 00:29:51 2000 +0000
+++ b/sys/sys/sysctl.h  Sun Nov 19 00:54:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysctl.h,v 1.57 2000/11/08 22:41:59 eeh Exp $  */
+/*     $NetBSD: sysctl.h,v 1.58 2000/11/19 00:54:50 sommerfeld Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -288,6 +288,8 @@
 #define        KI_WMESGLEN     8
 #define        KI_MAXLOGNAME   24      /* extra for 8 byte alignment */
 
+#define KI_NOCPU       (~(u_int64_t)0)
+
 typedef struct {
        u_int32_t       __bits[4];
 } ki_sigset_t;
@@ -400,6 +402,7 @@
 
        u_int32_t p_uctime_sec;         /* STRUCT TIMEVAL: child u+s time. */
        u_int32_t p_uctime_usec;        /* STRUCT TIMEVAL: child u+s time. */
+       u_int64_t p_cpuid;              /* LONG: cpu id */
 };
 
 /*
diff -r 115474f043df -r cab1470cd106 sys/sys/systm.h
--- a/sys/sys/systm.h   Sun Nov 19 00:29:51 2000 +0000
+++ b/sys/sys/systm.h   Sun Nov 19 00:54:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: systm.h,v 1.120 2000/11/08 22:41:59 eeh Exp $  */
+/*     $NetBSD: systm.h,v 1.121 2000/11/19 00:54:50 sommerfeld Exp $   */
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -405,10 +405,10 @@
 #define        KERNEL_LOCK(flag)                                               \
 do {                                                                   \
        SCHED_ASSERT_UNLOCKED();                                        \
-       spinlockmgr(&kernel_lock, (flag), 0);                           \
+       spinlock_acquire_exclusive(&kernel_lock, flag);                 \
 } while (0)
 
-#define        KERNEL_UNLOCK()         spinlockmgr(&kernel_lock, LK_RELEASE, 0)
+#define        KERNEL_UNLOCK()         spinlock_release(&kernel_lock)
 
 /*
  * Acquire/release kernel lock on behalf of a process.



Home | Main Index | Thread Index | Old Index