From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16499 invoked by alias); 27 Jun 2011 08:17:22 -0000 Received: (qmail 16488 invoked by uid 22791); 27 Jun 2011 08:17:19 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_05,SARE_HELO_EQ_CUST,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Jun 2011 08:17:04 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qb709-0006sz-V4 for ecos-discuss@sources.redhat.com; Mon, 27 Jun 2011 10:17:01 +0200 Received: from 62-20-102-34.customer.telia.com ([62.20.102.34]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jun 2011 10:17:01 +0200 Received: from daniel.neri by 62-20-102-34.customer.telia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jun 2011 10:17:01 +0200 To: ecos-discuss@sources.redhat.com From: daniel.neri@sigicom.com (Daniel =?utf-8?Q?N=C3=A9ri?=) Date: Mon, 27 Jun 2011 08:17:00 -0000 Message-ID: <87mxh3pu31.fsf@quadra.hq.sigicom.net> References: <4E07AFED.6040405@meduna.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: Adjustable wallclock (get/settimeofday, adjtimex)? X-SW-Source: 2011-06/txt/msg00068.txt.bz2 Hello, Stanislav Meduna writes: > I need to implement a NTP-like model soon, which means: > > - gettimeofday with best possible resolution and negligible > call delay > - settimeofday > - the ability to speed up or slow the clock (adjtime/adjtimex > or similar), both permanently or until the requested offset > is compensated for; the clock must not go backward I've described my approach in an older thread on this list: http://thread.gmane.org/gmane.os.ecos.general/25842/ I never bothered with sub-second resolution for setting time (settimeofday), so I just use cyg_libc_time_settime. > - the ability to initialize from / store the current time to > a battery-backed device I've used a hybrid between the emulated wallclock and a "real" wallclock device driver -- it only reads absolute time from the h/w via Cyg_WallClock::init_hw_seconds and writes via Cyg_WallClock::set_hw_seconds. Otherwise, it works like the emulated wallclock driver. Best regards, Daniel -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss