Commit | Line | Data |
---|---|---|
9f36eaed MJ |
1 | /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) |
2 | * | |
e6b06d7d MD |
3 | * wrapper/percpu-defs.h |
4 | * | |
5 | * wrapper around linux/percpu-defs.h. | |
6 | * | |
7 | * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
e6b06d7d MD |
8 | */ |
9 | ||
9f36eaed MJ |
10 | #ifndef _LTTNG_WRAPPER_PERCPU_DEFS_H |
11 | #define _LTTNG_WRAPPER_PERCPU_DEFS_H | |
12 | ||
e6b06d7d MD |
13 | #include <linux/version.h> |
14 | ||
15 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
16 | ||
17 | #include <linux/percpu-defs.h> | |
18 | ||
19 | #define lttng_this_cpu_ptr(ptr) this_cpu_ptr(ptr) | |
20 | ||
21 | #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ | |
22 | ||
23 | #include <linux/percpu.h> | |
24 | ||
25 | #define lttng_this_cpu_ptr(ptr) (&__get_cpu_var(*(ptr))) | |
26 | ||
27 | #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ | |
28 | ||
29 | #endif /* _LTTNG_WRAPPER_PERCPU_DEFS_H */ |