]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/kthread.c
LinCAN partial update of thread helper support for 2.6.27+ kernels.
[lincan.git] / lincan / src / kthread.c
index e8e94c47185a3f4bc6a85a64e01edc05fd8b618d..ae43c306384a88f8878fda263d3c9f515449f6e0 100644 (file)
 #include <linux/signal.h>
 #include <linux/interrupt.h>
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
+  #include <asm/semaphore.h>
+#else
+  #include <linux/semaphore.h>
+#endif
 
-#include <asm/semaphore.h>
 #include <linux/smp_lock.h>
 
 #include "../include/kthread.h"
@@ -103,7 +107,7 @@ void stop_kthread(kthread_t *kthread)
     sema_init(&kthread->startstop_sem,0);
 
     /* We need to do a memory barrier here to be sure that
-       the flags are visible on all CPUs. 
+       the flags are visible on all CPUs.
     */
     mb();
 
@@ -111,7 +115,7 @@ void stop_kthread(kthread_t *kthread)
     kthread->terminate = 1;
 
     /* We need to do a memory barrier here to be sure that
-       the flags are visible on all CPUs. 
+       the flags are visible on all CPUs.
     */
     mb();
     kill_proc(kthread->thread->pid, SIGKILL, 1);