arch: make execmem setup available regardless of CONFIG_MODULES
[linux-2.6-block.git] / arch / parisc / mm / init.c
index f876af56e13fddea6a2ff412e03ea301a1ce4b8a..34d91cb8b25905ae72515aee4caf42fc13973b29 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/nodemask.h>    /* for node_online_map */
 #include <linux/pagemap.h>     /* for release_pages */
 #include <linux/compat.h>
+#include <linux/execmem.h>
 
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
@@ -481,7 +482,7 @@ void free_initmem(void)
        /* finally dump all the instructions which were cached, since the
         * pages are no-longer executable */
        flush_icache_range(init_begin, init_end);
-       
+
        free_initmem_default(POISON_FREE_INITMEM);
 
        /* set up a new led state on systems shipped LED State panel */
@@ -992,3 +993,23 @@ static const pgprot_t protection_map[16] = {
        [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ]      = PAGE_RWX
 };
 DECLARE_VM_GET_PAGE_PROT
+
+#ifdef CONFIG_EXECMEM
+static struct execmem_info execmem_info __ro_after_init;
+
+struct execmem_info __init *execmem_arch_setup(void)
+{
+       execmem_info = (struct execmem_info){
+               .ranges = {
+                       [EXECMEM_DEFAULT] = {
+                               .start  = VMALLOC_START,
+                               .end    = VMALLOC_END,
+                               .pgprot = PAGE_KERNEL_RWX,
+                               .alignment = 1,
+                       },
+               },
+       };
+
+       return &execmem_info;
+}
+#endif /* CONFIG_EXECMEM */