2459f55b3bf9abcc7f5ba840d847eb9720ddc979
[cascardo/ovs.git] / datapath / linux / compat / include / linux / percpu.h
1 #ifndef __LINUX_PERCPU_WRAPPER_H
2 #define __LINUX_PERCPU_WRAPPER_H 1
3
4 #include_next <linux/percpu.h>
5
6 #if !defined this_cpu_ptr
7 #define this_cpu_ptr(ptr) per_cpu_ptr(ptr, smp_processor_id())
8 #endif
9
10 #ifdef HAVE_RHEL6_PER_CPU
11 #undef this_cpu_read
12 #undef this_cpu_inc
13 #undef this_cpu_dec
14 #endif
15
16 #if !defined this_cpu_read
17 #define this_cpu_read(ptr) percpu_read(ptr)
18 #endif
19
20 #if !defined this_cpu_inc
21 #define this_cpu_inc(ptr) percpu_add(ptr, 1)
22 #endif
23
24 #if !defined this_cpu_dec
25 #define this_cpu_dec(ptr) percpu_sub(ptr, 1)
26 #endif
27
28 #endif