6 #include <linux/compat.h>
8 struct p_current cur = {
11 __maybe_unused struct p_current *current = &cur;
13 unsigned long copy_from_user(void *dest, const void *src,
16 memcpy((void *)dest, (void *)src, count);
20 void *kmalloc(size_t size, int flags)
24 p = malloc_cache_aligned(size);
25 if (p && flags & __GFP_ZERO)
31 struct kmem_cache *get_mem(int element_sz)
33 struct kmem_cache *ret;
35 ret = memalign(ARCH_DMA_MINALIGN, sizeof(struct kmem_cache));
41 void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
43 return malloc_cache_aligned(obj->sz);
47 * kmemdup - duplicate region of memory
49 * @src: memory region to duplicate
50 * @len: memory region length
51 * @gfp: GFP mask to use
53 * Return: newly allocated copy of @src or %NULL in case of error
55 void *kmemdup(const void *src, size_t len, gfp_t gfp)
59 p = kmalloc(len, gfp);