Commit 9ced0cc2 authored by Bixuan Cui's avatar Bixuan Cui Committed by Yang Yingliang
Browse files

mmap: fix a compiling error for 'MAP_CHECKNODE'



hulk inclusion
category: bugfix
bugzilla: NA
CVE: NA

MAP_CHECKNODE was defined in uapi/asm-generic/mman.h, that was not
automatically included by mm/mmap.c when building on platforms such as
mips, and result in following compiling error:

    mm/mmap.c: In function ‘__do_mmap’:
    mm/mmap.c:1581:14: error: ‘MAP_CHECKNODE’ undeclared (first use in this function)
      if (flags & MAP_CHECKNODE)
                  ^
    mm/mmap.c:1581:14: note: each undeclared identifier is reported only once for each function it appears in
    scripts/Makefile.build:303: recipe for target 'mm/mmap.o' failed

Fixes: cdccf4d4b7b5 ("arm64/ascend: mm: Add MAP_CHECKNODE flag to check node hugetlb")

Signed-off-by: default avatarBixuan Cui <cuibixuan@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarCheng Jian <cj.chengjian@huawei.com>
parent 73ee5302
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define MAP_HUGETLB	0x100000	/* create a huge page mapping */
#define MAP_FIXED_NOREPLACE	0x200000/* MAP_FIXED which doesn't unmap underlying mapping */
#define MAP_PA32BIT	0x400000	/* physical address is within 4G */
#define MAP_CHECKNODE	0x800000	/* hugetlb numa node check */

#define MS_ASYNC	1		/* sync memory asynchronously */
#define MS_SYNC		2		/* synchronous memory sync */
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@
#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
#define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED which doesn't unmap underlying mapping */
#define MAP_PA32BIT	0x400000	/* physical address is within 4G */
#define MAP_CHECKNODE	0x800000	/* hugetlb numa node check */

/*
 * Flags for msync
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
#define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED which doesn't unmap underlying mapping */
#define MAP_PA32BIT	0x400000	/* physical address is within 4G */
#define MAP_CHECKNODE	0x800000	/* hugetlb numa node check */

#define MS_SYNC		1		/* synchronous memory sync */
#define MS_ASYNC	2		/* sync memory asynchronously */
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
#define MAP_PA32BIT	0x400000	/* physical address is within 4G */
#define MAP_CHECKNODE	0x800000	/* hugetlb numa node check */

/* Override any generic PKEY permission defines */
#define PKEY_DISABLE_EXECUTE   0x4
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
#define MAP_PA32BIT	0x400000	/* physical address is within 4G */
#define MAP_CHECKNODE	0x800000	/* hugetlb numa node check */


#endif /* _UAPI__SPARC_MMAN_H__ */
Loading