Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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. */
40typedef struct {
41 __private DECLARE_BITMAP(__mm_flags, NUM_MM_FLAG_BITS);
42} mm_flags_t;
43/* NUM_VMA_FLAG_BITS defined by test code. */
44typedef struct {
45 DECLARE_BITMAP(__vma_flags, NUM_VMA_FLAG_BITS);
46} __private vma_flags_t;
47
48typedef unsigned long vm_flags_t;
49#define pgoff_t unsigned long
50typedef unsigned long pgprotval_t;
51typedef struct pgprot { pgprotval_t pgprot; } pgprot_t;
52typedef __bitwise unsigned int vm_fault_t;
53
54#define VM_WARN_ON(_expr) (WARN_ON(_expr))
55#define VM_WARN_ON_ONCE(_expr) (WARN_ON_ONCE(_expr))
56#define VM_WARN_ON_VMG(_expr, _vmg) (WARN_ON(_expr))
57#define VM_BUG_ON(_expr) (BUG_ON(_expr))
58#define VM_BUG_ON_VMA(_expr, _vma) (BUG_ON(_expr))
59
60#include "include/stubs.h"
61#include "include/dup.h"
62#include "include/custom.h"
63
64#endif /* __MM_VMA_INTERNAL_H */