From: Wolfgang Mauerer <wolfgang.mauerer@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: "Kiszka, Jan" <jan.kiszka@domain.hid>,
"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH 5/7] posix: Support reading the host realtime clock in realtime context
Date: Sat, 03 Jul 2010 21:21:51 +0200 [thread overview]
Message-ID: <4C2F8DCF.2050903@domain.hid> (raw)
In-Reply-To: <4C2F273C.8060201@domain.hid>
Gilles Chanteperdrix wrote:
> Wolfgang Mauerer wrote:
>> Wall time management is typically assisted by the NTP
>> protocol in the Linux context, but this information is
>> not propagated to Xenomai. This patch adds support
>> for a CLOCK_HOST_REALTIME clock id that is coupled to the
>> host operating system's realtime clock. The required
>> information from the Kernel into Xenomai. The data exchange
>> is designed to allow for lockless reading from userland.
>>
>> Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@domain.hid>
>> Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
>> ---
>> include/posix/time.h | 2 +
>> ksrc/skins/posix/clock.c | 90 +++++++++++++++++++++++++++++++++++++++++++++-
>> 2 files changed, 91 insertions(+), 1 deletions(-)
>>
>> diff --git a/include/posix/time.h b/include/posix/time.h
>> index 4f2d760..938feb6 100644
>> --- a/include/posix/time.h
>> +++ b/include/posix/time.h
>> @@ -50,6 +50,8 @@
>> #define CLOCK_MONOTONIC 1
>> #endif /* CLOCK_MONOTONIC */
>>
>> +#define CLOCK_HOST_REALTIME 16
>> +
>> #if defined(__KERNEL__) || defined(__XENO_SIM__)
>>
>> struct sigevent;
>> diff --git a/ksrc/skins/posix/clock.c b/ksrc/skins/posix/clock.c
>> index 553e123..f5a789b 100644
>> --- a/ksrc/skins/posix/clock.c
>> +++ b/ksrc/skins/posix/clock.c
>> @@ -50,6 +50,13 @@
>> *@{*/
>>
>> #include <posix/thread.h>
>> +#include <linux/ipipe_tickdev.h>
>> +#include <linux/math64.h>
>
> Do we really need this? Because we probably do not have it in 2.4
> kernels. Besides, we do not include linux/ headers in Xenomai code.
>
right, math64.h should be xenomai/asm-generic/arith.h for
xnarch_divrem_billion(). ipipe_tickdev.h is superfluous since
all definitions go through xnarch and rthal.
>> +static int do_clock_host_realtime(struct timespec *tp)
>> +{
>> +#ifdef CONFIG_XENO_OPT_HOSTRT
>> (...)
>> + return 0;
>> +#else /* CONFIG_XENO_OPT_HOSTRT */
>> + return -1;
>
> return -EINVAL;
>
>> + case CLOCK_HOST_REALTIME:
>> + if (do_clock_host_realtime(tp) != 0) {
> rc = do_clock_host_realtime(tp);
> if (rc < 0) {
> thread_set_errno(-rc);
> return -1;
> }
>
>
next prev parent reply other threads:[~2010-07-03 19:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-02 11:49 [Xenomai-core] [PATCH 0/7] Host realtime clock support Wolfgang Mauerer
2010-07-02 11:49 ` [Xenomai-core] [PATCH 1/7] nucleus: Spelling fix for check-vdso.c Wolfgang Mauerer
2010-07-02 11:49 ` [Xenomai-core] [PATCH 2/7] nucleus: Sanity check for vdso.h Wolfgang Mauerer
2010-07-02 11:49 ` [Xenomai-core] [PATCH 3/7] nucleus: Add userland cpu_relax() definition for x86 Wolfgang Mauerer
2010-07-02 11:49 ` [Xenomai-core] [PATCH 4/7] nucleus: Add CLOCK_HOST_REALTIME bits to nkvdso Wolfgang Mauerer
2010-07-03 11:57 ` Gilles Chanteperdrix
2010-07-03 19:31 ` Wolfgang Mauerer
2010-07-03 19:52 ` Gilles Chanteperdrix
2010-07-03 20:25 ` Wolfgang Mauerer
2010-07-02 11:49 ` [Xenomai-core] [PATCH 5/7] posix: Support reading the host realtime clock in realtime context Wolfgang Mauerer
2010-07-03 12:04 ` Gilles Chanteperdrix
2010-07-03 19:21 ` Wolfgang Mauerer [this message]
2010-07-02 11:49 ` [Xenomai-core] [PATCH 6/7] posix: Userspace hostrt reading without switching to kernel mode Wolfgang Mauerer
2010-07-03 12:06 ` Gilles Chanteperdrix
2010-07-02 11:49 ` [Xenomai-core] [PATCH 7/7] posix: Add some example code for CLOCK_HOST_REALTIME Wolfgang Mauerer
2010-07-02 14:21 ` Jan Kiszka
2010-07-02 14:26 ` Gilles Chanteperdrix
2010-07-02 14:34 ` Wolfgang Mauerer
2010-07-02 14:35 ` Gilles Chanteperdrix
2010-07-02 14:39 ` Jan Kiszka
2010-07-02 14:31 ` [Xenomai-core] [PATCH (7+1)/7] " Wolfgang Mauerer
2010-07-02 13:52 ` [Xenomai-core] [PATCH 0/7] Host realtime clock support Gilles Chanteperdrix
2010-07-02 14:59 ` Wolfgang Mauerer
2010-07-02 15:07 ` Gilles Chanteperdrix
2010-07-02 15:20 ` Jan Kiszka
2010-07-03 18:46 ` Wolfgang Mauerer
2010-07-03 16:56 ` Gilles Chanteperdrix
2010-07-03 19:29 ` Wolfgang Mauerer
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=4C2F8DCF.2050903@domain.hid \
--to=wolfgang.mauerer@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=jan.kiszka@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.