Lines 48-54
Link Here
|
48 |
#include <linux/delay.h> |
48 |
#include <linux/delay.h> |
49 |
#include <linux/vmalloc.h> |
49 |
#include <linux/vmalloc.h> |
50 |
#include <linux/slab.h> |
50 |
#include <linux/slab.h> |
|
|
51 |
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) |
51 |
#include <linux/smp_lock.h> |
52 |
#include <linux/smp_lock.h> |
|
|
53 |
#endif |
52 |
#include <linux/file.h> |
54 |
#include <linux/file.h> |
53 |
#include <linux/kmod.h> |
55 |
#include <linux/kmod.h> |
54 |
|
56 |
|
Lines 284-290
Link Here
|
284 |
|
286 |
|
285 |
/********************************************************************/ |
287 |
/********************************************************************/ |
286 |
|
288 |
|
|
|
289 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) |
290 |
static DEFINE_SEMAPHORE(current_sem); |
291 |
static DEFINE_SPINLOCK(atomic_lock); |
292 |
#else |
287 |
static spinlock_t atomic_lock __attribute__((unused)) = SPIN_LOCK_UNLOCKED; |
293 |
static spinlock_t atomic_lock __attribute__((unused)) = SPIN_LOCK_UNLOCKED; |
|
|
294 |
#endif |
288 |
|
295 |
|
289 |
/**************************************************************************************** |
296 |
/**************************************************************************************** |
290 |
The OsAtomicCompareAndSwap function compares the value at the specified address with |
297 |
The OsAtomicCompareAndSwap function compares the value at the specified address with |
Lines 465-471
Link Here
|
465 |
#endif |
472 |
#endif |
466 |
#endif |
473 |
#endif |
467 |
|
474 |
|
|
|
475 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) |
476 |
down(¤t_sem); |
477 |
#else |
468 |
lock_kernel(); |
478 |
lock_kernel(); |
|
|
479 |
#endif |
469 |
|
480 |
|
470 |
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ) |
481 |
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ) |
471 |
exit_mm(current); |
482 |
exit_mm(current); |
Lines 499-505
Link Here
|
499 |
#endif |
510 |
#endif |
500 |
} |
511 |
} |
501 |
|
512 |
|
|
|
513 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) |
514 |
up(¤t_sem); |
515 |
#else |
502 |
unlock_kernel(); |
516 |
unlock_kernel(); |
|
|
517 |
#endif |
503 |
|
518 |
|
504 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) ) |
519 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) ) |
505 |
flush_signals(current); /* must be called without spinlock */ |
520 |
flush_signals(current); /* must be called without spinlock */ |