diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-08-05 13:05:25 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-08-05 13:05:25 +1000 |
commit | 7dff2ac4d4e01f268b2470ee9c5121b8686a4ff6 (patch) | |
tree | 7c3e872bedb3dac4dc77247ecee29b0a9b18a7e6 /mm | |
parent | cb307d163f98fa3b61ef701a4afd5af5ff4524b4 (diff) | |
parent | f5663f5bded3364158e2d31904173cb1debc2ecd (diff) |
Merge commit 'sh/master'
Diffstat (limited to 'mm')
-rw-r--r-- | mm/nommu.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 5edccd9c9218..ed75bc962fbe 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -266,6 +266,27 @@ void *vmalloc_node(unsigned long size, int node) } EXPORT_SYMBOL(vmalloc_node); +#ifndef PAGE_KERNEL_EXEC +# define PAGE_KERNEL_EXEC PAGE_KERNEL +#endif + +/** + * vmalloc_exec - allocate virtually contiguous, executable memory + * @size: allocation size + * + * Kernel-internal function to allocate enough pages to cover @size + * the page level allocator and map them into contiguous and + * executable kernel virtual space. + * + * For tight control over page level allocator and protection flags + * use __vmalloc() instead. + */ + +void *vmalloc_exec(unsigned long size) +{ + return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC); +} + /** * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) * @size: allocation size |