Index: kern/kern_malloc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/kern_malloc.c,v
retrieving revision 1.52
diff -p -u -r1.52 kern_malloc.c
--- kern_malloc.c	2000/05/26 23:18:26	1.52
+++ kern_malloc.c	2000/06/18 05:13:13
@@ -44,6 +44,7 @@
 #include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/systm.h>
+#include <sys/sysctl.h>
 
 #include <vm/vm.h>
 #include <vm/vm_kern.h>
@@ -704,6 +705,91 @@ kmeminit()
 	for (indx = 0; indx < M_LAST; indx++)
 		kmemstats[indx].ks_limit = (nkmempages << PAGE_SHIFT) * 6 / 10;
 #endif
+}
+
+int sysctl_kmemstats(vwhere, sizep)
+	void *vwhere;
+	size_t *sizep;
+{
+#ifdef KMEMSTATS
+	char *where = vwhere;
+	struct kmemstats_sysctl skstat;
+	size_t left;
+	int i, error;
+
+	if (where == NULL) {
+		*sizep = sizeof(kmemstats) / sizeof(kmemstats[0]) *
+		    sizeof(struct kmemstats_sysctl);
+		return (0);
+	}
+	
+	error = 0;
+	left = *sizep;
+	memset(&skstat, 0, sizeof(skstat));
+	*sizep = 0;
+
+	memset(&skstat, 0, sizeof(skstat));
+	for (i = 0; i < sizeof(kmemstats) / sizeof(kmemstats[0]); i++) {
+		skstat.ks_inuse = kmemstats[i].ks_inuse;
+		skstat.ks_calls = kmemstats[i].ks_calls;
+		skstat.ks_memuse = kmemstats[i].ks_memuse;
+		skstat.ks_limblocks = kmemstats[i].ks_limblocks;
+		skstat.ks_mapblocks = kmemstats[i].ks_mapblocks;
+		skstat.ks_maxused = kmemstats[i].ks_maxused;
+		skstat.ks_limit = kmemstats[i].ks_limit;
+		skstat.ks_size = kmemstats[i].ks_size;
+
+		error = copyout(&skstat, where, sizeof(skstat));
+		if (error)
+			break;
+		where += sizeof(skstat);
+		*sizep += sizeof(skstat);
+		left -= sizeof(skstat);
+	}
+	return (error);
+#else
+	return (EOPNOTSUPP);
+#endif
+}
+
+int sysctl_kmembuckets(vwhere, sizep)
+	void *vwhere;
+	size_t *sizep;
+{
+	char *where = vwhere;
+	struct kmembuckets_sysctl skbuck;
+	size_t left;
+	int i, error;
+
+	if (where == NULL) {
+		*sizep = sizeof(bucket) / sizeof(bucket[0]) *
+		    sizeof(struct kmembuckets_sysctl);
+		return (0);
+	}
+
+	error = 0;
+	left = *sizep;
+	memset(&skbuck, 0, sizeof(skbuck));
+	*sizep = 0;
+
+	memset(&skbuck, 0, sizeof(skbuck));
+	for (i = 0; i < sizeof(bucket) / sizeof(bucket[0]); i++) {
+		skbuck.kb_calls = bucket[i].kb_calls;
+		skbuck.kb_total = bucket[i].kb_total;
+		skbuck.kb_totalfree = bucket[i].kb_totalfree;
+		skbuck.kb_elmpercl = bucket[i].kb_elmpercl;
+		skbuck.kb_highwat = bucket[i].kb_highwat;
+		skbuck.kb_couldfree = bucket[i].kb_couldfree;
+
+		error = copyout(&skbuck, where, sizeof(skbuck));
+		if (error)
+			break;
+		where += sizeof(skbuck);
+		*sizep += sizeof(skbuck);
+		left -= sizeof(skbuck);
+	}
+	return (error);
+
 }
 
 #ifdef DDB
Index: kern/kern_sysctl.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/kern_sysctl.c,v
retrieving revision 1.73
diff -p -u -r1.73 kern_sysctl.c
--- kern_sysctl.c	2000/06/16 00:57:04	1.73
+++ kern_sysctl.c	2000/06/18 05:13:14
@@ -103,6 +103,8 @@ static int sysctl_file __P((void *, size
 static int sysctl_sysvipc __P((int *, u_int, void *, size_t *));
 #endif
 static int sysctl_msgbuf __P((void *, size_t *));
+static int sysctl_dotkstat __P((int *, u_int, void *, size_t *, void *));
+static int sysctl_intr __P((int, void *, size_t *));
 static int sysctl_doeproc __P((int *, u_int, void *, size_t *));
 static void fill_kproc2 __P((struct proc *, struct kinfo_proc2 *));
 static int sysctl_procargs __P((int *, u_int, void *, size_t *, struct proc *));
@@ -282,6 +284,7 @@ kern_sysctl(name, namelen, oldp, oldlenp
 	case KERN_MBUF:
 	case KERN_PROC_ARGS:
 	case KERN_SYSVIPC_INFO:
+	case KERN_TKSTAT:
 		/* Not terminal. */
 		break;
 	default:
@@ -469,6 +472,24 @@ kern_sysctl(name, namelen, oldp, oldlenp
 #endif
 	case KERN_MSGBUF:
 		return (sysctl_msgbuf(oldp, oldlenp));
+	case KERN_TKSTAT:
+		return (sysctl_dotkstat(name + 1, namelen - 1, oldp, oldlenp,
+		    newp));
+	case KERN_DISK:
+		return (sysctl_disk(oldp, oldlenp));
+	case KERN_POOL:
+		return (sysctl_pool(oldp, oldlenp));
+	case KERN_KMEMSTATS:
+		return (sysctl_kmemstats(oldp, oldlenp));
+	case KERN_KMEMBUCKETS:
+		return (sysctl_kmembuckets(oldp, oldlenp));
+	case KERN_NAMEISTATS:
+		return (sysctl_nchstats(oldp, oldlenp));
+	case KERN_EVCNTSTATS:
+		return (sysctl_evcnt(oldp, oldlenp));
+	case KERN_INTRNAMES:
+	case KERN_INTRCNT:
+		return (sysctl_intr(name[0], oldp, oldlenp));
 	default:
 		return (EOPNOTSUPP);
 	}
@@ -1211,6 +1232,69 @@ sysctl_msgbuf(vwhere, sizep)
 		maxlen -= len;
 		pos = 0;
 	}
+	return (error);
+}
+
+static int
+sysctl_dotkstat(name, namelen, where, sizep, newp)
+	int *name;
+	u_int namelen;
+	void *where;
+	size_t *sizep;
+	void *newp;
+{
+	/* all sysctl names at this level are terminal */
+	if (namelen != 1)
+		return (ENOTDIR);		/* overloaded */
+
+	switch (name[0]) {
+	case TKSTAT_NIN:
+		return (sysctl_rdquad(where, sizep, newp, tk_nin));
+	case TKSTAT_NOUT:
+		return (sysctl_rdquad(where, sizep, newp, tk_nout));
+	case TKSTAT_CANCC:
+		return (sysctl_rdquad(where, sizep, newp, tk_cancc));
+	case TKSTAT_RAWCC:
+		return (sysctl_rdquad(where, sizep, newp, tk_rawcc));
+	default:
+		return (EOPNOTSUPP);
+	}
+}
+
+static int
+sysctl_intr(type, where, sizep)
+	int type;
+	void *where;
+	size_t *sizep;
+{
+	size_t len;
+	int error;
+	char *start;
+	extern long intrnames, eintrnames, intrcnt, eintrcnt;
+	char *in, *ein, *ic, *eic;
+
+	in = (char *)&intrnames;
+	ein = (char *)&eintrnames;
+	ic = (char *)&intrcnt;
+	eic = (char *)&eintrcnt;
+
+	if (type == KERN_INTRNAMES) {
+		start = in;
+		len = ein - in;
+	} else { /* KERN_INTRCNT */
+		start = ic;
+		len = eic - ic;
+	}
+
+	if (where == NULL) {
+		*sizep = len;
+		return (0);
+	}
+
+	if (*sizep < len)
+		return (ENOMEM);
+	error = copyout(start, where, len);
+	*sizep = len;
 	return (error);
 }
 
Index: kern/subr_autoconf.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/subr_autoconf.c,v
retrieving revision 1.54
diff -p -u -r1.54 subr_autoconf.c
--- subr_autoconf.c	2000/06/13 22:36:17	1.54
+++ subr_autoconf.c	2000/06/18 05:13:14
@@ -91,7 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: subr_autocon
 #include <sys/kernel.h>
 #include <sys/errno.h>
 #include <sys/proc.h>
-#include <machine/limits.h>
+#include <sys/sysctl.h>
 
 /*
  * Autoconfiguration subroutines.
@@ -133,6 +133,7 @@ static void config_process_deferred(stru
 
 struct devicelist alldevs;		/* list of all devices */
 struct evcntlist allevents;		/* list of all event counters */
+static int ev_count;			/* number of event counters */
 
 __volatile int config_pending;		/* semaphore for mountroot */
 
@@ -147,6 +148,7 @@ configure(void)
 	TAILQ_INIT(&interrupt_config_queue);
 	TAILQ_INIT(&alldevs); 
 	TAILQ_INIT(&allevents);
+	ev_count = 0;
 
 	/*
 	 * Do the machine-dependent portion of autoconfiguration.  This
@@ -735,6 +737,7 @@ evcnt_attach_static(struct evcnt *ev)
 	ev->ev_namelen = len;
 
 	TAILQ_INSERT_TAIL(&allevents, ev, ev_list);
+	ev_count++;
 }
 
 /*
@@ -762,4 +765,45 @@ evcnt_detach(struct evcnt *ev)
 {
 
 	TAILQ_REMOVE(&allevents, ev, ev_list);
+	ev_count--;
+}
+
+int
+sysctl_evcnt(vwhere, sizep)
+	void *vwhere;
+	size_t *sizep;
+{
+	struct evcnt_sysctl sevcnt;
+	struct evcnt *evp;
+	char *where = vwhere;
+	size_t left;
+	int error;
+
+	if (where == NULL) {
+		*sizep = ev_count * sizeof(struct evcnt_sysctl);
+		return (0);
+	}
+
+	error = 0;
+	left = *sizep;
+	memset(&sevcnt, 0, sizeof(sevcnt));
+	*sizep = 0;
+
+	for (evp = TAILQ_FIRST(&allevents); evp != NULL;
+	    evp = TAILQ_NEXT(evp, ev_list)) {
+		if (left < sizeof(struct evcnt_sysctl))
+			break;
+		sevcnt.ev_count = evp->ev_count;
+		sevcnt.ev_type = evp->ev_type;
+		strncpy(sevcnt.ev_group, evp->ev_group, sizeof(sevcnt.ev_group));;
+		strncpy(sevcnt.ev_name, evp->ev_name, sizeof(sevcnt.ev_name));;
+
+		error = copyout(&sevcnt, where, sizeof(sevcnt));
+		if (error)
+			break;
+		where += sizeof(sevcnt);
+		*sizep += sizeof(sevcnt);
+		left -= sizeof(sevcnt);
+	}
+	return (error);
 }
Index: kern/subr_disk.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/subr_disk.c,v
retrieving revision 1.29
diff -p -u -r1.29 subr_disk.c
--- subr_disk.c	2000/03/30 09:27:12	1.29
+++ subr_disk.c	2000/06/18 05:13:14
@@ -78,14 +78,13 @@
  */
 
 #include <sys/param.h>
-#include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/buf.h>
 #include <sys/syslog.h>
-#include <sys/time.h>
 #include <sys/disklabel.h>
 #include <sys/disk.h>
+#include <sys/sysctl.h>
 
 /*
  * A global list of all disks attached to the system.  May grow or
@@ -402,8 +401,8 @@ disk_find(name)
 	if ((name == NULL) || (disk_count <= 0))
 		return (NULL);
 
-	for (diskp = disklist.tqh_first; diskp != NULL;
-	    diskp = diskp->dk_link.tqe_next)
+	for (diskp = TAILQ_FIRST(&disklist); diskp != NULL;
+	    diskp = TAILQ_NEXT(diskp, dk_link))
 		if (strcmp(diskp->dk_name, name) == 0)
 			return (diskp);
 
@@ -543,4 +542,48 @@ disk_resetstat(diskp)
 	timerclear(&diskp->dk_time);
 
 	splx(s);
+}
+
+int
+sysctl_disk(vwhere, sizep)
+	void *vwhere;
+	size_t *sizep;
+{
+	struct disk_sysctl sdisk;
+	struct disk *diskp;
+	char *where = vwhere;
+	size_t left;
+	int error;
+
+	if (where == NULL) {
+		*sizep = disk_count * sizeof(struct disk_sysctl);
+		return (0);
+	}
+
+	error = 0;
+	left = *sizep;
+	memset(&sdisk, 0, sizeof(sdisk));
+
+	for (diskp = TAILQ_FIRST(&disklist); diskp != NULL;
+	    diskp = TAILQ_NEXT(diskp, dk_link)) {
+		if (left < sizeof(struct disk_sysctl))
+			break;
+		strncpy(sdisk.dk_name, diskp->dk_name, sizeof(sdisk.dk_name));;
+		sdisk.dk_xfer = diskp->dk_xfer;
+		sdisk.dk_seek = diskp->dk_seek;
+		sdisk.dk_bytes = diskp->dk_bytes;
+		sdisk.dk_attachtime_sec = diskp->dk_attachtime.tv_sec;
+		sdisk.dk_attachtime_usec = diskp->dk_attachtime.tv_usec;
+		sdisk.dk_timestamp_sec = diskp->dk_timestamp.tv_sec;
+		sdisk.dk_timestamp_usec = diskp->dk_timestamp.tv_usec;
+		sdisk.dk_time_sec = diskp->dk_time.tv_sec;
+		sdisk.dk_time_usec = diskp->dk_time.tv_usec;
+		sdisk.dk_busy = diskp->dk_busy;
+		error = copyout(&sdisk, where, sizeof(sdisk));
+		if (error)
+			break;
+		where += sizeof(sdisk);
+		left -= sizeof(sdisk);
+	}
+	return (error);
 }
Index: kern/subr_pool.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/subr_pool.c,v
retrieving revision 1.37
diff -p -u -r1.37 subr_pool.c
--- subr_pool.c	2000/06/10 18:44:44	1.37
+++ subr_pool.c	2000/06/18 05:13:14
@@ -50,6 +50,7 @@
 #include <sys/lock.h>
 #include <sys/pool.h>
 #include <sys/syslog.h>
+#include <sys/sysctl.h>
 
 #include <vm/vm.h>
 #include <vm/vm_kern.h>
@@ -69,6 +70,8 @@
 
 /* List of all pools */
 TAILQ_HEAD(,pool) pool_head = TAILQ_HEAD_INITIALIZER(pool_head);
+/* Number of pools */
+static int pool_count = 0;
 
 /* Private pool for page header structures */
 static struct pool phpool;
@@ -532,6 +535,7 @@ pool_init(pp, size, align, ioff, flags, 
 	/* Insert into the list of all pools. */
 	simple_lock(&pool_head_slock);
 	TAILQ_INSERT_TAIL(&pool_head, pp, pr_poollist);
+	pool_count++;
 	simple_unlock(&pool_head_slock);
 }
 
@@ -560,6 +564,8 @@ pool_destroy(pp)
 	/* Remove from global pool list */
 	simple_lock(&pool_head_slock);
 	TAILQ_REMOVE(&pool_head, pp, pr_poollist);
+	if (--pool_count < 0)
+		panic("pool_destroy: pool_count < 0");
 	/* XXX Only clear this if we were drainpp? */
 	drainpp = NULL;
 	simple_unlock(&pool_head_slock);
@@ -1539,4 +1545,67 @@ pool_chk(pp, label)
 out:
 	simple_unlock(&pp->pr_slock);
 	return (r);
+}
+
+int
+sysctl_pool(vwhere, sizep)
+	void *vwhere;
+	size_t *sizep;
+{
+	struct pool_sysctl spool;
+	struct pool *poolp;
+	char *where = vwhere;
+	size_t left;
+	int error;
+
+	if (where == NULL) {
+		*sizep = pool_count * sizeof(struct pool_sysctl);
+		return (0);
+	}
+
+	error = 0;
+	left = *sizep;
+	memset(&spool, 0, sizeof(spool));
+	*sizep = 0;
+
+	simple_lock(&pool_head_slock);
+	for (poolp = TAILQ_FIRST(&pool_head); poolp != NULL;
+	    poolp = TAILQ_NEXT(poolp, pr_poollist)) {
+		if (left < sizeof(struct pool_sysctl))
+			break;
+		strncpy(spool.pr_wchan, poolp->pr_wchan, sizeof(spool.pr_wchan));;
+		spool.pr_mtype = poolp->pr_mtype;
+		spool.pr_size = poolp->pr_size;
+		spool.pr_minitems = poolp->pr_minitems;
+		spool.pr_minpages = poolp->pr_minpages;
+		spool.pr_maxpages = poolp->pr_maxpages;
+		spool.pr_npages = poolp->pr_npages;
+		spool.pr_pagesz = poolp->pr_pagesz;
+		spool.pr_itemsperpage = poolp->pr_itemsperpage;
+		spool.pr_nitems = poolp->pr_nitems;
+		spool.pr_nout = poolp->pr_nout;
+		spool.pr_hardlimit = poolp->pr_hardlimit;
+		spool.pr_flags = poolp->pr_flags;
+		spool.pr_roflags = poolp->pr_roflags;
+		spool.pr_hardlimit_ratecap_sec = poolp->pr_hardlimit_ratecap.tv_sec;
+		spool.pr_hardlimit_ratecap_usec = poolp->pr_hardlimit_ratecap.tv_usec;
+		spool.pr_hardlimit_warning_last_sec = poolp->pr_hardlimit_warning_last.tv_sec;
+		spool.pr_hardlimit_warning_last_usec = poolp->pr_hardlimit_warning_last.tv_usec;
+		spool.pr_hiwat = poolp->pr_hiwat;
+		spool.pr_nget = poolp->pr_nget;
+		spool.pr_nfail = poolp->pr_nfail;
+		spool.pr_nput = poolp->pr_nput;
+		spool.pr_npagealloc = poolp->pr_npagealloc;
+		spool.pr_npagefree = poolp->pr_npagefree;
+		spool.pr_nidle = poolp->pr_nidle;
+
+		error = copyout(&spool, where, sizeof(spool));
+		if (error)
+			break;
+		where += sizeof(spool);
+		*sizep += sizeof(spool);
+		left -= sizeof(spool);
+	}
+	simple_unlock(&pool_head_slock);
+	return (error);
 }
Index: kern/vfs_cache.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/vfs_cache.c,v
retrieving revision 1.25
diff -p -u -r1.25 vfs_cache.c
--- vfs_cache.c	2000/04/16 21:41:49	1.25
+++ vfs_cache.c	2000/06/18 05:13:14
@@ -44,6 +44,7 @@
 #include <sys/errno.h>
 #include <sys/malloc.h>
 #include <sys/pool.h>
+#include <sys/sysctl.h>
 
 /*
  * Name caching works as follows:
@@ -467,3 +468,36 @@ cache_purgevfs(mp)
 	}
 }
 
+int sysctl_nchstats(where, sizep)
+	void *where;
+	size_t *sizep;
+{
+	struct nchstats_sysctl sns;
+	int error;
+
+	if (where == NULL) {
+		*sizep = sizeof(sns);
+		return (0);
+	}
+
+	if (*sizep < sizeof(sns))
+		return (ENOMEM);
+
+	sns.ncs_goodhits = nchstats.ncs_goodhits;
+	sns.ncs_neghits = nchstats.ncs_neghits;
+	sns.ncs_badhits = nchstats.ncs_badhits;
+	sns.ncs_falsehits = nchstats.ncs_falsehits;
+	sns.ncs_miss = nchstats.ncs_miss;
+	sns.ncs_long = nchstats.ncs_long;
+	sns.ncs_pass2 = nchstats.ncs_pass2;
+	sns.ncs_2passes = nchstats.ncs_2passes;
+	sns.ncs_revhits = nchstats.ncs_revhits;
+	sns.ncs_revmiss = nchstats.ncs_revmiss;
+
+	error = copyout(&sns, where, sizeof(sns));
+	if (error)
+		return (error);
+
+	*sizep = sizeof(sns);
+	return (0);
+}
Index: sys/device.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/device.h,v
retrieving revision 1.42
diff -p -u -r1.42 device.h
--- device.h	2000/06/13 22:36:16	1.42
+++ device.h	2000/06/18 05:13:14
@@ -136,6 +136,15 @@ struct evcnt {
 };
 TAILQ_HEAD(evcntlist, evcnt);
 
+/* The following structure is 64-bit alignment safe */
+struct evcnt_sysctl {
+	u_int64_t	ev_count;
+	unsigned char	ev_type;
+	unsigned char	pad[7];
+	char		ev_group[16];
+	char		ev_name[16];
+};
+
 /* maximum group/name lengths, including trailing NUL */
 #define	EVCNT_STRING_MAX	256
 
Index: sys/disk.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/disk.h,v
retrieving revision 1.16
diff -p -u -r1.16 disk.h
--- disk.h	2000/05/16 05:45:53	1.16
+++ disk.h	2000/06/18 05:13:14
@@ -131,6 +131,22 @@ struct disk {
 	struct cpu_disklabel *dk_cpulabel;
 };
 
+/* The following structure is 64-bit alignment safe */
+struct disk_sysctl {
+	char		dk_name[16];
+	int32_t		dk_busy;
+	int32_t		pad;
+	u_int64_t	dk_xfer;
+	u_int64_t	dk_seek;
+	u_int64_t	dk_bytes;
+	u_int32_t	dk_attachtime_sec;
+	u_int32_t	dk_attachtime_usec;
+	u_int32_t	dk_timestamp_sec;
+	u_int32_t	dk_timestamp_usec;
+	u_int32_t	dk_time_sec;
+	u_int32_t	dk_time_usec;
+};
+
 struct dkdriver {
 	void	(*d_strategy) __P((struct buf *));
 #ifdef notyet
Index: sys/malloc.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/malloc.h,v
retrieving revision 1.51
diff -p -u -r1.51 malloc.h
--- malloc.h	2000/06/03 18:22:38	1.51
+++ malloc.h	2000/06/18 05:13:14
@@ -172,7 +172,8 @@
 #define	M_IP6RR		112	/* IPv6 Router Renumbering Prefix */
 #define	M_RR_ADDR	113	/* IPv6 Router Renumbering Ifid */
 #define M_SOFTINTR	114	/* Softinterrupt structures */
-#define M_LAST		115	/* Must be last type + 1 */
+#define	M_SWAPFS	115	/* swapfs file system structures */
+#define M_LAST		116	/* Must be last type + 1 */
 
 #define	INITKMEMNAMES { \
 	"free",		/* 0 M_FREE */ \
@@ -290,7 +291,8 @@
 	"ip6rr",	/* 112 M_IP6RR */ \
 	"rp_addr",	/* 113 M_RR_ADDR */ \
 	"softintr",	/* 114 M_SOFTINTR */ \
-	NULL,		/* 115 */ \
+	"swapfs",	/* 115 M_SWAPFS */ \
+	NULL,		/* 116 */ \
 }
 
 struct kmemstats {
@@ -305,6 +307,20 @@ struct kmemstats {
 	long	ks_spare;
 };
 
+/* The following structure is 64-bit alignment safe */
+struct kmemstats_sysctl {
+	int64_t		ks_inuse;
+	int64_t		ks_calls;
+	int64_t		ks_memuse;
+	u_int16_t	ks_limblocks;
+	u_int16_t	ks_mapblocks;
+	u_int32_t	pad;
+	int64_t		ks_maxused;
+	int64_t		ks_limit;
+	int64_t		ks_size;
+	int64_t		ks_spare;
+};
+
 /*
  * Array of descriptors that describe the contents of each page
  */
@@ -330,6 +346,16 @@ struct kmembuckets {
 	long	kb_elmpercl;	/* # of elements in this sized allocation */
 	long	kb_highwat;	/* high water mark */
 	long	kb_couldfree;	/* over high water mark and could free */
+};
+
+/* The following structure is 64-bit alignment safe */
+struct kmembuckets_sysctl {
+	int64_t	kb_calls;
+	int64_t	kb_total;
+	int64_t	kb_totalfree;
+	int64_t	kb_elmpercl;
+	int64_t	kb_highwat;
+	int64_t	kb_couldfree;
 };
 
 #ifdef _KERNEL
Index: sys/namei.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/namei.h,v
retrieving revision 1.18
diff -p -u -r1.18 namei.h
--- namei.h	2000/04/16 21:41:50	1.18
+++ namei.h	2000/06/18 05:13:14
@@ -203,4 +203,18 @@ struct	nchstats {
 	long	ncs_revhits;		/* reverse-cache hits */
 	long	ncs_revmiss;		/* reverse-cache misses */
 };
+
+/* The following structure is 64-bit alignment safe */
+struct nchstats_sysctl {
+	int64_t	ncs_goodhits;
+	int64_t	ncs_neghits;
+	int64_t	ncs_badhits;
+	int64_t	ncs_falsehits;
+	int64_t	ncs_miss;
+	int64_t	ncs_long;
+	int64_t	ncs_pass2;
+	int64_t	ncs_2passes;
+	int64_t	ncs_revhits;
+	int64_t	ncs_revmiss;
+};
 #endif /* !_SYS_NAMEI_H_ */
Index: sys/pool.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/pool.h,v
retrieving revision 1.17
diff -p -u -r1.17 pool.h
--- pool.h	2000/02/14 21:17:04	1.17
+++ pool.h	2000/06/18 05:13:14
@@ -142,6 +142,35 @@ struct pool {
 	const char	*pr_entered_file; /* reentrancy check */
 	long		pr_entered_line;
 };
+
+/* The following structure is 64-bit alignment safe */
+struct pool_sysctl {
+	char		pr_wchan[32];
+	int32_t		pr_mtype;
+	u_int32_t	pr_size;
+	u_int32_t	pr_minitems;
+	u_int32_t	pr_minpages;
+	u_int32_t	pr_maxpages;
+	u_int32_t	pr_npages;
+	u_int32_t	pr_pagesz;
+	u_int32_t	pr_itemsperpage;
+	u_int32_t	pr_nitems;
+	u_int32_t	pr_nout;
+	u_int32_t	pr_hardlimit;
+	u_int32_t	pr_flags;
+	u_int32_t	pr_roflags;
+	u_int32_t	pr_hardlimit_ratecap_sec;
+	u_int32_t	pr_hardlimit_ratecap_usec;
+	u_int32_t	pr_hardlimit_warning_last_sec;
+	u_int32_t	pr_hardlimit_warning_last_usec;
+	u_int32_t	pr_hiwat;
+	u_int64_t	pr_nget;
+	u_int64_t	pr_nfail;
+	u_int64_t	pr_nput;
+	u_int64_t	pr_npagealloc;
+	u_int64_t	pr_npagefree;
+	u_int64_t	pr_nidle;
+};
 #endif /* __POOL_EXPOSE */
 
 #ifdef _KERNEL
Index: sys/sysctl.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/sysctl.h,v
retrieving revision 1.51
diff -p -u -r1.51 sysctl.h
--- sysctl.h	2000/06/16 00:18:10	1.51
+++ sysctl.h	2000/06/18 05:13:15
@@ -44,12 +44,10 @@
 /*
  * These are for the eproc structure defined below.
  */
-#ifndef _KERNEL
 #include <sys/time.h>
 #include <sys/ucred.h>
 #include <sys/proc.h>
 #include <vm/vm.h>
-#endif
 
 /*
  * Definitions for sysctl call.  The sysctl call uses a hierarchical name
@@ -165,7 +163,16 @@ struct ctlname {
 #define	KERN_CP_TIME		51	/* struct: cpu time counters */
 #define	KERN_SYSVIPC_INFO	52	/* number of valid kern ids */
 #define	KERN_MSGBUF		53	/* kernel message buffer */
-#define	KERN_MAXID		54	/* number of valid kern ids */
+#define	KERN_TKSTAT		54	/* tty in/out counters */
+#define	KERN_DISK		55	/* disk statistics */
+#define	KERN_POOL		56	/* resource pool manager statistics */
+#define	KERN_KMEMSTATS		57	/* kernel memory statistics */
+#define	KERN_KMEMBUCKETS	58	/* kernel memory bucket usage */
+#define	KERN_NAMEISTATS		59	/* namei cache statistics */
+#define	KERN_EVCNTSTATS		60	/* event counter statistics */
+#define	KERN_INTRNAMES		61	/* interrupt names (temporary, use evcnts) */
+#define	KERN_INTRCNT		62	/* interrupt counts (temporary, use evcnts) */
+#define	KERN_MAXID		63	/* number of valid kern ids */
 
 #define	CTL_KERN_NAMES { \
 	{ 0, 0 }, \
@@ -222,6 +229,15 @@ struct ctlname {
 	{ "cp_time", CTLTYPE_STRUCT }, \
 	{ "sysvipc_info", CTLTYPE_STRUCT }, \
 	{ "msgbuf", CTLTYPE_STRUCT }, \
+	{ "tkstat", CTLTYPE_NODE }, \
+	{ "disk", CTLTYPE_STRUCT }, \
+	{ "pool", CTLTYPE_STRUCT }, \
+	{ "kmemstats", CTLTYPE_STRUCT }, \
+	{ "kmembuckets", CTLTYPE_STRUCT }, \
+	{ "nameistats", CTLTYPE_STRUCT }, \
+	{ "evcntstats", CTLTYPE_STRUCT }, \
+	{ "intrnames", CTLTYPE_STRUCT }, \
+	{ "intrcnt", CTLTYPE_STRUCT }, \
 }
 
 /*
@@ -416,6 +432,23 @@ struct kinfo_proc2 {
 #define	KERN_SYSVIPC_SHM_INFO		3	/* shminfo and shmid_ds */
 
 /*
+ * tty counter sysctl variables
+ */
+#define TKSTAT_NIN			1	/* total input character */
+#define TKSTAT_NOUT			2	/* total output character */
+#define TKSTAT_CANCC			3	/* canonical input character */
+#define TKSTAT_RAWCC			4	/* raw input character */
+#define	TKSTAT_MAXID			5	/* number of valid TKSTAT ids */
+
+#define	CTL_TKSTAT_NAMES { \
+	{ 0, 0 }, \
+	{ "nin", CTLTYPE_QUAD }, \
+	{ "nout", CTLTYPE_QUAD }, \
+	{ "cancc", CTLTYPE_QUAD }, \
+	{ "rawcc", CTLTYPE_QUAD }, \
+}
+
+/*
  * CTL_HW identifiers
  */
 #define	HW_MACHINE	 1		/* string: machine class */
@@ -630,8 +663,14 @@ int sysctl_rdstruct __P((void *, size_t 
 struct radix_node;
 struct walkarg;
 int sysctl_clockrate __P((void *, size_t *));
-int sysctl_vnode __P((char *, size_t *, struct proc *));
+int sysctl_disk __P((void *, size_t *));
+int sysctl_evcnt __P((void *, size_t *));
+int sysctl_kmemstats __P((void *, size_t *));
+int sysctl_nchstats __P((void *, size_t *));
+int sysctl_kmembuckets __P((void *, size_t *));
 int sysctl_ntptime __P((void *, size_t *));
+int sysctl_pool __P((void *, size_t *));
+int sysctl_vnode __P((char *, size_t *, struct proc *));
 #ifdef GPROF
 int sysctl_doprof __P((int *, u_int, void *, size_t *, void *, size_t));
 #endif