11450572aSAxel Dörfler #ifndef _WRAPPER_H 21450572aSAxel Dörfler #define _WRAPPER_H 31450572aSAxel Dörfler 41450572aSAxel Dörfler #include <KernelExport.h> 51450572aSAxel Dörfler #include <lock.h> 61450572aSAxel Dörfler 71450572aSAxel Dörfler 81450572aSAxel Dörfler // debug output 91450572aSAxel Dörfler 101450572aSAxel Dörfler #ifdef DEBUG_WAIT_ON_MSG 111450572aSAxel Dörfler # define DEBUG_WAIT snooze( DEBUG_WAIT_ON_MSG ); 121450572aSAxel Dörfler #else 131450572aSAxel Dörfler # define DEBUG_WAIT 141450572aSAxel Dörfler #endif 151450572aSAxel Dörfler 161450572aSAxel Dörfler #ifdef DEBUG_WAIT_ON_ERROR 171450572aSAxel Dörfler # define DEBUG_WAIT_ERROR snooze( DEBUG_WAIT_ON_ERROR ); 181450572aSAxel Dörfler #else 191450572aSAxel Dörfler # define DEBUG_WAIT_ERROR 201450572aSAxel Dörfler #endif 211450572aSAxel Dörfler 221450572aSAxel Dörfler #ifndef DEBUG_MAX_LEVEL_FLOW 231450572aSAxel Dörfler # define DEBUG_MAX_LEVEL_FLOW 4 241450572aSAxel Dörfler #endif 251450572aSAxel Dörfler 261450572aSAxel Dörfler #ifndef DEBUG_MAX_LEVEL_INFO 271450572aSAxel Dörfler # define DEBUG_MAX_LEVEL_INFO 4 281450572aSAxel Dörfler #endif 291450572aSAxel Dörfler 301450572aSAxel Dörfler #ifndef DEBUG_MAX_LEVEL_ERROR 311450572aSAxel Dörfler # define DEBUG_MAX_LEVEL_ERROR 4 321450572aSAxel Dörfler #endif 331450572aSAxel Dörfler 341450572aSAxel Dörfler #ifndef DEBUG_MSG_PREFIX 351450572aSAxel Dörfler # define DEBUG_MSG_PREFIX "" 361450572aSAxel Dörfler #endif 371450572aSAxel Dörfler 381450572aSAxel Dörfler #ifndef debug_level_flow 39368167edSAxel Dörfler # define debug_level_flow 4 401450572aSAxel Dörfler #endif 411450572aSAxel Dörfler 421450572aSAxel Dörfler #ifndef debug_level_info 431450572aSAxel Dörfler # define debug_level_info 2 441450572aSAxel Dörfler #endif 451450572aSAxel Dörfler 461450572aSAxel Dörfler #ifndef debug_level_error 471450572aSAxel Dörfler # define debug_level_error 1 481450572aSAxel Dörfler #endif 491450572aSAxel Dörfler 50758b1d0eSIngo Weinhold #define FUNC_NAME DEBUG_MSG_PREFIX, __FUNCTION__ 511450572aSAxel Dörfler 521450572aSAxel Dörfler #define SHOW_FLOW(seriousness, format, param...) \ 531450572aSAxel Dörfler do { if( seriousness <= debug_level_flow && seriousness <= DEBUG_MAX_LEVEL_FLOW ) { \ 54758b1d0eSIngo Weinhold dprintf("%s%s: " format "\n", FUNC_NAME, param ); DEBUG_WAIT \ 551450572aSAxel Dörfler }} while( 0 ) 561450572aSAxel Dörfler 571450572aSAxel Dörfler #define SHOW_FLOW0(seriousness, format) \ 581450572aSAxel Dörfler do { if( seriousness <= debug_level_flow && seriousness <= DEBUG_MAX_LEVEL_FLOW ) { \ 59758b1d0eSIngo Weinhold dprintf("%s%s: " format "\n", FUNC_NAME); DEBUG_WAIT \ 601450572aSAxel Dörfler }} while( 0 ) 611450572aSAxel Dörfler 621450572aSAxel Dörfler #define SHOW_INFO(seriousness, format, param...) \ 631450572aSAxel Dörfler do { if( seriousness <= debug_level_info && seriousness <= DEBUG_MAX_LEVEL_INFO ) { \ 64758b1d0eSIngo Weinhold dprintf("%s%s: " format "\n", FUNC_NAME, param ); DEBUG_WAIT \ 651450572aSAxel Dörfler }} while( 0 ) 661450572aSAxel Dörfler 671450572aSAxel Dörfler #define SHOW_INFO0(seriousness, format) \ 681450572aSAxel Dörfler do { if( seriousness <= debug_level_info && seriousness <= DEBUG_MAX_LEVEL_INFO ) { \ 69758b1d0eSIngo Weinhold dprintf("%s%s: " format "\n", FUNC_NAME); DEBUG_WAIT \ 701450572aSAxel Dörfler }} while( 0 ) 711450572aSAxel Dörfler 721450572aSAxel Dörfler #define SHOW_ERROR(seriousness, format, param...) \ 731450572aSAxel Dörfler do { if( seriousness <= debug_level_error && seriousness <= DEBUG_MAX_LEVEL_ERROR ) { \ 74758b1d0eSIngo Weinhold dprintf("%s%s: " format "\n", FUNC_NAME, param ); DEBUG_WAIT_ERROR \ 751450572aSAxel Dörfler }} while( 0 ) 761450572aSAxel Dörfler 771450572aSAxel Dörfler #define SHOW_ERROR0(seriousness, format) \ 781450572aSAxel Dörfler do { if( seriousness <= debug_level_error && seriousness <= DEBUG_MAX_LEVEL_ERROR ) { \ 79758b1d0eSIngo Weinhold dprintf("%s%s: " format "\n", FUNC_NAME); DEBUG_WAIT_ERROR \ 801450572aSAxel Dörfler }} while( 0 ) 811450572aSAxel Dörfler 82*fc68c4cbSJérôme Duval #endif /* _WRAPPER_H */ 83