Files

20 lines
382 B
C
Raw Permalink Normal View History

// SPDX-License-Identifier: GPL-2.0
2007-09-17 14:08:06 +10:00
#include <linux/types.h>
#include <linux/init.h>
#include <linux/slab.h>
2018-10-30 15:09:49 -07:00
#include <linux/memblock.h>
#include <linux/string.h>
2012-03-28 18:30:02 +01:00
#include <asm/setup.h>
2007-09-17 14:08:06 +10:00
2016-08-02 14:03:33 -07:00
void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
{
void *p;
if (slab_is_available())
p = kzalloc(size, mask);
else {
p = memblock_alloc(size, SMP_CACHE_BYTES);
}
return p;
}