diff options
| author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
|---|---|---|
| committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
| commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
| tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/x86/kernel/module.c | |
| parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
| parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) | |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/x86/kernel/module.c')
| -rw-r--r-- | arch/x86/kernel/module.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index 1c355c550960..52f256f2cc81 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/bug.h> | 24 | #include <linux/bug.h> |
| 25 | #include <linux/mm.h> | 25 | #include <linux/mm.h> |
| 26 | #include <linux/gfp.h> | 26 | #include <linux/gfp.h> |
| 27 | #include <linux/jump_label.h> | ||
| 27 | 28 | ||
| 28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
| 29 | #include <asm/page.h> | 30 | #include <asm/page.h> |
| @@ -37,20 +38,11 @@ | |||
| 37 | 38 | ||
| 38 | void *module_alloc(unsigned long size) | 39 | void *module_alloc(unsigned long size) |
| 39 | { | 40 | { |
| 40 | struct vm_struct *area; | 41 | if (PAGE_ALIGN(size) > MODULES_LEN) |
| 41 | |||
| 42 | if (!size) | ||
| 43 | return NULL; | ||
| 44 | size = PAGE_ALIGN(size); | ||
| 45 | if (size > MODULES_LEN) | ||
| 46 | return NULL; | ||
| 47 | |||
| 48 | area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END); | ||
| 49 | if (!area) | ||
| 50 | return NULL; | 42 | return NULL; |
| 51 | 43 | return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, | |
| 52 | return __vmalloc_area(area, GFP_KERNEL | __GFP_HIGHMEM, | 44 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC, |
| 53 | PAGE_KERNEL_EXEC); | 45 | -1, __builtin_return_address(0)); |
| 54 | } | 46 | } |
| 55 | 47 | ||
| 56 | /* Free memory returned from module_alloc */ | 48 | /* Free memory returned from module_alloc */ |
| @@ -239,6 +231,9 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 239 | apply_paravirt(pseg, pseg + para->sh_size); | 231 | apply_paravirt(pseg, pseg + para->sh_size); |
| 240 | } | 232 | } |
| 241 | 233 | ||
| 234 | /* make jump label nops */ | ||
| 235 | jump_label_apply_nops(me); | ||
| 236 | |||
| 242 | return 0; | 237 | return 0; |
| 243 | } | 238 | } |
| 244 | 239 | ||
