aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 709f6728fc90..7687228dd3b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -78,7 +78,11 @@ extern unsigned int kobjsize(const void *objp);
78#define VM_MAYSHARE 0x00000080 78#define VM_MAYSHARE 0x00000080
79 79
80#define VM_GROWSDOWN 0x00000100 /* general info on the segment */ 80#define VM_GROWSDOWN 0x00000100 /* general info on the segment */
81#if defined(CONFIG_STACK_GROWSUP) || defined(CONFIG_IA64)
81#define VM_GROWSUP 0x00000200 82#define VM_GROWSUP 0x00000200
83#else
84#define VM_GROWSUP 0x00000000
85#endif
82#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ 86#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */
83#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ 87#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */
84 88
@@ -860,6 +864,12 @@ int set_page_dirty(struct page *page);
860int set_page_dirty_lock(struct page *page); 864int set_page_dirty_lock(struct page *page);
861int clear_page_dirty_for_io(struct page *page); 865int clear_page_dirty_for_io(struct page *page);
862 866
867/* Is the vma a continuation of the stack vma above it? */
868static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
869{
870 return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
871}
872
863extern unsigned long move_page_tables(struct vm_area_struct *vma, 873extern unsigned long move_page_tables(struct vm_area_struct *vma,
864 unsigned long old_addr, struct vm_area_struct *new_vma, 874 unsigned long old_addr, struct vm_area_struct *new_vma,
865 unsigned long new_addr, unsigned long len); 875 unsigned long new_addr, unsigned long len);
@@ -1165,6 +1175,8 @@ extern void free_bootmem_with_active_regions(int nid,
1165 unsigned long max_low_pfn); 1175 unsigned long max_low_pfn);
1166int add_from_early_node_map(struct range *range, int az, 1176int add_from_early_node_map(struct range *range, int az,
1167 int nr_range, int nid); 1177 int nr_range, int nid);
1178u64 __init find_memory_core_early(int nid, u64 size, u64 align,
1179 u64 goal, u64 limit);
1168void *__alloc_memory_core_early(int nodeid, u64 size, u64 align, 1180void *__alloc_memory_core_early(int nodeid, u64 size, u64 align,
1169 u64 goal, u64 limit); 1181 u64 goal, u64 limit);
1170typedef int (*work_fn_t)(unsigned long, unsigned long, void *); 1182typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
@@ -1330,8 +1342,10 @@ unsigned long ra_submit(struct file_ra_state *ra,
1330 1342
1331/* Do stack extension */ 1343/* Do stack extension */
1332extern int expand_stack(struct vm_area_struct *vma, unsigned long address); 1344extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
1333#ifdef CONFIG_IA64 1345#if VM_GROWSUP
1334extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); 1346extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
1347#else
1348 #define expand_upwards(vma, address) do { } while (0)
1335#endif 1349#endif
1336extern int expand_stack_downwards(struct vm_area_struct *vma, 1350extern int expand_stack_downwards(struct vm_area_struct *vma,
1337 unsigned long address); 1351 unsigned long address);
@@ -1357,7 +1371,15 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
1357 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 1371 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
1358} 1372}
1359 1373
1374#ifdef CONFIG_MMU
1360pgprot_t vm_get_page_prot(unsigned long vm_flags); 1375pgprot_t vm_get_page_prot(unsigned long vm_flags);
1376#else
1377static inline pgprot_t vm_get_page_prot(unsigned long vm_flags)
1378{
1379 return __pgprot(0);
1380}
1381#endif
1382
1361struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); 1383struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
1362int remap_pfn_range(struct vm_area_struct *, unsigned long addr, 1384int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
1363 unsigned long pfn, unsigned long size, pgprot_t); 1385 unsigned long pfn, unsigned long size, pgprot_t);