From owner-freebsd-current Sun Feb 17 12:43:32 2002 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id E7BBC37B41A for ; Sun, 17 Feb 2002 12:43:26 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id g1HKeMN06317; Sun, 17 Feb 2002 21:40:22 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Matthew Dillon Cc: Bruce Evans , freebsd-current@FreeBSD.ORG Subject: Re: Success! Sorta! (was Re: 'microuptime() went backwards ...' using ACPI timer. Shouldn't that be impossible? ) In-Reply-To: Your message of "Sun, 17 Feb 2002 12:38:01 PST." <200202172038.g1HKc1891121@apollo.backplane.com> Date: Sun, 17 Feb 2002 21:40:21 +0100 Message-ID: <6315.1013978421@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <200202172038.g1HKc1891121@apollo.backplane.com>, Matthew Dillon wri tes: > However, I think to be complete we need to make it even less elegant. > The TC module is only flip-flopping between two time counters, which > means that it can flip-flop twice and the test will not work. We need > a generation count on the timecounter as well: > > do { > tc = timecounter; > gen = tc->tc_generation; > *bt = tc->tc_offset; > bintime_addx(bt, tc->tc_scale * tco_delta(tc)); > } while (tc != timecounter || tc->tc_generation != gen); No, more like: do { tc = timecounter; gen = tc->gen; ... } while (gen != tc->gen); -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message