4 #include <linux/compat.h>
6 struct p_current cur = {
9 __maybe_unused struct p_current *current = &cur;
11 unsigned long copy_from_user(void *dest, const void *src,
14 memcpy((void *)dest, (void *)src, count);
18 void *kmalloc(size_t size, int flags)
22 p = malloc_cache_aligned(size);
23 if (p && flags & __GFP_ZERO)
29 struct kmem_cache *get_mem(int element_sz)
31 struct kmem_cache *ret;
33 ret = memalign(ARCH_DMA_MINALIGN, sizeof(struct kmem_cache));
39 void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
41 return malloc_cache_aligned(obj->sz);
45 * kmemdup - duplicate region of memory
47 * @src: memory region to duplicate
48 * @len: memory region length
49 * @gfp: GFP mask to use
51 * Return: newly allocated copy of @src or %NULL in case of error
53 void *kmemdup(const void *src, size_t len, gfp_t gfp)
57 p = kmalloc(len, gfp);