aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/kernel/vpe.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index eed2dc4273e0..39804c584edd 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -262,13 +262,21 @@ void dump_mtregs(void)
262/* Find some VPE program space */ 262/* Find some VPE program space */
263static void *alloc_progmem(unsigned long len) 263static void *alloc_progmem(unsigned long len)
264{ 264{
265 void *addr;
266
265#ifdef CONFIG_MIPS_VPE_LOADER_TOM 267#ifdef CONFIG_MIPS_VPE_LOADER_TOM
266 /* this means you must tell linux to use less memory than you physically have */ 268 /*
267 return pfn_to_kaddr(max_pfn); 269 * This means you must tell Linux to use less memory than you
270 * physically have, for example by passing a mem= boot argument.
271 */
272 addr = pfn_to_kaddr(max_pfn);
273 memset(addr, 0, len);
268#else 274#else
269 // simple grab some mem for now 275 /* simple grab some mem for now */
270 return kmalloc(len, GFP_KERNEL); 276 addr = kzalloc(len, GFP_KERNEL);
271#endif 277#endif
278
279 return addr;
272} 280}
273 281
274static void release_progmem(void *ptr) 282static void release_progmem(void *ptr)
@@ -884,9 +892,10 @@ static int vpe_elfload(struct vpe * v)
884 } 892 }
885 893
886 v->load_addr = alloc_progmem(mod.core_size); 894 v->load_addr = alloc_progmem(mod.core_size);
887 memset(v->load_addr, 0, mod.core_size); 895 if (!v->load_addr)
896 return -ENOMEM;
888 897
889 printk("VPE loader: loading to %p\n", v->load_addr); 898 pr_info("VPE loader: loading to %p\n", v->load_addr);
890 899
891 if (relocate) { 900 if (relocate) {
892 for (i = 0; i < hdr->e_shnum; i++) { 901 for (i = 0; i < hdr->e_shnum; i++) {