2007-09-16 22:08:06 -06:00
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/bootmem.h>
|
2007-10-01 21:37:53 -06:00
|
|
|
#include <linux/string.h>
|
2012-03-28 11:30:02 -06:00
|
|
|
#include <asm/setup.h>
|
2007-09-16 22:08:06 -06:00
|
|
|
|
|
|
|
|
2007-10-01 21:37:53 -06:00
|
|
|
void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
|
|
|
|
{
|
|
|
|
void *p;
|
|
|
|
|
|
|
|
if (mem_init_done)
|
|
|
|
p = kzalloc(size, mask);
|
|
|
|
else {
|
|
|
|
p = alloc_bootmem(size);
|
|
|
|
if (p)
|
|
|
|
memset(p, 0, size);
|
|
|
|
}
|
|
|
|
return p;
|
|
|
|
}
|