Adjustable wallclock (get/settimeofday, adjtimex)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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?


Before posting, please read the FAQ:
and search the list archive:

[Index of Archives]     [Linux Embedded]     [U-Boot V2]     [Linux Kernel]     [Linux MIPS]     [Linux ARM]     [Linux for the Blind]     [Linux Resources]     [Photo]     [Yosemite]     [ISDN Cause Codes]     [eCos Home]

  Powered by Linux