On Tue, Dec 09, 2014 at 08:06:03PM +0000, Stoidner, Christoph wrote:
>
> Hi Gilles,
>
> >> Well, then you need to replace #ifdef CONFIG_PREEMPT_RT with
> >> CONFIG_PREEMPT_RT_FULL, and test the kernel version in wrappers.h to
> >> define CONFIG_PREEMPT_RT_FULL if CONFIG_PREEMPT_RT is dedined for
> >> old kernels.
>
> >I have applied both changes and try if this solves the my problem. If it
> >works I will publish the patch here.
>
> below you can find the patch. It solves the problem concerning "sleeping
> function called from invalid context" when using PREEMPT RT. Would it be
> reasonable to apply that change to GIT repository?
Yes, of course.
> #ifndef DEFINE_SEMAPHORE
> /* Legacy DECLARE_MUTEX vanished in 2.6.37 */
> #define DEFINE_BINARY_SEMAPHORE(sem) DECLARE_MUTEX(sem)
> -#elif defined(CONFIG_PREEMPT_RT)
> -#define DEFINE_BINARY_SEMAPHORE(sem) DEFINE_SEMAPHORE(sem, 1)
> +#elif defined(CONFIG_PREEMPT_RT_FULL)
> +#define DEFINE_BINARY_SEMAPHORE(sem) DEFINE_SEMAPHORE(sem)
> #else
> #define DEFINE_BINARY_SEMAPHORE(sem) DEFINE_SEMAPHORE(sem)
> #endif
Why that change? I mean in 2.6.37, the define was CONFIG_PREEMPT_RT
anwyay.
--
Gilles.
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai