| Stephen Rothwell | 7b2c3c5 | 2007-09-17 14:08:06 +1000 | [diff] [blame] | 1 | #include <linux/types.h> | 
 | 2 | #include <linux/init.h> | 
 | 3 | #include <linux/slab.h> | 
 | 4 | #include <linux/bootmem.h> | 
| Stephen Rothwell | 5669c3c | 2007-10-02 13:37:53 +1000 | [diff] [blame] | 5 | #include <linux/string.h> | 
| Stephen Rothwell | 7b2c3c5 | 2007-09-17 14:08:06 +1000 | [diff] [blame] | 6 |  | 
 | 7 | #include <asm/system.h> | 
 | 8 |  | 
| Stephen Rothwell | 5669c3c | 2007-10-02 13:37:53 +1000 | [diff] [blame] | 9 | void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask) | 
 | 10 | { | 
 | 11 | 	void *p; | 
 | 12 |  | 
 | 13 | 	if (mem_init_done) | 
 | 14 | 		p = kzalloc(size, mask); | 
 | 15 | 	else { | 
 | 16 | 		p = alloc_bootmem(size); | 
 | 17 | 		if (p) | 
 | 18 | 			memset(p, 0, size); | 
 | 19 | 	} | 
 | 20 | 	return p; | 
 | 21 | } |