• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * @file compat24.h
3  * Compatability functions for 2.4 kernels
4  *
5  * @remark Copyright 2002 OProfile authors
6  * @remark Read the file COPYING
7  *
8  * @author John Levon
9  * @author Philippe Elie
10  */
11 
12 #ifndef COMPAT24_H
13 #define COMPAT24_H
14 
15 #include <linux/version.h>
16 
op_get_tgid(void)17 static inline pid_t op_get_tgid(void)
18 {
19 	return current->tgid;
20 }
21 
22 #define pte_page_address(a) page_address(pte_page(a))
23 #define oprof_wake_up(w) wake_up(w)
24 #define lock_rtc(f) spin_lock_irqsave(&rtc_lock, f)
25 #define unlock_rtc(f) spin_unlock_irqrestore(&rtc_lock, f)
26 #define wind_dentries(d, v, r, m) wind_dentries_2_4(d, v, r, m)
27 extern uint do_path_hash_2_4(struct dentry * dentry, struct vfsmount * vfsmnt);
28 #define hash_path(f) do_path_hash_2_4((f)->f_dentry, (f)->f_vfsmnt)
29 #define request_region_check request_region
30 #define op_cpu_id() cpu_number_map(smp_processor_id())
31 #define GET_VM_OFFSET(v) ((v)->vm_pgoff << PAGE_SHIFT)
32 #define PTRACE_OFF(t) ((t)->ptrace &= ~PT_DTRACE)
33 #define lock_execve() do { } while (0)
34 #define unlock_execve() do { } while (0)
35 #define lock_out_mmap() do { } while (0)
36 #define unlock_out_mmap() do { } while (0)
37 #define HAVE_MMAP2
38 #define HAVE_FILE_OPERATIONS_OWNER
39 
40 /* ->owner field in 2.4 */
41 #define INC_USE_COUNT_MAYBE
42 #define DEC_USE_COUNT_MAYBE
43 
44 /* no global waitqueue spinlock in 2.4 */
45 #define wq_is_lockable() (1)
46 
47 /* 2.4.3 introduced rw mmap semaphore  */
48 #if V_AT_LEAST(2, 4, 3)
49 	#define lock_mmap(mm) down_read(&mm->mmap_sem)
50 	#define unlock_mmap(mm) up_read(&mm->mmap_sem)
51 #else
52 	#define lock_mmap(mm) down(&mm->mmap_sem)
53 	#define unlock_mmap(mm) up(&mm->mmap_sem)
54 #endif
55 
56 /* 2.4.26 exported the needed stuff for HT support */
57 #if V_AT_LEAST(2, 4, 26) && defined(CONFIG_SMP)
58 #define HT_SUPPORT
59 #endif
60 
61 #endif /* COMPAT24_H */
62