xref: /linux/tools/testing/vma/vma_internal.h (revision 69050f8d6d075dc01af7a5f2f550a8067510366f)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * vma_internal.h
4  *
5  * Header providing userland wrappers and shims for the functionality provided
6  * by mm/vma_internal.h.
7  *
8  * We make the header guard the same as mm/vma_internal.h, so if this shim
9  * header is included, it precludes the inclusion of the kernel one.
10  */
11 
12 #ifndef __MM_VMA_INTERNAL_H
13 #define __MM_VMA_INTERNAL_H
14 
15 #include <stdlib.h>
16 
17 #define CONFIG_MMU
18 #define CONFIG_PER_VMA_LOCK
19 
20 #ifdef __CONCAT
21 #undef __CONCAT
22 #endif
23 
24 #include <linux/args.h>
25 #include <linux/atomic.h>
26 #include <linux/bitmap.h>
27 #include <linux/list.h>
28 #include <linux/maple_tree.h>
29 #include <linux/mm.h>
30 #include <linux/rbtree.h>
31 #include <linux/refcount.h>
32 #include <linux/slab.h>
33 
34 /*
35  * DUPLICATE typedef definitions from kernel source that have to be declared
36  * ahead of all other headers.
37  */
38 #define __private
39 /* NUM_MM_FLAG_BITS defined by test code. */
40 typedef struct {
41 	__private DECLARE_BITMAP(__mm_flags, NUM_MM_FLAG_BITS);
42 } mm_flags_t;
43 /* NUM_VMA_FLAG_BITS defined by test code. */
44 typedef struct {
45 	DECLARE_BITMAP(__vma_flags, NUM_VMA_FLAG_BITS);
46 } __private vma_flags_t;
47 
48 typedef unsigned long vm_flags_t;
49 #define pgoff_t unsigned long
50 typedef unsigned long	pgprotval_t;
51 typedef struct pgprot { pgprotval_t pgprot; } pgprot_t;
52 typedef __bitwise unsigned int vm_fault_t;
53 
54 #include "include/stubs.h"
55 #include "include/dup.h"
56 #include "include/custom.h"
57 
58 #endif	/* __MM_VMA_INTERNAL_H */
59