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 | ||
2d042821 | 13 | #include <lttng-kernel-version.h> |
e6b06d7d | 14 | |
2d042821 | 15 | #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) |
e6b06d7d MD |
16 | |
17 | #include <linux/percpu-defs.h> | |
18 | ||
19 | #define lttng_this_cpu_ptr(ptr) this_cpu_ptr(ptr) | |
20 | ||
2d042821 | 21 | #else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */ |
e6b06d7d MD |
22 | |
23 | #include <linux/percpu.h> | |
24 | ||
25 | #define lttng_this_cpu_ptr(ptr) (&__get_cpu_var(*(ptr))) | |
26 | ||
2d042821 | 27 | #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */ |
e6b06d7d MD |
28 | |
29 | #endif /* _LTTNG_WRAPPER_PERCPU_DEFS_H */ |