From 93b60bb81270b50fb9326303286d8d60f0a50510 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Thu, 6 Jun 2024 17:10:13 +0200 Subject: [PATCH] Fix rt_mutex_lock_interruptible() again for RT >= 3.2 --- master/ioctl.c | 3 ++- master/master.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/master/ioctl.c b/master/ioctl.c index 16d0cc0d..9a0e5c1b 100644 --- a/master/ioctl.c +++ b/master/ioctl.c @@ -62,7 +62,8 @@ #else # define ec_ioctl_lock(lock) rt_mutex_lock(lock) # define ec_ioctl_unlock(lock) rt_mutex_unlock(lock) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) || \ + (defined(CONFIG_PREEMPT_RT_FULL) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) # define ec_ioctl_lock_interruptible(lock) \ rt_mutex_lock_interruptible(lock) # else diff --git a/master/master.c b/master/master.c index c24d5bee..77f646f1 100644 --- a/master/master.c +++ b/master/master.c @@ -52,7 +52,8 @@ #include "ethernet.h" #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) || \ + (defined(CONFIG_PREEMPT_RT_FULL) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) # define ec_rt_lock_interruptible(lock) \ rt_mutex_lock_interruptible(lock) #else