From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 20 07:55:44 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9A610656A4 for ; Fri, 20 Aug 2010 07:55:44 +0000 (UTC) (envelope-from wdef200@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6A4FD8FC1E for ; Fri, 20 Aug 2010 07:55:44 +0000 (UTC) Received: by bwz20 with SMTP id 20so2847003bwz.13 for ; Fri, 20 Aug 2010 00:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=MJYAKBpf0739d5MQz/sSnHRhUrrxQR3rLXgiDZ60cR4=; b=XVZ+jTrvGnToMaSrnYRT50IRPle4LaXaNPhNRy5az+NxIT4z7aadA4uImpHrXkT7Kz MGl/Cos7+Kjj9skBZARXRU0E6uRuuL17b/a90YfDxhgGWDuF9KavBw1FGnkg7ihQjwdQ dv+97vFKJaIwKPlC0qcZwLcuisuZYmgmvIQKk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RhxPxFMLwlZ/BC5LsWTfHQPea5WHgMhMmk1VV8fSL+FLCE0Ki3w7RBlLsecNRln7RW 9UppdIcrc9/HmqL05IKgQLQ7GhBAcuh93FDnA7hgzCmEJHMngsNKuzVrHECunHQ1PiSd akXwNQahG70XczGK6aMf+MrUexGG4e4nDPino= MIME-Version: 1.0 Received: by 10.204.140.27 with SMTP id g27mr615083bku.168.1282290936004; Fri, 20 Aug 2010 00:55:36 -0700 (PDT) Received: by 10.204.67.3 with HTTP; Fri, 20 Aug 2010 00:55:35 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 Aug 2010 10:55:35 +0300 Message-ID: From: phil hefferan To: bf1783@gmail.com Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: How to read cmos clock - what is gettimeofday reading? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2010 07:55:45 -0000 On Fri, Aug 20, 2010 at 5:17 AM, b. f. wrote: > >To further confuse matters there appears to be a common misconception on > the web > >that the cmos time is automatically synced to system time on FreeBSD. This > is > >incorrect: see msg03414 on freebsd-hardware at freebsd.org. > > The situation has changed in 8-STABLE and 9-CURRENT since the above > message was written. The timekeeping code was changed (by the person > who wrote the message that you cited) to periodically (every > machdep.rtc_save_period seconds) adjust the value of the rtc if ntp is > used to update the system time, machdep.disable_rtc_set=0, and the rtc > driver hasn't been disabled: > > http://svnweb.freebsd.org/viewvc/base?view=revision&revision=207360 > http://svnweb.freebsd.org/viewvc/base?view=revision&revision=208297 > > atrtc_{get,set}time, now in /usr/src/sys/x86/isa/atrtc.c, could serve > as a basis for your own code: > > http://svn.freebsd.org/viewvc/base/head/sys/x86/isa/atrtc.c?view=markup > > There are of course *_rtc_{get,set}time variants for other > architectures as well. > > Thanks for that. I'll look at atrtc_gettime.