Cleaner MKSYSDEBUG option

This commit is contained in:
Arun Thomas 2011-08-18 14:56:34 +02:00
parent 6811647e20
commit 27c0e801f2
7 changed files with 7 additions and 6 deletions

View file

@ -70,6 +70,7 @@ SRCS+= breakpoints.c debugreg.S
# Extra debugging routines # Extra debugging routines
.if ${USE_SYSDEBUG} != "no" .if ${USE_SYSDEBUG} != "no"
SRCS+= debug.c SRCS+= debug.c
CPPFLAGS+= -DUSE_SYSDEBUG
.endif .endif
# These come last, so the profiling buffer is at the end of the data segment # These come last, so the profiling buffer is at the end of the data segment

View file

@ -395,7 +395,7 @@ PUBLIC void arch_init(void)
#endif #endif
} }
#if DEBUG_SERIAL #ifdef DEBUG_SERIAL
PUBLIC void ser_putc(char c) PUBLIC void ser_putc(char c)
{ {
int i; int i;

View file

@ -140,7 +140,7 @@ PUBLIC int timer_int_handler(void)
TMR_NEVER : clock_timers->tmr_exp_time; TMR_NEVER : clock_timers->tmr_exp_time;
} }
#if DEBUG_SERIAL #ifdef DEBUG_SERIAL
if (do_serial_debug) if (do_serial_debug)
do_ser_debug(); do_ser_debug();
#endif #endif

View file

@ -50,7 +50,7 @@
/* DEBUG_IPCSTATS collects information on who sends messages to whom. */ /* DEBUG_IPCSTATS collects information on who sends messages to whom. */
#define DEBUG_IPCSTATS 0 #define DEBUG_IPCSTATS 0
#if USE_SMALL #if !USE_SYSDEBUG
#undef DEBUG_SERIAL #undef DEBUG_SERIAL
#undef DEBUG_ENABLE_IPC_WARNINGS #undef DEBUG_ENABLE_IPC_WARNINGS
#endif #endif

View file

@ -84,7 +84,7 @@ PUBLIC void cstart(
if(!value || system_hz < 2 || system_hz > 50000) /* sanity check */ if(!value || system_hz < 2 || system_hz > 50000) /* sanity check */
system_hz = DEFAULT_HZ; system_hz = DEFAULT_HZ;
#if DEBUG_SERIAL #ifdef DEBUG_SERIAL
/* Intitialize serial debugging */ /* Intitialize serial debugging */
value = env_get(SERVARNAME); value = env_get(SERVARNAME);
if(value && atoi(value) == 0) { if(value && atoi(value) == 0) {

View file

@ -50,7 +50,7 @@ int c; /* character to append */
* to the output driver if an END_OF_KMESS is encountered. * to the output driver if an END_OF_KMESS is encountered.
*/ */
if (c != END_OF_KMESS) { if (c != END_OF_KMESS) {
#if DEBUG_SERIAL #ifdef DEBUG_SERIAL
if (do_serial_debug) { if (do_serial_debug) {
if(c == '\n') if(c == '\n')
ser_putc('\r'); ser_putc('\r');

View file

@ -247,5 +247,5 @@ NBSD_LIBC= yes
.if ${COMPILER_TYPE} == "gnu" && defined(MKSMALL) && ${MKSMALL} == "yes" .if ${COMPILER_TYPE} == "gnu" && defined(MKSMALL) && ${MKSMALL} == "yes"
DBG= -Os DBG= -Os
CFLAGS+= -DNDEBUG=1 -DUSE_SMALL=1 CFLAGS+= -DNDEBUG
.endif .endif