summaryrefslogtreecommitdiff
path: root/tools/testing/vma/vma_internal.h
blob: 0e1121e2ef23e73a471726e8499666f738c13210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * vma_internal.h
 *
 * Header providing userland wrappers and shims for the functionality provided
 * by mm/vma_internal.h.
 *
 * We make the header guard the same as mm/vma_internal.h, so if this shim
 * header is included, it precludes the inclusion of the kernel one.
 */

#ifndef __MM_VMA_INTERNAL_H
#define __MM_VMA_INTERNAL_H

#include <stdlib.h>

#define CONFIG_MMU
#define CONFIG_PER_VMA_LOCK

#ifdef __CONCAT
#undef __CONCAT
#endif

#include <linux/args.h>
#include <linux/atomic.h>
#include <linux/bitmap.h>
#include <linux/list.h>
#include <linux/maple_tree.h>
#include <linux/mm.h>
#include <linux/rbtree.h>
#include <linux/refcount.h>
#include <linux/slab.h>

/*
 * DUPLICATE typedef definitions from kernel source that have to be declared
 * ahead of all other headers.
 */
#define __private
/* NUM_MM_FLAG_BITS defined by test code. */
typedef struct {
	__private DECLARE_BITMAP(__mm_flags, NUM_MM_FLAG_BITS);
} mm_flags_t;
/* NUM_VMA_FLAG_BITS defined by test code. */
typedef struct {
	DECLARE_BITMAP(__vma_flags, NUM_VMA_FLAG_BITS);
} __private vma_flags_t;

typedef unsigned long vm_flags_t;
#define pgoff_t unsigned long
typedef unsigned long	pgprotval_t;
typedef struct pgprot { pgprotval_t pgprot; } pgprot_t;
typedef __bitwise unsigned int vm_fault_t;

#include "include/stubs.h"
#include "include/dup.h"
#include "include/custom.h"

#endif	/* __MM_VMA_INTERNAL_H */