-
Notifications
You must be signed in to change notification settings - Fork 2
/
util_by_wei.h
44 lines (32 loc) · 1.11 KB
/
util_by_wei.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __WEI_UTIL
#define __WEI_UTIL
typedef unsigned int u32;
#define KDEBUG_ENABLE
#ifdef KDEBUG_ENABLE
#define Kdbg(x...) {printk("\nkernel# fun: ");printk(x);printk("\n");}while(0)
//#define Kdbgv(x...) {printk("\nkernel# x:%08x %d ",x,x);printk("\n");}while(0)
#define Kdbgln(x...) {printk("kernel # ");printk(x);printk("\n");}while(0)
#define Kdbgv(v) {printk("kernel # ");printk(#v);printk("\t:%08x %d \n",v , v);}while(0)
#define KLdbg() printk("line :%d fun:%s \n",__LINE__,__FUNCTION__)
#else
#define Kdbg(x...)
#define Kdbgv(x...)
#define Ldbg()
#endif
#define USBdebug(...) printk(__VA_ARGS__)
#define USER_DBG_EN
#ifdef USER_DBG_EN
#define Udbg(x...) {printf("user# fun: ");printf(x);}while(0)
#define Udbgln(x...) {printf("user # ");printf(x);printf("\n");}while(0)
#define Udbgv(v) {printf("kernel # ");printf(#v);printf("\t:%08x %d \n",v , v);}while(0)
#define ULdbg() printf("line :%d fun:%s \n",__LINE__,__FUNCTION__)
#else
#define Udbg(x...)
#define Udbgv(x...)
#define Udbgln(x...)
#define ULdbg()
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif
#endif