mouse
Table_bottom

分类
Table_bottom

最新评论
Table_bottom

最新留言
Table_bottom

链接
Table_bottom

RSS
RSS Link
Table_bottom

功能
Table_bottom

调试专用头文件

mouse posted @ 2011年11月10日 09:26 in 未分类 , 770 阅读

#ifndef	_PHY_DEBUG_H
#define	_PHY_DEBUG_H

#if defined(PHY_DEBUG)
	#if	defined(__KERNEL__)
		#include <linux/kernel.h>
		#define		phy_debug_print(a1,...)		printk(KERN_ALERT a1,##__VA_ARGS__)
		#define		PHY_ASSERT_BUGON(exp)	({if(!(exp)){\
						phy_debug_print("error: line %d, file %s  assertion failed\n",\
						__LINE__,__FILE__);return -1;}})
	#else /* user space, e.g. printf... */
		#include <stdio.h>
		#include <stdlib.h>
		#define		phy_debug_print(a1,...)		printf(a1,##__VA_ARGS__)
		#define		PHY_ASSERT_BUGON(exp)	({if(!(exp)){\
						phy_debug_print("error: line %d, file %s assertion failed\n",\
						__LINE__,__FILE__);\
						exit(1);}})

	#endif /* end __KERNEL__ */
#else /* not defined PHY_DEBUG, e.g. in userspace */
	#define		phy_debug_print(a1,...)
	#define		PHY_ASSERT_BUGON(exp)
#endif /* PHY_DEBUG */
#endif /* _PHY_DEBUG_H */

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter