public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Stanislav Meduna <stano@meduna.org>
To: eCos Discussion <ecos-discuss@ecos.sourceware.org>
Subject: [ECOS] Adjustable wallclock (get/settimeofday, adjtimex)?
Date: Sun, 26 Jun 2011 22:17:00 -0000	[thread overview]
Message-ID: <4E07AFED.6040405@meduna.org> (raw)

Hi,

the gettimeofday method in compat/posix is currently implemented
based on cyg_current_time(), settimeofday is missing.

If I understand it correctly the cyg_current_time() is also
used for timeout processing all over the code so messing
with its base is not a good idea.

There is also an io/wallclock, but this provides only a 1-second
resolution and warns of up to one second delay when reading/writing.


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
- the ability to initialize from / store the current time to
  a battery-backed device


What is the best way to approach it? Should I modify the
Cyg_RealTimeClock? Should I attach an alarm there on each tick
and do my stuff there? How to make gettimeofday use the 'new'
clock so it does not look like an ugly hack?

Anyone already approached this?

Thanks
-- 
                                   Stano

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

             reply	other threads:[~2011-06-26 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-26 22:17 Stanislav Meduna [this message]
2011-06-27  8:17 ` [ECOS] " Daniel Néri
2011-06-27 14:17 ` Grant Edwards
2011-06-27 14:48   ` Stanislav Meduna
2011-06-27 15:14     ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E07AFED.6040405@meduna.org \
    --to=stano@meduna.org \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).