CVS commit: src/sys/arch/hpc/include
Module Name:src Committed By: uwe Date: Mon Aug 9 23:07:20 UTC 2010 Modified Files: src/sys/arch/hpc/include: debug.h Log Message: Misc cosmetics. Refix __func__ fallout fixed in previous by eliminating the temp completely (__func__ is already an array). This has been sitting in my tree for years, and I forgot to commit it. Compile-tested by compiling hpcsh GENERIC with options DEBUG. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpc/include/debug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/hpc/include/debug.h diff -u src/sys/arch/hpc/include/debug.h:1.10 src/sys/arch/hpc/include/debug.h:1.11 --- src/sys/arch/hpc/include/debug.h:1.10 Sun Aug 8 16:27:30 2010 +++ src/sys/arch/hpc/include/debug.h Mon Aug 9 23:07:20 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: debug.h,v 1.10 2010/08/08 16:27:30 chs Exp $ */ +/* $NetBSD: debug.h,v 1.11 2010/08/09 23:07:20 uwe Exp $ */ /*- * Copyright (c) 1999-2002 The NetBSD Foundation, Inc. @@ -48,75 +48,116 @@ * #endif */ #ifdef USE_HPC_DPRINTF -#ifdef __DPRINTF_EXT -/* - * debug printf with Function name - */ -#define PRINTF(fmt, args...) printf(%s: fmt, __func__ , ##args) + #ifdef DPRINTF_ENABLE + #ifndef DPRINTF_DEBUG -#error specify unique debug symbol +#error specify unique debug variable #endif + #ifndef DPRINTF_LEVEL #define DPRINTF_LEVEL 1 #endif -int DPRINTF_DEBUG = DPRINTF_LEVEL; -#define DPRINTF(fmt, args...) if (DPRINTF_DEBUG) PRINTF(fmt, ##args) -#define _DPRINTF(fmt, args...) if (DPRINTF_DEBUG) printf(fmt, ##args) -#define DPRINTFN(n, fmt, args...) \ - if (DPRINTF_DEBUG (n)) PRINTF(fmt, ##args) -#define _DPRINTFN(n, fmt, args...) \ - if (DPRINTF_DEBUG (n)) printf(fmt, ##args) -#else /* DPRINTF_ENABLE */ -#define DPRINTF(args...) ((void)0) -#define _DPRINTF(args...) ((void)0) -#define DPRINTFN(n, args...) ((void)0) -#define _DPRINTFN(n, args...) ((void)0) + +int DPRINTF_DEBUG = DPRINTF_LEVEL; #endif /* DPRINTF_ENABLE */ -#else /* __DPRINTF_EXT */ + +#ifdef __DPRINTF_EXT +/* + * printf with function name prepended + */ + +#define PRINTF(fmt, args...) do { \ + printf(%s: fmt, __func__ , ##args); \ + } while (/* CONSTCOND */0) + +#ifdef DPRINTF_ENABLE + +#define DPRINTF(fmt, args...) do { \ + if (DPRINTF_DEBUG) \ + PRINTF(fmt, ##args); \ + } while (/* CONSTCOND */0) + +#define _DPRINTF(fmt, args...) do { \ + if (DPRINTF_DEBUG) \ + printf(fmt, ##args); \ + } while (/* CONSTCOND */0) + +#define DPRINTFN(n, fmt, args...) do { \ + if (DPRINTF_DEBUG (n)) \ + PRINTF(fmt, ##args); \ + } while (/* CONSTCOND */0) + +#define _DPRINTFN(n, fmt, args...) do { \ + if (DPRINTF_DEBUG (n)) \ + printf(fmt, ##args); \ + } while (/* CONSTCOND */0) + +#else /* !DPRINTF_ENABLE */ +#define DPRINTF(args...) do {} while (/* CONSTCOND */ 0) +#define _DPRINTF(args...) do {} while (/* CONSTCOND */ 0) +#define DPRINTFN(n, args...) do {} while (/* CONSTCOND */ 0) +#define _DPRINTFN(n, args...) do {} while (/* CONSTCOND */ 0) +#endif /* !DPRINTF_ENABLE */ + +#else /* !__DPRINTF_EXT */ /* * normal debug printf */ + #ifdef DPRINTF_ENABLE -#ifndef DPRINTF_DEBUG -#error specify unique debug symbol -#endif -#ifndef DPRINTF_LEVEL -#define DPRINTF_LEVEL 1 -#endif -int DPRINTF_DEBUG = DPRINTF_LEVEL; -#define DPRINTF(arg) if (DPRINTF_DEBUG) printf arg -#define DPRINTFN(n, arg) if (DPRINTF_DEBUG (n)) printf arg -#else /* DPRINTF_ENABLE */ -#define DPRINTF(arg) ((void)0) -#define DPRINTFN(n, arg) ((void)0) -#endif /* DPRINTF_ENABLE */ -#endif /* __DPRINT_EXT */ +#define DPRINTF(arg) do { \ + if (DPRINTF_DEBUG) \ + printf arg; \ + } while (/* CONSTCOND */0) + +#define DPRINTFN(n, arg) do { \ + if (DPRINTF_DEBUG (n)) \ + printf arg; \ + } while (/* CONSTCOND */0) + +#else /* !DPRINTF_ENABLE */ +#define DPRINTF(arg) do {} while (/* CONSTCOND */ 0) +#define DPRINTFN(n, arg) do {} while (/* CONSTCOND */ 0) +#endif /* !DPRINTF_ENABLE */ + +#endif /* !__DPRINT_EXT */ #endif /* USE_HPC_DPRINTF */ + /* * debug print utility */ #define DBG_BIT_PRINT_COUNT (1 0) #define DBG_BIT_PRINT_QUIET (1 1) -#define dbg_bit_print(a) \ - __dbg_bit_print((a), sizeof(typeof(a)), 0, 0, 0, DBG_BIT_PRINT_COUNT) -#define dbg_bit_print_msg(a, m) \ - __dbg_bit_print((a), sizeof(typeof(a)), 0, 0, (m), DBG_BIT_PRINT_COUNT) -#define dbg_bit_display(a) \ - __dbg_bit_print((a), sizeof(typeof(a)), 0, 0, 0, DBG_BIT_PRINT_QUIET) -void __dbg_bit_print(u_int32_t, int, int, int, const char *, int); -void dbg_bitmask_print(u_int32_t, u_int32_t, const char *); + +void __dbg_bit_print(uint32_t, int, int, int, const char *, int); + +#define dbg_bit_print(a) do { \ + __dbg_bit_print((a), sizeof(typeof(a)), 0, 0, NULL, \ + DBG_BIT_PRINT_COUNT);\ + } while (/* CONSTCOND */0) + +#define dbg_bit_print_msg(a, m) do { \ + __dbg_bit_print((a), sizeof(typeof(a)), 0, 0,
CVS commit: src/sys/arch/hpc/include
Module Name:src Committed By: chs Date: Sun Aug 8 16:27:30 UTC 2010 Modified Files: src/sys/arch/hpc/include: debug.h Log Message: fix build problem. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hpc/include/debug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/hpc/include/debug.h diff -u src/sys/arch/hpc/include/debug.h:1.9 src/sys/arch/hpc/include/debug.h:1.10 --- src/sys/arch/hpc/include/debug.h:1.9 Mon Apr 28 20:23:20 2008 +++ src/sys/arch/hpc/include/debug.h Sun Aug 8 16:27:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: debug.h,v 1.9 2008/04/28 20:23:20 martin Exp $ */ +/* $NetBSD: debug.h,v 1.10 2010/08/08 16:27:30 chs Exp $ */ /*- * Copyright (c) 1999-2002 The NetBSD Foundation, Inc. @@ -114,8 +114,8 @@ void dbg_banner_line(void); #define dbg_banner_function() \ { \ - const char funcname[] = __func__;\ - dbg_banner_title(funcname, sizeof funcname); \ + const char *funcname = __func__;\ + dbg_banner_title(funcname, strlen (funcname)); \ } /* HPC_DEBUG_LCD */
CVS commit: src/sys/arch/hpc/include
Module Name:src Committed By: nonaka Date: Tue Apr 6 16:23:17 UTC 2010 Modified Files: src/sys/arch/hpc/include: platid_generated.h platid_mask.h Log Message: regen. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpc/include/platid_generated.h \ src/sys/arch/hpc/include/platid_mask.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/hpc/include/platid_generated.h diff -u src/sys/arch/hpc/include/platid_generated.h:1.23 src/sys/arch/hpc/include/platid_generated.h:1.24 --- src/sys/arch/hpc/include/platid_generated.h:1.23 Thu Jan 29 21:20:42 2009 +++ src/sys/arch/hpc/include/platid_generated.h Tue Apr 6 16:23:17 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: platid_generated.h,v 1.23 2009/01/29 21:20:42 nonaka Exp $ */ +/* $NetBSD: platid_generated.h,v 1.24 2010/04/06 16:23:17 nonaka Exp $ */ /*- * Copyright (c) 1999-2001 @@ -560,13 +560,14 @@ ((PLATID_MACH_CASIO_CASSIOPEIAA_A55V_NUM PLATID_SUBMODEL_SHIFT)| \ PLATID_MACH_CASIO_CASSIOPEIAA_AXX) #endif /* hpcsh */ -#ifdef hpcmips +#if defined(hpcmips) || defined(hpcarm) #ifndef SPEC_PLATFORM #define SPEC_MACH_SHARP #endif /* !SPEC_PLATFORM */ #define PLATID_MACH_SHARP_NUM 4 #define PLATID_MACH_SHARP \ ((PLATID_MACH_SHARP_NUM PLATID_VENDOR_SHIFT)) +#if defined(hpcmips) #ifndef SPEC_PLATFORM #define SPEC_MACH_SHARP_TRIPAD #endif /* !SPEC_PLATFORM */ @@ -673,6 +674,51 @@ ((PLATID_MACH_SHARP_MOBILON_HC1200_NUM PLATID_SUBMODEL_SHIFT)| \ PLATID_MACH_SHARP_MOBILON_HC) #endif /* hpcmips */ +#if defined(hpcarm) +#ifndef SPEC_PLATFORM +#define SPEC_MACH_SHARP_WZERO3 +#endif /* !SPEC_PLATFORM */ +#define PLATID_MACH_SHARP_WZERO3_NUM 4 +#define PLATID_MACH_SHARP_WZERO3 \ + ((PLATID_MACH_SHARP_WZERO3_NUM PLATID_SERIES_SHIFT)| \ +PLATID_MACH_SHARP) +#ifndef SPEC_PLATFORM +#define SPEC_MACH_SHARP_WZERO3_WS003SH +#endif /* !SPEC_PLATFORM */ +#define PLATID_MACH_SHARP_WZERO3_WS003SH_NUM 1 +#define PLATID_MACH_SHARP_WZERO3_WS003SH \ + ((PLATID_MACH_SHARP_WZERO3_WS003SH_NUM PLATID_MODEL_SHIFT)| \ +PLATID_MACH_SHARP_WZERO3) +#ifndef SPEC_PLATFORM +#define SPEC_MACH_SHARP_WZERO3_WS004SH +#endif /* !SPEC_PLATFORM */ +#define PLATID_MACH_SHARP_WZERO3_WS004SH_NUM 2 +#define PLATID_MACH_SHARP_WZERO3_WS004SH \ + ((PLATID_MACH_SHARP_WZERO3_WS004SH_NUM PLATID_MODEL_SHIFT)| \ +PLATID_MACH_SHARP_WZERO3) +#ifndef SPEC_PLATFORM +#define SPEC_MACH_SHARP_WZERO3_WS007SH +#endif /* !SPEC_PLATFORM */ +#define PLATID_MACH_SHARP_WZERO3_WS007SH_NUM 3 +#define PLATID_MACH_SHARP_WZERO3_WS007SH \ + ((PLATID_MACH_SHARP_WZERO3_WS007SH_NUM PLATID_MODEL_SHIFT)| \ +PLATID_MACH_SHARP_WZERO3) +#ifndef SPEC_PLATFORM +#define SPEC_MACH_SHARP_WZERO3_WS011SH +#endif /* !SPEC_PLATFORM */ +#define PLATID_MACH_SHARP_WZERO3_WS011SH_NUM 4 +#define PLATID_MACH_SHARP_WZERO3_WS011SH \ + ((PLATID_MACH_SHARP_WZERO3_WS011SH_NUM PLATID_MODEL_SHIFT)| \ +PLATID_MACH_SHARP_WZERO3) +#ifndef SPEC_PLATFORM +#define SPEC_MACH_SHARP_WZERO3_WS020SH +#endif /* !SPEC_PLATFORM */ +#define PLATID_MACH_SHARP_WZERO3_WS020SH_NUM 5 +#define PLATID_MACH_SHARP_WZERO3_WS020SH \ + ((PLATID_MACH_SHARP_WZERO3_WS020SH_NUM PLATID_MODEL_SHIFT)| \ +PLATID_MACH_SHARP_WZERO3) +#endif /* hpcarm */ +#endif /* hpcmips || hpcarm */ #ifdef hpcmips #ifndef SPEC_PLATFORM #define SPEC_MACH_FUJITSU Index: src/sys/arch/hpc/include/platid_mask.h diff -u src/sys/arch/hpc/include/platid_mask.h:1.23 src/sys/arch/hpc/include/platid_mask.h:1.24 --- src/sys/arch/hpc/include/platid_mask.h:1.23 Thu Jan 29 21:20:42 2009 +++ src/sys/arch/hpc/include/platid_mask.h Tue Apr 6 16:23:17 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: platid_mask.h,v 1.23 2009/01/29 21:20:42 nonaka Exp $ */ +/* $NetBSD: platid_mask.h,v 1.24 2010/04/06 16:23:17 nonaka Exp $ */ /*- * Copyright (c) 1999-2001 @@ -398,11 +398,12 @@ # define CASIO_CASSIOPEIAA_A55V ((int)platid_mask_MACH_CASIO_CASSIOPEIAA_A55V) #endif #endif /* hpcsh */ -#ifdef hpcmips +#if defined(hpcmips) || defined(hpcarm) extern platid_t platid_mask_MACH_SHARP; #ifdef PLATID_DEFINE_MASK_NICKNAME # define SHARP ((int)platid_mask_MACH_SHARP) #endif +#if defined(hpcmips) extern platid_t platid_mask_MACH_SHARP_TRIPAD; #ifdef PLATID_DEFINE_MASK_NICKNAME # define SHARP_TRIPAD ((int)platid_mask_MACH_SHARP_TRIPAD) @@ -464,6 +465,33 @@ # define SHARP_MOBILON_HC1200 ((int)platid_mask_MACH_SHARP_MOBILON_HC1200) #endif #endif /* hpcmips */ +#if defined(hpcarm) +extern platid_t platid_mask_MACH_SHARP_WZERO3; +#ifdef PLATID_DEFINE_MASK_NICKNAME +# define SHARP_WZERO3 ((int)platid_mask_MACH_SHARP_WZERO3) +#endif +extern platid_t platid_mask_MACH_SHARP_WZERO3_WS003SH; +#ifdef PLATID_DEFINE_MASK_NICKNAME +# define SHARP_WZERO3_WS003SH ((int)platid_mask_MACH_SHARP_WZERO3_WS003SH) +#endif +extern platid_t platid_mask_MACH_SHARP_WZERO3_WS004SH; +#ifdef PLATID_DEFINE_MASK_NICKNAME +# define SHARP_WZERO3_WS004SH