1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef SLAB_H
3 #define SLAB_H
4
5 #include <linux/types.h>
6 #include <linux/gfp.h>
7
8 #define SLAB_HWCACHE_ALIGN 1
9 #define SLAB_PANIC 2
10 #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
11
12 void *kmalloc(size_t size, gfp_t);
13 void kfree(void *);
14
kzalloc(size_t size,gfp_t gfp)15 static inline void *kzalloc(size_t size, gfp_t gfp)
16 {
17 return kmalloc(size, gfp | __GFP_ZERO);
18 }
19
20 void *kmem_cache_alloc(struct kmem_cache *cachep, int flags);
21 void kmem_cache_free(struct kmem_cache *cachep, void *objp);
22
23 struct kmem_cache *kmem_cache_create(const char *name, unsigned int size,
24 unsigned int align, unsigned int flags,
25 void (*ctor)(void *));
26
27 #endif /* SLAB_H */
28