From eb5b4ac910350b8e079cac45a5c96655f1f1de0c Mon Sep 17 00:00:00 2001 From: fvdl Date: Sun, 6 Jul 1997 12:32:38 +0000 Subject: [PATCH] Add lock count fields to proc structure. Always define NCPU to 1 for now in lock.h --- sys/sys/lock.h | 13 +++++++++++++ sys/sys/proc.h | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 6adf53be6ded..0d957ded9c80 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -1,3 +1,5 @@ +/* $NetBSD: lock.h,v 1.2 1997/07/06 12:32:38 fvdl Exp $ */ + /* * Copyright (c) 1995 * The Regents of the University of California. All rights reserved. @@ -40,6 +42,16 @@ #ifndef _LOCK_H_ #define _LOCK_H_ +#define NCPUS 1 /* XXX */ + +/* + * Placeholder for simple lock structure until spinlocks are + * really used an machine-dependently defined. + */ +struct simplelock { + int lock_data; +}; + /* * The general lock structure. Provides for multiple shared locks, * upgrading from shared to exclusive, and sleeping until the lock @@ -159,6 +171,7 @@ void lockinit __P((struct lock *, int prio, char *wmesg, int timo, int lockmgr __P((__volatile struct lock *, u_int flags, struct simplelock *, struct proc *p)); int lockstatus __P((struct lock *)); +void lockmgr_printinfo __P((struct lock *)); #ifdef DEBUG void _simple_unlock __P((__volatile struct simplelock *alp, const char *, int)); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 954fb8503030..130e38ab4b73 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $NetBSD: proc.h,v 1.49 1997/04/28 04:49:35 mycroft Exp $ */ +/* $NetBSD: proc.h,v 1.50 1997/07/06 12:32:39 fvdl Exp $ */ /*- * Copyright (c) 1986, 1989, 1991, 1993 @@ -161,6 +161,9 @@ struct proc { struct vnode *p_textvp; /* Vnode of executable. */ + short p_locks; /* DEBUG: lockmgr count of held locks */ + short p_simple_locks; /* DEBUG: count of held simple locks */ + int p_holdcnt; /* If non-zero, don't swap. */ struct emul *p_emul; /* Emulation information */