From owner-cvs-all@FreeBSD.ORG Mon Jun 16 17:04:23 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 072C31065671; Mon, 16 Jun 2008 17:04:23 +0000 (UTC) (envelope-from olli@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E786B8FC19; Mon, 16 Jun 2008 17:04:22 +0000 (UTC) (envelope-from olli@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5GH4MjN066707; Mon, 16 Jun 2008 17:04:22 GMT (envelope-from olli@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5GH4Mms066706; Mon, 16 Jun 2008 17:04:22 GMT (envelope-from olli@repoman.freebsd.org) Message-Id: <200806161704.m5GH4Mms066706@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to olli@repoman.freebsd.org using -f From: Oliver Fromme Date: Mon, 16 Jun 2008 17:04:04 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/boot/i386/libi386 time.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2008 17:04:23 -0000 olli 2008-06-16 17:04:04 UTC FreeBSD src repository Modified files: sys/boot/i386/libi386 time.c Log: SVN rev 179825 on 2008-06-16 17:04:04Z by olli Implement a workaround for a long-standing problem in libi386's time(), caused by a qemu bug. The bug might be present in other BIOSes, too. qemu either does not simulate the AT RTC correctly or has a broken BIOS 1A/02 implementation, and will return an incorrect value if the RTC is read while it is being updated. The effect is worsened by the fact that qemu's INT 15/86 function ("wait" a.k.a. usleep) is non-implmeneted or broken and returns immediately, causing beastie.4th to spin in a tight loop calling the "read RTC" function millions of times, triggering the problem quickly. Therefore, we keep reading the BIOS value until we get the same result twice. This change fixes beastie.4th's countdown under qemu. Approved by: des (mentor) Revision Changes Path 1.6 +32 -8 src/sys/boot/i386/libi386/time.c