]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/kthread.c
Do not attempt to include removed devfs_fs_kernel.h file for 2.6.18+ kernel.
[lincan.git] / lincan / src / kthread.c
index d2531b961e6325785297f7fa26f0c6f373255518..4e574a9e9c42af9f2d3cebd94490f00792ef785c 100644 (file)
@@ -10,7 +10,9 @@
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,40))
   #include <linux/tqueue.h>
 #else
-  #include <linux/devfs_fs_kernel.h>
+  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17))
+    #include <linux/devfs_fs_kernel.h>
+  #endif
 #endif
 
 #include <linux/wait.h>
@@ -47,7 +49,7 @@ void start_kthread(void (*func)(kthread_t *), kthread_t *kthread)
        in the down operation below until the thread has reached
        the up() operation.
     */
-    init_MUTEX_LOCKED(&kthread->startstop_sem);
+    sema_init(&kthread->startstop_sem, 0);
 
     /* store the function to be executed in the data passed to
        the launcher */
@@ -96,7 +98,7 @@ void stop_kthread(kthread_t *kthread)
        will unlock it. As soon as we see the semaphore
        unlocked, we know that the thread has exited.
     */
-    init_MUTEX_LOCKED(&kthread->startstop_sem);
+    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.