Provides backporting of qib driver for RHEL 6.5
[compat-rdma/compat.git] / include / linux / percpu.h
1 #ifndef _COMPAT_LINUX_PERCPU_H
2 #define _COMPAT_LINUX_PERCPU_H 1
3
4 #include <linux/version.h>
5
6 #include_next <linux/percpu.h>
7
8 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
9
10 #ifndef this_cpu_inc
11 #define this_cpu_inc(pcp)                       \
12 do {                                            \
13         unsigned long flags;                    \
14         raw_local_irq_save(flags);              \
15         *this_cpu_ptr(&(pcp)) += 1;         \
16         raw_local_irq_restore(flags);           \
17 } while (0)
18 #endif /* this_cpu_inc */
19 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
20
21 #endif  /* _COMPAT_LINUX_PERCPU_H */