Extend kinfo_proc2 with CPU id

This commit is contained in:
sommerfeld 2000-11-19 00:54:50 +00:00
parent f276315e1c
commit d9969892eb
4 changed files with 29 additions and 15 deletions

View File

@ -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 lockmgr_printinfo(__volatile struct lock *);
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_init(struct simplelock *);
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)

View File

@ -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 *curproc; /* Current running proc. */
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 @@ void child_return __P((void *));
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. */

View File

@ -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 @@ struct kinfo_proc {
#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 @@ struct kinfo_proc2 {
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 */
};
/*

View File

@ -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 @@ extern struct lock kernel_lock;
#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.