From ce3b4aaafa69fae11fc408e7be068494fbfe3753 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 14 Nov 2013 22:48:30 +0400 Subject: [PATCH] headers: Move MADV definitions to own mman.h Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- arch/arm/include/asm/types.h | 16 ---------------- arch/x86/include/asm/types.h | 16 ---------------- include/mman.h | 17 +++++++++++++++++ proc_parse.c | 1 + 4 files changed, 18 insertions(+), 32 deletions(-) create mode 100644 include/mman.h diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index b45869224..27da17341 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -104,22 +104,6 @@ struct user_vfp_exc { # define PAGE_MASK (~(PAGE_SIZE - 1)) #endif -#ifndef MAP_HUGETLB -# define MAP_HUGETLB 0x40000 -#endif - -#ifndef MADV_HUGEPAGE -# define MADV_HUGEPAGE 14 -#endif - -#ifndef MADV_NOHUGEPAGE -# define MADV_NOHUGEPAGE 15 -#endif - -#ifndef MADV_DONTDUMP -# define MADV_DONTDUMP 16 -#endif - #define REG_RES(regs) ((regs).ARM_r0) #define REG_IP(regs) ((regs).ARM_pc) #define REG_SYSCALL_NR(regs) ((regs).ARM_r7) diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index 66b843f41..965122eed 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -119,22 +119,6 @@ typedef struct { # define PAGE_MASK (~(PAGE_SIZE - 1)) #endif -#ifndef MAP_HUGETLB -# define MAP_HUGETLB 0x40000 -#endif - -#ifndef MADV_HUGEPAGE -# define MADV_HUGEPAGE 14 -#endif - -#ifndef MADV_NOHUGEPAGE -# define MADV_NOHUGEPAGE 15 -#endif - -#ifndef MADV_DONTDUMP -# define MADV_DONTDUMP 16 -#endif - #define TASK_SIZE ((1UL << 47) - PAGE_SIZE) typedef uint64_t auxv_t; diff --git a/include/mman.h b/include/mman.h new file mode 100644 index 000000000..340d36927 --- /dev/null +++ b/include/mman.h @@ -0,0 +1,17 @@ +#ifndef __CR_MMAN_H__ +#define __CR_MMAN_H__ + +#ifndef MAP_HUGETLB +# define MAP_HUGETLB 0x40000 +#endif +#ifndef MADV_HUGEPAGE +# define MADV_HUGEPAGE 14 +#endif +#ifndef MADV_NOHUGEPAGE +# define MADV_NOHUGEPAGE 15 +#endif +#ifndef MADV_DONTDUMP +# define MADV_DONTDUMP 16 +#endif + +#endif /* __CR_MMAN_H__ */ diff --git a/proc_parse.c b/proc_parse.c index fee4bf916..d38d90e48 100644 --- a/proc_parse.c +++ b/proc_parse.c @@ -13,6 +13,7 @@ #include "list.h" #include "util.h" #include "mount.h" +#include "mman.h" #include "cpu.h" #include "file-lock.h" #include "pstree.h"