From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Cc: "Markus Osterried (BA/EDD)" <markus.osterried@domain.hid>,
Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Subject: [Xenomai-core] [PATCH 1/2] Introduce xntbase_ns2ticks_ceil
Date: Thu, 30 Aug 2007 09:11:33 +0200 [thread overview]
Message-ID: <46D66DA5.9030100@domain.hid> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 281 bytes --]
This introduces a round-up-variant of xntbase_ns2ticks. It is uninlined
for the non-trivial case due to its text size. Its only user will be
RTDM for now, but maybe the POSIX skin can use it as well.
Philippe, if you accept this one, I'll handle the RTDM side myself.
Jan
[-- Attachment #1.2: xntbase_ns2ticks_ceil.patch --]
[-- Type: text/plain, Size: 1668 bytes --]
---
include/nucleus/timebase.h | 7 +++++++
ksrc/nucleus/timebase.c | 7 +++++++
2 files changed, 14 insertions(+)
Index: xenomai/include/nucleus/timebase.h
===================================================================
--- xenomai.orig/include/nucleus/timebase.h
+++ xenomai/include/nucleus/timebase.h
@@ -148,6 +148,8 @@ static inline xnticks_t xntbase_ns2ticks
return xnarch_ulldiv(t, xntbase_get_tickval(base), NULL);
}
+xnticks_t xntbase_ns2ticks_ceil(xntbase_t *base, xntime_t t);
+
static inline int xntbase_master_p(xntbase_t *base)
{
return base == &nktbase;
@@ -247,6 +249,11 @@ static inline xnticks_t xntbase_ns2ticks
return t;
}
+static inline xnticks_t xntbase_ns2ticks_ceil(xntbase_t *base, xntime_t t)
+{
+ return t;
+}
+
static inline int xntbase_master_p(xntbase_t *base)
{
return 1;
Index: xenomai/ksrc/nucleus/timebase.c
===================================================================
--- xenomai.orig/ksrc/nucleus/timebase.c
+++ xenomai/ksrc/nucleus/timebase.c
@@ -483,6 +483,12 @@ void xntbase_tick(xntbase_t *base)
xnlock_put_irqrestore(&nklock, s);
}
+xnticks_t xntbase_ns2ticks_ceil(xntbase_t *base, xntime_t t)
+{
+ return xnarch_ulldiv(t + xntbase_get_tickval(base) - 1,
+ xntbase_get_tickval(base), NULL);
+}
+
EXPORT_SYMBOL(xntbase_alloc);
EXPORT_SYMBOL(xntbase_free);
EXPORT_SYMBOL(xntbase_update);
@@ -490,6 +496,7 @@ EXPORT_SYMBOL(xntbase_switch);
EXPORT_SYMBOL(xntbase_start);
EXPORT_SYMBOL(xntbase_stop);
EXPORT_SYMBOL(xntbase_tick);
+EXPORT_SYMBOL(xntbase_ns2ticks_ceil);
#endif /* CONFIG_XENO_OPT_TIMING_PERIODIC */
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next reply other threads:[~2007-08-30 7:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-30 7:11 Jan Kiszka [this message]
2007-09-07 7:22 ` [Xenomai-core] [PATCH 1/2] Introduce xntbase_ns2ticks_ceil Philippe Gerum
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=46D66DA5.9030100@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=markus.osterried@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.