5e84b5c0e6b39f68324170d66ce4d4f6efd2f49e
[lttng-modules.git] / wrapper / page_alloc.h
1 #ifndef _LTTNG_WRAPPER_PAGE_ALLOC_H
2 #define _LTTNG_WRAPPER_PAGE_ALLOC_H
3
4 /*
5 * wrapper/page_alloc.h
6 *
7 * wrapper around get_pfnblock_flags_mask. Using KALLSYMS to get its address
8 * when available, else we need to have a kernel that exports this function to
9 * GPL modules.
10 *
11 * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; only
16 * version 2.1 of the License.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27
28 #include "../lttng-kernel-version.h"
29
30 /*
31 * We need to redefine get_pfnblock_flags_mask to our wrapper, because
32 * the get_pageblock_migratetype() macro uses it.
33 */
34 #if (defined(CONFIG_KALLSYMS) \
35 && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \
36 || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0)))
37
38 #define get_pfnblock_flags_mask wrapper_get_pfnblock_flags_mask
39
40 #include <linux/mm_types.h>
41
42 int wrapper_get_pfnblock_flags_mask_init(void);
43
44 #else /* #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)) */
45
46 #include <linux/mm_types.h>
47
48 static inline
49 int wrapper_get_pfnblock_flags_mask_init(void)
50 {
51 return 0;
52 }
53
54 #endif /* else #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)) */
55
56 #endif /* _LTTNG_WRAPPER_PAGE_ALLOC_H */
This page took 0.043843 seconds and 3 git commands to generate.