Date: Wed, 7 Aug 2002 21:23:22 +0200 From: Thomas Moestl <tmoestl@gmx.net> To: Patrick <patrick@godloveya.com> Cc: Jake Burkholder <jake@locore.ca>, freebsd-sparc@FreeBSD.ORG Subject: Re: adjkerntz error Message-ID: <20020807192322.GA8174@crow.dom2ip.de> In-Reply-To: <1028746803.4187.6.camel@m31> References: <FPEBKMIFGFHCGLLKBLMMAECPCBAA.ghelmer@palisadesys.com> <20020802152957.V4442@locore.ca> <1028746803.4187.6.camel@m31>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <tmoestl@gmx.net> http://www.tu-bs.de/~y0015675/ <tmm@FreeBSD.org> 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 <sys/sysctl.h> #include <sys/timetc.h> +/* XXX: for the CPU_* sysctl OID constants. */ +#include <machine/cpu.h> + #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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020807192322.GA8174>