Commit b3fbbea4 authored by Kevin Brodsky's avatar Kevin Brodsky Committed by Catalin Marinas

mm: Introduce arch_calc_vm_flag_bits()

Similarly to arch_calc_vm_prot_bits(), introduce a dummy
arch_calc_vm_flag_bits() invoked from calc_vm_flag_bits(). This macro
can be overridden by architectures to insert specific VM_* flags derived
from the mmap() MAP_* flags.
Signed-off-by: default avatarKevin Brodsky <Kevin.Brodsky@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
parent 4d1a8a2d
...@@ -78,13 +78,18 @@ static inline void vm_unacct_memory(long pages) ...@@ -78,13 +78,18 @@ static inline void vm_unacct_memory(long pages)
} }
/* /*
* Allow architectures to handle additional protection bits * Allow architectures to handle additional protection and flag bits. The
* overriding macros must be defined in the arch-specific asm/mman.h file.
*/ */
#ifndef arch_calc_vm_prot_bits #ifndef arch_calc_vm_prot_bits
#define arch_calc_vm_prot_bits(prot, pkey) 0 #define arch_calc_vm_prot_bits(prot, pkey) 0
#endif #endif
#ifndef arch_calc_vm_flag_bits
#define arch_calc_vm_flag_bits(flags) 0
#endif
#ifndef arch_vm_get_page_prot #ifndef arch_vm_get_page_prot
#define arch_vm_get_page_prot(vm_flags) __pgprot(0) #define arch_vm_get_page_prot(vm_flags) __pgprot(0)
#endif #endif
...@@ -135,7 +140,8 @@ calc_vm_flag_bits(unsigned long flags) ...@@ -135,7 +140,8 @@ calc_vm_flag_bits(unsigned long flags)
return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) |
_calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) |
_calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ) | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ) |
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC ); _calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) |
arch_calc_vm_flag_bits(flags);
} }
unsigned long vm_commit_limit(void); unsigned long vm_commit_limit(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment