Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-27 Thread Jan Kiszka
On 2011-06-24 21:58, Gilles Chanteperdrix wrote: On 06/23/2011 01:36 PM, Jan Kiszka wrote: On 2011-06-23 13:29, Gilles Chanteperdrix wrote: On 06/23/2011 11:09 AM, Jan Kiszka wrote: On 2011-06-23 11:05, Gilles Chanteperdrix wrote: On 06/23/2011 09:38 AM, Jan Kiszka wrote: +#ifdef

Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-27 Thread Gilles Chanteperdrix
On 06/27/2011 08:32 AM, Jan Kiszka wrote: On 2011-06-24 21:58, Gilles Chanteperdrix wrote: On 06/23/2011 01:36 PM, Jan Kiszka wrote: On 2011-06-23 13:29, Gilles Chanteperdrix wrote: On 06/23/2011 11:09 AM, Jan Kiszka wrote: On 2011-06-23 11:05, Gilles Chanteperdrix wrote: On 06/23/2011 09:38

Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-24 Thread Gilles Chanteperdrix
On 06/23/2011 01:36 PM, Jan Kiszka wrote: On 2011-06-23 13:29, Gilles Chanteperdrix wrote: On 06/23/2011 11:09 AM, Jan Kiszka wrote: On 2011-06-23 11:05, Gilles Chanteperdrix wrote: On 06/23/2011 09:38 AM, Jan Kiszka wrote: +#ifdef CONFIG_XENO_FASTSYNCH +if (xeno_get_current() !=

Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-23 Thread Jan Kiszka
On 2011-06-22 23:55, Gilles Chanteperdrix wrote: Hi, I would like to better integrate rtdk and the posix skin by forcibly wrapping the calls to malloc/free and also wrap printf to call rt_printf. However, currently, rt_printf can not really be used as a drop-in replacement of

Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-23 Thread Gilles Chanteperdrix
On 06/23/2011 09:38 AM, Jan Kiszka wrote: +#ifdef CONFIG_XENO_FASTSYNCH +if (xeno_get_current() != XN_NO_HANDLE +!(xeno_get_current_mode() XNRELAX) buf_pool_get()) { +struct print_buffer *old; + +old = buf_pool_get(); +while (old != buffer)

Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-23 Thread Jan Kiszka
On 2011-06-23 11:05, Gilles Chanteperdrix wrote: On 06/23/2011 09:38 AM, Jan Kiszka wrote: +#ifdef CONFIG_XENO_FASTSYNCH + if (xeno_get_current() != XN_NO_HANDLE + !(xeno_get_current_mode() XNRELAX) buf_pool_get()) { + struct print_buffer *old; + + old =

Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-23 Thread Gilles Chanteperdrix
On 06/23/2011 11:09 AM, Jan Kiszka wrote: On 2011-06-23 11:05, Gilles Chanteperdrix wrote: On 06/23/2011 09:38 AM, Jan Kiszka wrote: +#ifdef CONFIG_XENO_FASTSYNCH + if (xeno_get_current() != XN_NO_HANDLE + !(xeno_get_current_mode() XNRELAX) buf_pool_get()) { + struct

Re: [Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-23 Thread Gilles Chanteperdrix
On 06/23/2011 01:36 PM, Jan Kiszka wrote: On 2011-06-23 13:29, Gilles Chanteperdrix wrote: On 06/23/2011 11:09 AM, Jan Kiszka wrote: On 2011-06-23 11:05, Gilles Chanteperdrix wrote: On 06/23/2011 09:38 AM, Jan Kiszka wrote: +#ifdef CONFIG_XENO_FASTSYNCH +if (xeno_get_current() !=

[Xenomai-core] RFC: use a pool of pre-allocated buffers in rt_printf

2011-06-22 Thread Gilles Chanteperdrix
Hi, I would like to better integrate rtdk and the posix skin by forcibly wrapping the calls to malloc/free and also wrap printf to call rt_printf. However, currently, rt_printf can not really be used as a drop-in replacement of printf: - it is necessary to call rt_printf_auto_init, we can do