BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / generic / scsi_periph / wrapper.h
blob1d9663ec43012fd945dbfef253f552e27d536e7b
1 #ifndef _WRAPPER_H
2 #define _WRAPPER_H
5 #include <KernelExport.h>
6 #include <lock.h>
9 // debug output
11 #ifdef DEBUG_WAIT_ON_MSG
12 # define DEBUG_WAIT snooze( DEBUG_WAIT_ON_MSG );
13 #else
14 # define DEBUG_WAIT
15 #endif
17 #ifdef DEBUG_WAIT_ON_ERROR
18 # define DEBUG_WAIT_ERROR snooze( DEBUG_WAIT_ON_ERROR );
19 #else
20 # define DEBUG_WAIT_ERROR
21 #endif
23 #ifndef DEBUG_MAX_LEVEL_FLOW
24 # define DEBUG_MAX_LEVEL_FLOW 4
25 #endif
27 #ifndef DEBUG_MAX_LEVEL_INFO
28 # define DEBUG_MAX_LEVEL_INFO 4
29 #endif
31 #ifndef DEBUG_MAX_LEVEL_ERROR
32 # define DEBUG_MAX_LEVEL_ERROR 4
33 #endif
35 #ifndef DEBUG_MSG_PREFIX
36 # define DEBUG_MSG_PREFIX ""
37 #endif
39 #ifndef debug_level_flow
40 # define debug_level_flow 0
41 #endif
43 #ifndef debug_level_info
44 # define debug_level_info 1
45 #endif
47 #ifndef debug_level_error
48 # define debug_level_error 2
49 #endif
51 #define FUNC_NAME DEBUG_MSG_PREFIX, __FUNCTION__
53 #define SHOW_FLOW(seriousness, format, param...) \
54 do { if( seriousness <= debug_level_flow && seriousness <= DEBUG_MAX_LEVEL_FLOW ) { \
55 dprintf("%s%s: " format "\n", FUNC_NAME, param ); DEBUG_WAIT \
56 }} while( 0 )
58 #define SHOW_FLOW0(seriousness, format) \
59 do { if( seriousness <= debug_level_flow && seriousness <= DEBUG_MAX_LEVEL_FLOW ) { \
60 dprintf("%s%s: " format "\n", FUNC_NAME); DEBUG_WAIT \
61 }} while( 0 )
63 #define SHOW_INFO(seriousness, format, param...) \
64 do { if( seriousness <= debug_level_info && seriousness <= DEBUG_MAX_LEVEL_INFO ) { \
65 dprintf("%s%s: " format "\n", FUNC_NAME, param ); DEBUG_WAIT \
66 }} while( 0 )
68 #define SHOW_INFO0(seriousness, format) \
69 do { if( seriousness <= debug_level_info && seriousness <= DEBUG_MAX_LEVEL_INFO ) { \
70 dprintf("%s%s: " format "\n", FUNC_NAME); DEBUG_WAIT \
71 }} while( 0 )
73 #define SHOW_ERROR(seriousness, format, param...) \
74 do { if( seriousness <= debug_level_error && seriousness <= DEBUG_MAX_LEVEL_ERROR ) { \
75 dprintf("%s%s: " format "\n", FUNC_NAME, param ); DEBUG_WAIT_ERROR \
76 }} while( 0 )
78 #define SHOW_ERROR0(seriousness, format) \
79 do { if( seriousness <= debug_level_error && seriousness <= DEBUG_MAX_LEVEL_ERROR ) { \
80 dprintf("%s%s: " format "\n", FUNC_NAME); DEBUG_WAIT_ERROR \
81 }} while( 0 )
84 #endif /* _WRAPPER_H */