#ifndef	COMMON_MISC_H
#define	COMMON_MISC_H

/*
 * Debugging macros
 */

#ifdef	ARCH_VERBOSE

#define	ARCH_CALLER_NAME(name) \
	static char *arch_caller_name = #name;

#define	ARCH_ERROR(desc) \
	conlPrintf(LOG_ERROR,"ERROR: %s(): %s.\n",arch_caller_name,desc);

#define	ARCH_ERROR_1STR(desc,arg) \
	conlPrintf(LOG_ERROR,"ERROR: %s(): %s %s.\n",arch_caller_name,desc,arg);

#define	ARCH_WARNING(desc) \
	conlPrintf(LOG_WARNING,"WARNING: %s(): %s.\n",arch_caller_name,desc);

#define	ARCH_WARNING_1STR(desc,arg) \
	conlPrintf(LOG_WARNING,"WARNING: %s(): %s %s.\n",arch_caller_name,desc,arg);

#define	ARCH_INFO(desc) \
	conlPrintf(LOG_INFO,"%s(): %s.\n",arch_caller_name,desc);

#define	ARCH_TRACE(desc) \
	conlPrintf(LOG_TRACE,"TRACE: %s(): %s.\n",arch_caller_name,desc);

#else	/* !ARCH_VERBOSE */

#define	ARCH_CALLER_NAME(name)
#define	ARCH_ERROR(desc)
#define	ARCH_ERROR_1STR(desc,arg)
#define	ARCH_WARNING(desc)
#define	ARCH_WARNING_1STR(desc,arg)
#define	ARCH_INFO(desc)
#define	ARCH_TRACE(desc)

#endif	/* !ARCH_VERBOSE */

/*
 * Portable utility functions
 */

#ifdef __cplusplus
extern "C" {
#endif	/* __cplusplus */
	void	V_CALL	str2HexCodes(char *dest,char *src);
	char	V_CALL	nibble2HexChar(u8_t bits1_4);
#ifdef __cplusplus
}
#endif	/* __cplusplus */

#endif	/* !COMMON_MISC_H */
