From owner-freebsd-bugs Fri Jul 2 9:32:53 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from titanium.yy.ics.keio.ac.jp (titanium.yy.ics.keio.ac.jp [131.113.47.73]) by hub.freebsd.org (Postfix) with ESMTP id 334C215729; Fri, 2 Jul 1999 09:31:13 -0700 (PDT) (envelope-from sanpei@sanpei.org) Received: from lavender.yy.cs.keio.ac.jp (ppp094.dialup.st.keio.ac.jp [131.113.27.94]) by titanium.yy.ics.keio.ac.jp (8.8.8+3.0Wbeta13/3.7W) with ESMTP id BAA03788; Sat, 3 Jul 1999 01:31:08 +0900 (JST) Received: (from sanpei@localhost) by lavender.yy.cs.keio.ac.jp (8.9.3/3.7W) id BAA05432; Sat, 3 Jul 1999 01:31:05 +0900 (JST) Date: Sat, 3 Jul 1999 01:31:05 +0900 (JST) Message-Id: <199907021631.BAA05432@lavender.yy.cs.keio.ac.jp> To: unfurl@FreeBSD.ORG Cc: freebsd-bugs@FreeBSD.ORG, julian@FreeBSD.ORG Subject: Re: kern/6630: [PATCH] Fix for Cyrix I8254 bug In-Reply-To: Your message of "Fri, 2 Jul 1999 10:35:12 JST". <199907020135.SAA19316@freefall.freebsd.org> From: sanpei@sanpei.org (MIHIRA Yoshiro) X-Mailer: mnews [version 1.21] 1997-12/23(Tue) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org unfurl@FreeBSD.ORG Wrote >> Whistle is currently using the Cyrix 5510 chipsets. Please test this patch if necessary or close the PR altogether if this is fixed. Some people reported me that 2-times re-check is not eough for some MediaGX machine. I have 4-times recheck patch. --- clock.c.org Mon Aug 31 13:08:11 1998 +++ clock.c.cyrix-4 Thu Jan 14 22:01:17 1999 @@ -345,6 +345,11 @@ { u_long ef; int high, low; +#define CPU_CYRIX_NO_I8254_LATCH + +#ifdef CPU_CYRIX_NO_I8254_LATCH + int ret1, ret2, ret3, ret4; +#endif ef = read_eflags(); disable_intr(); @@ -354,9 +359,33 @@ low = inb(TIMER_CNTR0); high = inb(TIMER_CNTR0); +#ifdef CPU_CYRIX_NO_I8254_LATCH + ret1 = (high << 8) | low; + + outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); + low = inb(TIMER_CNTR0); + high= inb(TIMER_CNTR0); + ret2 = (high << 8) | low; + + outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); + low = inb(TIMER_CNTR0); + high= inb(TIMER_CNTR0); + ret3 = (high << 8) | low; + + outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); + low = inb(TIMER_CNTR0); + high= inb(TIMER_CNTR0); + ret4 = (high << 8) | low; +#endif write_eflags(ef); +#ifdef CPU_CYRIX_NO_I8254_LATCH + ret1 = (ret1 > ret2 ? ret1 : ret2); + ret3 = (ret3 > ret4 ? ret3 : ret4); + return (ret1 > ret3 ? ret1 : ret3); +#else return ((high << 8) | low); +#endif } /* @@ -598,12 +627,16 @@ } #endif +#if 0 if (bootverbose) +#endif printf("i8254 clock: %u Hz\n", tot_count); return (tot_count); fail: +#if 0 if (bootverbose) +#endif printf("failed, using default i8254 clock of %u Hz\n", timer_freq); return (timer_freq); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message