]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
7b2c3c5b SR |
2 | #include <linux/types.h> |
3 | #include <linux/init.h> | |
4 | #include <linux/slab.h> | |
5 | #include <linux/bootmem.h> | |
5669c3cf | 6 | #include <linux/string.h> |
ae3a197e | 7 | #include <asm/setup.h> |
7b2c3c5b | 8 | |
7b2c3c5b | 9 | |
bd721ea7 | 10 | void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask) |
5669c3cf SR |
11 | { |
12 | void *p; | |
13 | ||
f691fa10 | 14 | if (slab_is_available()) |
5669c3cf SR |
15 | p = kzalloc(size, mask); |
16 | else { | |
e39f223f | 17 | p = memblock_virt_alloc(size, 0); |
5669c3cf SR |
18 | } |
19 | return p; | |
20 | } |