[REFACTOR] rename sspt_procs* --> sspt_proc*
[kernel/swap-modules.git] / driver / legacy.h
1 ////////////////////////////////////////////////////////////////////////////////////
2 //
3 //      FILE:           legacy.h
4 //
5 //      DESCRIPTION:
6 //
7 //      SEE ALSO:       legacy.c
8 //      AUTHOR:         L.Komkov
9 //      COMPANY NAME:   Samsung Research Center in Moscow
10 //      DEPT NAME:      Advanced Software Group 
11 //      CREATED:        2008.02.15
12 //      VERSION:        1.0
13 //      REVISION DATE:  2008.12.03
14 //
15 ////////////////////////////////////////////////////////////////////////////////////
16
17 /*
18     Support for legacy Linux kernel versions
19 */
20 #if !defined(__LEGACY_H__)
21 #define __LEGACY_H__
22
23 #include <linux/mm.h>
24 #include <linux/version.h>
25
26 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
27 extern signed long schedule_timeout_interruptible (signed long timeout);
28 #endif /* kernel without schedule_timeout_interruptible */
29
30 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
31 extern int remap_vmalloc_range (struct vm_area_struct *vma, void *addr, unsigned long pgoff);
32 #endif /* kernel without remap_vmalloc_range() */
33
34 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
35 extern void *vmalloc_user (unsigned long size);
36 extern void vfree_user (void *address, unsigned long size);
37 #define VFREE_USER(address, size) \
38         { \
39                 if(address != NULL) { \
40                         vfree_user(address, size); \
41                         address = NULL; \
42                 } \
43         }
44 #else
45 #define VFREE_USER(address, size) \
46         { \
47                 if(address != NULL) { \
48                         vfree(address); \
49                         address = NULL; \
50                 } \
51         }
52 #endif /* kernel without vmalloc_user() */
53
54 #endif /* !defined(__LEGACY_H__) */