diff options
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/lib/alloc.c | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 0a486d4b2547..23bbb1ea7f9f 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile | |||
@@ -7,7 +7,7 @@ EXTRA_CFLAGS += -mno-minimal-toc | |||
7 | endif | 7 | endif |
8 | 8 | ||
9 | ifeq ($(CONFIG_PPC_MERGE),y) | 9 | ifeq ($(CONFIG_PPC_MERGE),y) |
10 | obj-y := string.o | 10 | obj-y := string.o alloc.o |
11 | obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o | 11 | obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o |
12 | endif | 12 | endif |
13 | 13 | ||
diff --git a/arch/powerpc/lib/alloc.c b/arch/powerpc/lib/alloc.c new file mode 100644 index 000000000000..e58c80590ebc --- /dev/null +++ b/arch/powerpc/lib/alloc.c | |||
@@ -0,0 +1,14 @@ | |||
1 | #include <linux/types.h> | ||
2 | #include <linux/init.h> | ||
3 | #include <linux/slab.h> | ||
4 | #include <linux/bootmem.h> | ||
5 | |||
6 | #include <asm/system.h> | ||
7 | |||
8 | void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask) | ||
9 | { | ||
10 | if (mem_init_done) | ||
11 | return kmalloc(size, mask); | ||
12 | else | ||
13 | return alloc_bootmem(size); | ||
14 | } | ||