page alloc wrapper: Fix get_pfnblock_flags_mask prototype
[lttng-modules.git] / wrapper / cpu.h
CommitLineData
4a6ea683
MJ
1/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
2 *
3 * wrapper/cpu.h
4 *
5 * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
6 */
7
8#ifndef _LTTNG_WRAPPER_CPU_H
9#define _LTTNG_WRAPPER_CPU_H
10
11#include <linux/cpu.h>
12#include <lttng-kernel-version.h>
13
14#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0))
15
16static inline
17void lttng_cpus_read_lock(void)
18{
19 cpus_read_lock();
20}
21
22static inline
23void lttng_cpus_read_unlock(void)
24{
25 cpus_read_unlock();
26}
27
28#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */
29
30static inline
31void lttng_cpus_read_lock(void)
32{
33 get_online_cpus();
34}
35
36static inline
37void lttng_cpus_read_unlock(void)
38{
39 put_online_cpus();
40}
41
42#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */
43
44#endif /* _LTTNG_WRAPPER_CPU_H */
This page took 0.028387 seconds and 4 git commands to generate.