From 54c77e2d527bc22024f15c7129e6a476aefaa3c5 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 4 Aug 2008 16:01:47 +0900 Subject: [PATCH] --- yaml --- r: 107620 b: refs/heads/master c: 1af446edfe3239b2b731f3458b3c285c397464cc h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/nommu.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 94911ede26dc..3424bd873846 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d8eb2fab18b856fcaebe2619e8eaaa152baebc66 +refs/heads/master: 1af446edfe3239b2b731f3458b3c285c397464cc diff --git a/trunk/mm/nommu.c b/trunk/mm/nommu.c index 5edccd9c9218..ed75bc962fbe 100644 --- a/trunk/mm/nommu.c +++ b/trunk/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