diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-02-11 00:24:00 +0100 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-02-11 00:24:00 +0100 |
| commit | b2a3b193b7eb886e44f8a66cd41a26cc44c1e00d (patch) | |
| tree | 8edbfe1daaa8d75214f6017070740d1f4acbafc5 /mm/internal.h | |
| parent | c89f2682a39192433c296bf97b834fd2815a758b (diff) | |
| parent | 6a0712f6f199e737aa5913d28ec4bd3a25de9660 (diff) | |
Merge branch 'pm-opp' into pm-cpufreq
Diffstat (limited to 'mm/internal.h')
| -rw-r--r-- | mm/internal.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mm/internal.h b/mm/internal.h index ed8b5ffcf9b1..a38a21ebddb4 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -216,6 +216,37 @@ static inline bool is_cow_mapping(vm_flags_t flags) return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; } +/* + * These three helpers classifies VMAs for virtual memory accounting. + */ + +/* + * Executable code area - executable, not writable, not stack + */ +static inline bool is_exec_mapping(vm_flags_t flags) +{ + return (flags & (VM_EXEC | VM_WRITE | VM_STACK)) == VM_EXEC; +} + +/* + * Stack area - atomatically grows in one direction + * + * VM_GROWSUP / VM_GROWSDOWN VMAs are always private anonymous: + * do_mmap() forbids all other combinations. + */ +static inline bool is_stack_mapping(vm_flags_t flags) +{ + return (flags & VM_STACK) == VM_STACK; +} + +/* + * Data area - private, writable, not stack + */ +static inline bool is_data_mapping(vm_flags_t flags) +{ + return (flags & (VM_WRITE | VM_SHARED | VM_STACK)) == VM_WRITE; +} + /* mm/util.c */ void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma, struct vm_area_struct *prev, struct rb_node *rb_parent); |
