1 #ifndef __FM_STDLIB_H__
2 #define __FM_STDLIB_H__
4 #include "fm_typedef.h"
5 #include <linux/string.h>
8 #define fm_memset(buf, a, len) \
10 void *__ret = (void*)0; \
11 __ret = memset((buf), (a), (len)); \
15 #define fm_memcpy(dst, src, len) \
17 void *__ret = (void*)0; \
18 __ret = memcpy((dst), (src), (len)); \
22 #define fm_malloc(len) \
24 void *__ret = (void*)0; \
25 __ret = kmalloc(len, GFP_KERNEL); \
29 #define fm_zalloc(len) \
31 void *__ret = (void*)0; \
32 __ret = kzalloc(len, GFP_KERNEL); \
36 #define fm_free(ptr) kfree(ptr)
38 #define fm_vmalloc(len) \
40 void *__ret = (void*)0; \
41 __ret = vmalloc(len); \
45 #define fm_vfree(ptr) vfree(ptr)
48 inline void* fm_memset(void *buf, fm_s8 val, fm_s32 len)
50 return memset(buf, val, len);
53 inline void* fm_memcpy(void *dst, const void *src, fm_s32 len)
55 return memcpy(dst, src, len);
60 #endif //__FM_STDLIB_H__