From f305bcafe377d6aad76753f4c83aa77f4262dff3 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Tue, 6 Sep 2005 02:36:17 +0000 Subject: [PATCH] Implement kern.hardclock_ticks. --- sys/kern/init_sysctl.c | 10 ++++++++-- sys/sys/sysctl.h | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/kern/init_sysctl.c b/sys/kern/init_sysctl.c index 74b53b907bfd..1a6fe6895347 100644 --- a/sys/kern/init_sysctl.c +++ b/sys/kern/init_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_sysctl.c,v 1.52 2005/08/24 16:00:54 simonb Exp $ */ +/* $NetBSD: init_sysctl.c,v 1.53 2005/09/06 02:36:17 rpaulo Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.52 2005/08/24 16:00:54 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.53 2005/09/06 02:36:17 rpaulo Exp $"); #include "opt_sysv.h" #include "opt_multiprocessor.h" @@ -338,6 +338,12 @@ SYSCTL_SETUP(sysctl_kern_setup, "sysctl kern subtree setup") sysctl_kern_clockrate, 0, NULL, sizeof(struct clockinfo), CTL_KERN, KERN_CLOCKRATE, CTL_EOL); + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT, + CTLTYPE_INT, "hardclock_ticks", + SYSCTL_DESCR("Number of hardclock ticks"), + NULL, 0, &hardclock_ticks, sizeof(hardclock_ticks), + CTL_KERN, KERN_HARDCLOCK_TICKS, CTL_EOL); sysctl_createv(clog, 0, NULL, NULL, CTLFLAG_PERMANENT, CTLTYPE_STRUCT, "vnode", diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index b9b3375e012e..8ecddf81a411 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1,4 +1,4 @@ -/* $NetBSD: sysctl.h,v 1.139 2005/08/07 12:30:01 blymn Exp $ */ +/* $NetBSD: sysctl.h,v 1.140 2005/09/06 02:36:17 rpaulo Exp $ */ /* * Copyright (c) 1989, 1993 @@ -270,7 +270,8 @@ struct ctlname { #define KERN_FILE2 77 /* struct: file entries */ #define KERN_VERIEXEC 78 /* node: verified exec */ #define KERN_CP_ID 79 /* struct: cpu id numbers */ -#define KERN_MAXID 80 /* number of valid kern ids */ +#define KERN_HARDCLOCK_TICKS 80 /* int: number of hardclock ticks */ +#define KERN_MAXID 81 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ @@ -354,6 +355,7 @@ struct ctlname { { "file2", CTLTYPE_STRUCT }, \ { "veriexec", CTLTYPE_NODE }, \ { "cp_id", CTLTYPE_STRUCT }, \ + { "hardclock_ticks", CTLTYPE_INT }, \ } /*