From owner-freebsd-sparc Wed Aug 7 12:22:45 2002 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C5AE37B400 for ; Wed, 7 Aug 2002 12:22:40 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 247CF43E77 for ; Wed, 7 Aug 2002 12:22:39 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 29669 invoked by uid 0); 7 Aug 2002 19:22:37 -0000 Received: from pd9538e48.dip.t-dialin.net (HELO forge.local) (217.83.142.72) by mail.gmx.net (mp016-rz3) with SMTP; 7 Aug 2002 19:22:37 -0000 Received: from tmm by forge.local with local (Exim 3.36 #1) id 17cWOy-0002Ey-00; Wed, 07 Aug 2002 21:23:25 +0200 Date: Wed, 7 Aug 2002 21:23:22 +0200 From: Thomas Moestl To: Patrick Cc: Jake Burkholder , freebsd-sparc@FreeBSD.ORG Subject: Re: adjkerntz error Message-ID: <20020807192322.GA8174@crow.dom2ip.de> Mail-Followup-To: Patrick , Jake Burkholder , freebsd-sparc@FreeBSD.ORG References: <20020802152957.V4442@locore.ca> <1028746803.4187.6.camel@m31> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1028746803.4187.6.camel@m31> User-Agent: Mutt/1.4i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 2002/08/07 at 15:00:02 -0400, Patrick wrote: > I was getting an error on adjkerntz (no such file or directory) when > running /sbin/adjkerntz -a. > > Using sysctl, I noticed that the machdep.adjkerntz is not equal to 2, > but is instead 7.392. Also, machdep.wall_cmos_clock is 7.394. > > Are the oids supposed to be the same for the i386 as the sparc64? I've > patched my sparc64/include/cpu.h file and it has fixed my problem, but > are the numbers going to change? Yes, they are; the relevant sysctl definitions were incorrectly allowing automatic OID selection (the static enumerations for this type of variables were more or less a historic mistake, but now applications depend on it). The attached patch should fix it. It also removes CPU_BOOTINFO, which is not used any more as you have correctly observed. - thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C Index: sparc64/include/cpu.h =================================================================== RCS file: /home/ncvs/src/sys/sparc64/include/cpu.h,v retrieving revision 1.10 diff -u -r1.10 cpu.h --- sparc64/include/cpu.h 28 Jul 2002 01:01:14 -0000 1.10 +++ sparc64/include/cpu.h 7 Aug 2002 19:12:09 -0000 @@ -59,16 +59,14 @@ #define CPU_CONSDEV 1 /* dev_t: console terminal device */ #define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */ #define CPU_DISRTCSET 3 /* int: disable resettodr() call */ -#define CPU_BOOTINFO 4 /* struct: bootinfo */ -#define CPU_WALLCLOCK 5 /* int: indicates wall CMOS clock */ -#define CPU_MAXID 6 /* number of valid machdep ids */ +#define CPU_WALLCLOCK 4 /* int: indicates wall CMOS clock */ +#define CPU_MAXID 5 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ { "console_device", CTLTYPE_STRUCT }, \ { "adjkerntz", CTLTYPE_INT }, \ { "disable_rtc_set", CTLTYPE_INT }, \ - { "bootinfo", CTLTYPE_STRUCT }, \ { "wall_cmos_clock", CTLTYPE_INT }, \ } Index: kern/subr_clock.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_clock.c,v retrieving revision 1.1 diff -u -r1.1 subr_clock.c --- kern/subr_clock.c 4 Apr 2002 23:39:10 -0000 1.1 +++ kern/subr_clock.c 7 Aug 2002 19:17:58 -0000 @@ -66,6 +66,9 @@ #include #include +/* XXX: for the CPU_* sysctl OID constants. */ +#include + #include "clock_if.h" static __inline int leapyear(int year); @@ -93,13 +96,13 @@ * These have traditionally been in machdep, but should probably be moved to * kern. */ -SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_machdep, CPU_ADJKERNTZ, adjkerntz, CTLTYPE_INT|CTLFLAG_RW, &adjkerntz, 0, sysctl_machdep_adjkerntz, "I", ""); -SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, +SYSCTL_INT(_machdep, CPU_DISRTCSET, disable_rtc_set, CTLFLAG_RW, &disable_rtc_set, 0, ""); -SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock, +SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall_cmos_clock, CTLFLAG_RW, &wall_cmos_clock, 0, ""); static int To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message