All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Theo Veenker <Theo.Veenker@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] clock drift
Date: Thu, 02 Oct 2008 10:23:29 +0200	[thread overview]
Message-ID: <48E48501.4050005@domain.hid> (raw)
In-Reply-To: <48E47C34.5070908@domain.hid>

Theo Veenker wrote:
> May ask a (probably silly) question. Does clock_get/settime(clock_id) in
> /usr/include/time.h and in .../xenomai/include/posix/time.h refer to exactly
> the same clock? Or do these interfaces just refer to similar clocks.

The timing subsystems of Xenomai and Linux are different, so they refer
to similar clocks.

Xenomai's implementation of clock_gettime(CLOCK_MONOTONIC) reads the tsc
(which does not need a syscall on most architectures) and converts it to
a struct timespec, whereas the implementation of
clock_gettime(CLOCK_REALTIME) issues a syscall which reads the tsc, adds
an offset, and convert it to a struct timespec.
clock_settime(CLOCK_REALTIME) adjusts the offset used by
clock_gettime(CLOCK_REALTIME) and runs some timers.

-- 
                                                 Gilles.


  reply	other threads:[~2008-10-02  8:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02  5:30 [Xenomai-help] clock drift Rob Wheeler
2008-10-02  5:38 ` Gilles Chanteperdrix
     [not found]   ` <894886ec0810012258o67da00d7x2e3d54c7e601b470@domain.hid>
2008-10-02  6:05     ` Gilles Chanteperdrix
2008-10-02  7:45       ` Theo Veenker
2008-10-02  8:23         ` Gilles Chanteperdrix [this message]
2009-01-14 21:26 ` Gilles Chanteperdrix

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=48E48501.4050005@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Theo.Veenker@domain.hid \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.