diff options
-rw-r--r-- | arch/microblaze/include/asm/system.h | 3 | ||||
-rw-r--r-- | arch/microblaze/mm/init.c | 23 |
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h index 157970688b2a..59efb3fef957 100644 --- a/arch/microblaze/include/asm/system.h +++ b/arch/microblaze/include/asm/system.h | |||
@@ -87,6 +87,9 @@ void free_initmem(void); | |||
87 | extern char *klimit; | 87 | extern char *klimit; |
88 | extern void ret_from_fork(void); | 88 | extern void ret_from_fork(void); |
89 | 89 | ||
90 | extern void *alloc_maybe_bootmem(size_t size, gfp_t mask); | ||
91 | extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); | ||
92 | |||
90 | #ifdef CONFIG_DEBUG_FS | 93 | #ifdef CONFIG_DEBUG_FS |
91 | extern struct dentry *of_debugfs_root; | 94 | extern struct dentry *of_debugfs_root; |
92 | #endif | 95 | #endif |
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index a57cedf36715..6eea5544ad8b 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c | |||
@@ -349,4 +349,27 @@ void __init *early_get_page(void) | |||
349 | } | 349 | } |
350 | return p; | 350 | return p; |
351 | } | 351 | } |
352 | |||
353 | void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask) | ||
354 | { | ||
355 | if (mem_init_done) | ||
356 | return kmalloc(size, mask); | ||
357 | else | ||
358 | return alloc_bootmem(size); | ||
359 | } | ||
360 | |||
361 | void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask) | ||
362 | { | ||
363 | void *p; | ||
364 | |||
365 | if (mem_init_done) | ||
366 | p = kzalloc(size, mask); | ||
367 | else { | ||
368 | p = alloc_bootmem(size); | ||
369 | if (p) | ||
370 | memset(p, 0, size); | ||
371 | } | ||
372 | return p; | ||
373 | } | ||
374 | |||
352 | #endif /* CONFIG_MMU */ | 375 | #endif /* CONFIG_MMU */ |