--- src/driver.c.orig 2008-01-27 05:38:50.000000000 +0100 +++ src/driver.c 2008-01-27 05:38:50.000000000 +0100 @@ -116,7 +116,10 @@ static DECLARE_WAIT_QUEUE_HEAD(capi_wait); static DECLARE_WAIT_QUEUE_HEAD(dbg_wait); +static DECLARE_COMPLETION(thread_sync); /* New DECLARE, */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) static DECLARE_MUTEX_LOCKED(thread_sync); +#endif #define SCHED_WAKEUP_CAPI { atomic_set (&thread_capi_flag, 1); wake_up_interruptible (&capi_wait); } #define SCHED_WAKEUP { atomic_set (&got_kicked, 1); wake_up_interruptible (&wait); } @@ -1405,7 +1409,10 @@ } } LOG("Scheduler thread stopped.\n"); + complete(&thread_sync); /* Complete Thread Sync here */ + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) up (&thread_sync); + #endif return 0; } /* sched_thread */ @@ -1439,7 +1448,10 @@ SCHED_WAKEUP; } LOG("Thread signalled, waiting for termination...\n"); + wait_for_completion(&thread_sync); /* Wait for complete Thread Sync */ + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) down (&thread_sync); + #endif LOG("Thread[%d] terminated.\n", thread_pid); } thread_pid = -1; --- src/common.h.orig 2005-07-07 00:00:00.000000000 +0200 +++ src/common.h 2008-01-27 05:38:50.000000000 +0100 @@ -44,7 +44,9 @@ /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ typedef long intptr_t; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) typedef unsigned long uintptr_t; +#endif /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/