All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH 1/2] Introduce xntbase_ns2ticks_ceil
@ 2007-08-30  7:11 Jan Kiszka
  2007-09-07  7:22 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2007-08-30  7:11 UTC (permalink / raw)
  To: xenomai-core; +Cc: Markus Osterried (BA/EDD), Gilles Chanteperdrix


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai-core] [PATCH 1/2] Introduce xntbase_ns2ticks_ceil
  2007-08-30  7:11 [Xenomai-core] [PATCH 1/2] Introduce xntbase_ns2ticks_ceil Jan Kiszka
@ 2007-09-07  7:22 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2007-09-07  7:22 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Markus Osterried (BA/EDD), xenomai-core, Gilles Chanteperdrix

On Thu, 2007-08-30 at 09:11 +0200, Jan Kiszka wrote:
> 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.
> 

Merged, thanks.

> Jan
> plain text document attachment (xntbase_ns2ticks_ceil.patch)
> ---
>  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 */
>  
-- 
Philippe.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-07  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30  7:11 [Xenomai-core] [PATCH 1/2] Introduce xntbase_ns2ticks_ceil Jan Kiszka
2007-09-07  7:22 ` Philippe Gerum

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.