5 #include <linux/compat.h>
7 struct p_current cur = {
10 __maybe_unused struct p_current *current = &cur;
12 unsigned long copy_from_user(void *dest, const void *src,
15 memcpy((void *)dest, (void *)src, count);
19 void *kmalloc(size_t size, int flags)
23 p = malloc_cache_aligned(size);
24 if (p && flags & __GFP_ZERO)
30 struct kmem_cache *get_mem(int element_sz)
32 struct kmem_cache *ret;
34 ret = memalign(ARCH_DMA_MINALIGN, sizeof(struct kmem_cache));
40 void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
42 return malloc_cache_aligned(obj->sz);
46 * kmemdup - duplicate region of memory
48 * @src: memory region to duplicate
49 * @len: memory region length
50 * @gfp: GFP mask to use
52 * Return: newly allocated copy of @src or %NULL in case of error
54 void *kmemdup(const void *src, size_t len, gfp_t gfp)
58 p = kmalloc(len, gfp);