From a98bc05f650e57516a8e40d8627f81ece66ee1ca Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 14 Jun 2016 09:07:53 -0600 Subject: [PATCH] New debug macro: alert(). This is high priority, unconditional output and is used to simplify and stanardize crash error reporting. --- arch/arm/src/arm/up_assert.c | 76 ++++++-------------- arch/arm/src/arm/up_dataabort.c | 34 +-------- arch/arm/src/arm/up_prefetchabort.c | 19 +---- arch/arm/src/arm/up_syscall.c | 39 ++-------- arch/arm/src/arm/up_undefinedinsn.c | 31 +------- arch/arm/src/armv6-m/up_assert.c | 88 ++++++++--------------- arch/arm/src/armv6-m/up_dumpnvic.c | 13 +--- arch/arm/src/armv7-a/arm_assert.c | 84 ++++++++-------------- arch/arm/src/armv7-a/arm_dataabort.c | 21 +----- arch/arm/src/armv7-a/arm_prefetchabort.c | 21 +----- arch/arm/src/armv7-a/arm_syscall.c | 47 +++++-------- arch/arm/src/armv7-a/arm_undefinedinsn.c | 19 +---- arch/arm/src/armv7-m/up_assert.c | 90 ++++++++---------------- arch/arm/src/armv7-r/arm_assert.c | 36 ++-------- arch/arm/src/armv7-r/arm_dataabort.c | 19 +---- arch/arm/src/armv7-r/arm_prefetchabort.c | 19 +---- arch/arm/src/armv7-r/arm_syscall.c | 55 ++++++--------- arch/arm/src/armv7-r/arm_undefinedinsn.c | 19 +---- arch/arm/src/kl/kl_dumpgpio.c | 16 ++--- arch/arm/src/lpc11xx/lpc11_gpiodbg.c | 41 +++++------ arch/arm/src/lpc17xx/lpc17_gpiodbg.c | 43 ++++++----- arch/arm/src/sama5/sama5d3x4x_pio.c | 4 -- arch/arm/src/stm32/stm32_dumpgpio.c | 4 -- arch/arm/src/tiva/tiva_dumpgpio.c | 4 -- arch/avr/src/avr/up_dumpstate.c | 57 ++++++--------- arch/avr/src/avr32/up_dumpstate.c | 51 ++++++-------- arch/avr/src/common/up_assert.c | 42 ++--------- arch/hc/src/m9s12/m9s12_assert.c | 78 ++++++-------------- arch/hc/src/m9s12/m9s12_dumpgpio.c | 66 ++++++++--------- arch/mips/src/mips32/up_assert.c | 40 ++--------- arch/mips/src/mips32/up_dumpstate.c | 49 +++++-------- arch/sh/src/common/up_assert.c | 27 ++----- arch/sh/src/m16c/m16c_dumpstate.c | 51 +++++--------- arch/sh/src/sh1/sh1_dumpstate.c | 55 +++++---------- arch/x86/src/common/up_assert.c | 34 +-------- arch/x86/src/i486/up_regdump.c | 34 ++------- arch/z16/src/common/up_assert.c | 25 ++----- arch/z16/src/common/up_registerdump.c | 35 +++------ arch/z16/src/common/up_stackdump.c | 25 ++----- arch/z80/src/common/up_assert.c | 33 ++------- arch/z80/src/common/up_stackdump.c | 35 +++------ arch/z80/src/ez80/ez80_registerdump.c | 45 +++++------- arch/z80/src/z180/z180_registerdump.c | 33 +++------ arch/z80/src/z8/z8_registerdump.c | 25 ++----- arch/z80/src/z80/z80_registerdump.c | 35 +++------ include/debug.h | 26 +++++-- libc/misc/lib_debug.c | 26 +++++-- 47 files changed, 517 insertions(+), 1252 deletions(-) diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 5c0ed9a678..05fbbbb031 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_assert.c * - * Copyright (C) 2007-2010, 2012-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2012-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,19 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include #include @@ -79,23 +66,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -129,7 +99,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { uint32_t *ptr = (uint32_t *)stack; - llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -156,12 +126,12 @@ static inline void up_registerdump(void) for (regs = REG_R0; regs <= REG_R15; regs += 8) { uint32_t *ptr = (uint32_t *)&CURRENT_REGS[regs]; - llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } - llerr("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]); + alert("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]); } } #else @@ -230,12 +200,12 @@ static void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %08x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %08x\n", istackbase); - llerr(" size: %08x\n", istacksize); + alert("sp: %08x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %08x\n", istackbase); + alert(" size: %08x\n", istacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_intstack()); + alert(" used: %08x\n", up_check_intstack()); #endif /* Does the current stack pointer lie within the interrupt @@ -253,24 +223,24 @@ static void up_dumpstate(void) */ sp = g_intstackbase; - llerr("sp: %08x\n", sp); + alert("sp: %08x\n", sp); } /* Show user stack info */ - llerr("User stack:\n"); - llerr(" base: %08x\n", ustackbase); - llerr(" size: %08x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %08x\n", ustackbase); + alert(" size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_tcbstack(rtcb)); + alert(" used: %08x\n", up_check_tcbstack(rtcb)); #endif #else - llerr("sp: %08x\n", sp); - llerr("stack base: %08x\n", ustackbase); - llerr("stack size: %08x\n", ustacksize); + alert("sp: %08x\n", sp); + alert("stack base: %08x\n", ustackbase); + alert("stack size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr("stack used: %08x\n", up_check_tcbstack(rtcb)); + alert("stack used: %08x\n", up_check_tcbstack(rtcb)); #endif #endif @@ -281,7 +251,7 @@ static void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { #if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4 - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); #endif } else @@ -341,17 +311,17 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - llerr("Assertion failed at file:%s line: %d task: %s\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/arm/src/arm/up_dataabort.c b/arch/arm/src/arm/up_dataabort.c index 6b547bdea6..621a42d328 100644 --- a/arch/arm/src/arm/up_dataabort.c +++ b/arch/arm/src/arm/up_dataabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_dataabort.c * - * Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -67,18 +52,6 @@ # include "arm.h" #endif -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -116,7 +89,6 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr) * for register dumps and possibly context switching. */ - savestate = (uint32_t *)CURRENT_REGS; #endif CURRENT_REGS = regs; @@ -184,7 +156,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr) segfault: #endif - llerr("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr); + alert("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr); PANIC(); } @@ -200,7 +172,7 @@ void up_dataabort(uint32_t *regs) /* Crash -- possibly showing diagnost debug information. */ - llerr("Data abort. PC: %08x\n", regs[REG_PC]); + alert("Data abort. PC: %08x\n", regs[REG_PC]); PANIC(); } diff --git a/arch/arm/src/arm/up_prefetchabort.c b/arch/arm/src/arm/up_prefetchabort.c index 998024a8f9..5d9d9561dc 100644 --- a/arch/arm/src/arm/up_prefetchabort.c +++ b/arch/arm/src/arm/up_prefetchabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_prefetchabort.c * - * Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -152,7 +137,7 @@ void up_prefetchabort(uint32_t *regs) else #endif { - llerr("Prefetch abort. PC: %08x\n", regs[REG_PC]); + alert("Prefetch abort. PC: %08x\n", regs[REG_PC]); PANIC(); } } diff --git a/arch/arm/src/arm/up_syscall.c b/arch/arm/src/arm/up_syscall.c index e6d07f9ecd..f7ee6f1312 100644 --- a/arch/arm/src/arm/up_syscall.c +++ b/arch/arm/src/arm/up_syscall.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_syscall.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -62,22 +47,6 @@ #include "up_arch.h" #include "up_internal.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * vectors - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -86,8 +55,8 @@ * Name: up_syscall * * Description: - * SWI interrupts will vection here with insn=the SWI - * instruction and xcp=the interrupt context + * SWI interrupts will vector here with insn=the SWI instruction and + * xcp=the interrupt context * * The handler may get the SWI number be de-referencing * the return address saved in the xcp and decoding @@ -97,7 +66,7 @@ void up_syscall(uint32_t *regs) { - llerr("Syscall from 0x%x\n", regs[REG_PC]); + alert("Syscall from 0x%x\n", regs[REG_PC]); CURRENT_REGS = regs; PANIC(); } diff --git a/arch/arm/src/arm/up_undefinedinsn.c b/arch/arm/src/arm/up_undefinedinsn.c index 2326ae9b0e..22a895b816 100644 --- a/arch/arm/src/arm/up_undefinedinsn.c +++ b/arch/arm/src/arm/up_undefinedinsn.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/arm/up_undefinedinsn.c * - * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -62,18 +47,6 @@ #include "up_internal.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -84,7 +57,7 @@ void up_undefinedinsn(uint32_t *regs) { - llerr("Undefined instruction at 0x%x\n", regs[REG_PC]); + alert("Undefined instruction at 0x%x\n", regs[REG_PC]); CURRENT_REGS = regs; PANIC(); } diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index 4e38270d0f..ef1757126a 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv6-m/up_assert.c * - * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2015, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -80,23 +65,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -130,7 +98,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { uint32_t *ptr = (uint32_t *)stack; - llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -148,12 +116,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg) { /* Dump interesting properties of this task */ -#ifdef CONFIG_PRINT_TASKNAME - llerr("%s: PID=%d Stack Used=%lu of %lu\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("%s: PID=%d Stack Used=%lu of %lu\n", tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size); #else - llerr("PID: %d Stack Used=%lu of %lu\n", + alert("PID: %d Stack Used=%lu of %lu\n", tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size); #endif @@ -188,22 +156,22 @@ static inline void up_registerdump(void) { /* Yes.. dump the interrupt registers */ - llerr("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1], CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3], CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5], CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]); - llerr("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9], CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11], CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13], CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]); #ifdef CONFIG_BUILD_PROTECTED - llerr("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n", + alert("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK], CURRENT_REGS[REG_EXC_RETURN]); #else - llerr("xPSR: %08x PRIMASK: %08x\n", + alert("xPSR: %08x PRIMASK: %08x\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]); #endif } @@ -274,12 +242,12 @@ static void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %08x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %08x\n", istackbase); - llerr(" size: %08x\n", istacksize); + alert("sp: %08x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %08x\n", istackbase); + alert(" size: %08x\n", istacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_intstack()); + alert(" used: %08x\n", up_check_intstack()); #endif /* Does the current stack pointer lie within the interrupt @@ -301,14 +269,14 @@ static void up_dumpstate(void) if (CURRENT_REGS) { sp = CURRENT_REGS[REG_R13]; - llerr("sp: %08x\n", sp); + alert("sp: %08x\n", sp); } - llerr("User stack:\n"); - llerr(" base: %08x\n", ustackbase); - llerr(" size: %08x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %08x\n", ustackbase); + alert(" size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_tcbstack(rtcb)); + alert(" used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -321,11 +289,11 @@ static void up_dumpstate(void) } #else - llerr("sp: %08x\n", sp); - llerr("stack base: %08x\n", ustackbase); - llerr("stack size: %08x\n", ustacksize); + alert("sp: %08x\n", sp); + alert("stack base: %08x\n", ustackbase); + alert("stack size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr("stack used: %08x\n", up_check_tcbstack(rtcb)); + alert("stack used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -334,7 +302,7 @@ static void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); } else { @@ -398,17 +366,17 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - llerr("Assertion failed at file:%s line: %d task: %s\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/arm/src/armv6-m/up_dumpnvic.c b/arch/arm/src/armv6-m/up_dumpnvic.c index 678e8efefc..a50d91aac0 100644 --- a/arch/arm/src/armv6-m/up_dumpnvic.c +++ b/arch/arm/src/armv6-m/up_dumpnvic.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv6-m/up_dumpnvic.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,15 +39,6 @@ #include -/* Output debug info even if debug output is not selected. */ - -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -73,6 +64,7 @@ void up_dumpnvic(FAR const char *msg) { +#ifdef CONFIG_DEBUG_INFO irqstate_t flags; int i; @@ -103,6 +95,7 @@ void up_dumpnvic(FAR const char *msg) getreg32(ARMV6M_SYSCON_SHPR3)); leave_critical_section(flags); +#endif } #endif /* CONFIG_DEBUG_FEATURES */ diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 1d8e1c8fec..d79200e0f5 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_assert.c * - * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -79,19 +64,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -125,7 +97,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { uint32_t *ptr = (uint32_t *)stack; - llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -143,12 +115,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg) { /* Dump interesting properties of this task */ -#ifdef CONFIG_PRINT_TASKNAME - llerr("%s: PID=%d Stack Used=%lu of %lu\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("%s: PID=%d Stack Used=%lu of %lu\n", tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size); #else - llerr("PID: %d Stack Used=%lu of %lu\n", + alert("PID: %d Stack Used=%lu of %lu\n", tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size); #endif @@ -188,12 +160,12 @@ static inline void up_registerdump(void) for (regs = REG_R0; regs <= REG_R15; regs += 8) { uint32_t *ptr = (uint32_t *)&CURRENT_REGS[regs]; - llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } - llerr("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]); + alert("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]); } } #else @@ -257,7 +229,7 @@ static void up_dumpstate(void) ustacksize = (uint32_t)rtcb->adj_stack_size; } - llerr("Current sp: %08x\n", sp); + alert("Current sp: %08x\n", sp); #if CONFIG_ARCH_INTERRUPTSTACK > 3 /* Get the limits on the interrupt stack memory */ @@ -267,21 +239,21 @@ static void up_dumpstate(void) /* Show interrupt stack info */ - llerr("Interrupt stack:\n"); - llerr(" base: %08x\n", istackbase); - llerr(" size: %08x\n", istacksize); + alert("Interrupt stack:\n"); + alert(" base: %08x\n", istackbase); + alert(" size: %08x\n", istacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_intstack()); + alert(" used: %08x\n", up_check_intstack()); #endif #endif /* Show user stack info */ - llerr("User stack:\n"); - llerr(" base: %08x\n", ustackbase); - llerr(" size: %08x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %08x\n", ustackbase); + alert(" size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_tcbstack(rtcb)); + alert(" used: %08x\n", up_check_tcbstack(rtcb)); #endif #ifdef CONFIG_ARCH_KERNEL_STACK @@ -291,9 +263,9 @@ static void up_dumpstate(void) { kstackbase = (uint32_t)rtcb->xcp.kstack + CONFIG_ARCH_KERNEL_STACKSIZE - 4; - llerr("Kernel stack:\n"); - llerr(" base: %08x\n", kstackbase); - llerr(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE); + alert("Kernel stack:\n"); + alert(" base: %08x\n", kstackbase); + alert(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE); } #endif @@ -304,7 +276,7 @@ static void up_dumpstate(void) { /* Yes.. dump the interrupt stack */ - llerr("Interrupt Stack\n", sp); + alert("Interrupt Stack\n", sp); up_stackdump(sp, istackbase); /* Extract the user stack pointer which should lie @@ -312,7 +284,7 @@ static void up_dumpstate(void) */ sp = g_intstackbase; - llerr("User sp: %08x\n", sp); + alert("User sp: %08x\n", sp); } #endif @@ -322,7 +294,7 @@ static void up_dumpstate(void) if (sp > ustackbase - ustacksize && sp < ustackbase) { - llerr("User Stack\n", sp); + alert("User Stack\n", sp); up_stackdump(sp, ustackbase); } @@ -333,7 +305,7 @@ static void up_dumpstate(void) if (sp >= (uint32_t)rtcb->xcp.kstack && sp < kstackbase) { - llerr("Kernel Stack\n", sp); + alert("Kernel Stack\n", sp); up_stackdump(sp, kstackbase); } #endif @@ -341,7 +313,7 @@ static void up_dumpstate(void) #ifdef CONFIG_SMP /* Show the CPU number */ - llerr("CPU%d:\n", up_cpu_index()); + alert("CPU%d:\n", up_cpu_index()); #endif /* Then dump the CPU registers (if available) */ @@ -400,16 +372,16 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - llerr("Assertion failed at file:%s line: %d task: %s\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif up_dumpstate(); diff --git a/arch/arm/src/armv7-a/arm_dataabort.c b/arch/arm/src/armv7-a/arm_dataabort.c index 0ec5df5513..00a686f8a7 100644 --- a/arch/arm/src/armv7-a/arm_dataabort.c +++ b/arch/arm/src/armv7-a/arm_dataabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_dataabort.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -167,7 +152,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr) return regs; segfault: - llerr("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n", + alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n", regs[REG_PC], dfar, dfsr); PANIC(); return regs; /* To keep the compiler happy */ @@ -185,7 +170,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr) /* Crash -- possibly showing diagnostic debug information. */ - llerr("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n", + alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n", regs[REG_PC], dfar, dfsr); PANIC(); return regs; /* To keep the compiler happy */ diff --git a/arch/arm/src/armv7-a/arm_prefetchabort.c b/arch/arm/src/armv7-a/arm_prefetchabort.c index 68e88a6f48..a6b73e3ad2 100644 --- a/arch/arm/src/armv7-a/arm_prefetchabort.c +++ b/arch/arm/src/armv7-a/arm_prefetchabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_prefetchabort.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -138,7 +123,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr) } else { - llerr("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n", + alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n", regs[REG_PC], ifar, ifsr); PANIC(); } @@ -158,7 +143,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr) /* Crash -- possibly showing diagnostic debug information. */ - llerr("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n", + alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n", regs[REG_PC], ifar, ifsr); PANIC(); return regs; /* To keep the compiler happy */ diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index e331edabd8..c9505aaadf 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_syscall.c * - * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -75,9 +60,13 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_SYSCALL) -# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) +# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) +# define svcwarn(format, ...) llwarn(format, ##__VA_ARGS__) +# define svcinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else # define svcerr(x...) +# define svcwarn(x...) +# define svcinfo(x...) #endif /**************************************************************************** @@ -183,14 +172,14 @@ uint32_t *arm_syscall(uint32_t *regs) */ #if defined(CONFIG_DEBUG_SYSCALL) - svcerr("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); - svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcinfo("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); + svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcerr("CPSR: %08x\n", regs[REG_CPSR]); + svcinfo("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Handle the SVCall according to the command in R0 */ @@ -508,14 +497,14 @@ uint32_t *arm_syscall(uint32_t *regs) #if defined(CONFIG_DEBUG_SYSCALL) /* Report what happened */ - svcerr("SYSCALL Exit: regs: %p\n", regs); - svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], - regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], + svcinfo("SYSCALL Exit: regs: %p\n", regs); + svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); + svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcerr("CPSR: %08x\n", regs[REG_CPSR]); + svcinfo("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Return the last value of curent_regs. This supports context switches @@ -530,7 +519,7 @@ uint32_t *arm_syscall(uint32_t *regs) uint32_t *arm_syscall(uint32_t *regs) { - llerr("SYSCALL from 0x%x\n", regs[REG_PC]); + alert("SYSCALL from 0x%x\n", regs[REG_PC]); CURRENT_REGS = regs; PANIC(); } diff --git a/arch/arm/src/armv7-a/arm_undefinedinsn.c b/arch/arm/src/armv7-a/arm_undefinedinsn.c index 899d0a099e..70442b49ff 100644 --- a/arch/arm/src/armv7-a/arm_undefinedinsn.c +++ b/arch/arm/src/armv7-a/arm_undefinedinsn.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_undefinedinsn.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -72,7 +57,7 @@ uint32_t *arm_undefinedinsn(uint32_t *regs) { - llerr("Undefined instruction at 0x%x\n", regs[REG_PC]); + alert("Undefined instruction at 0x%x\n", regs[REG_PC]); CURRENT_REGS = regs; PANIC(); return regs; /* To keep the compiler happy */ diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index c7e770fb88..fbf29b29e7 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_assert.c * - * Copyright (C) 2009-2010, 2012-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2012-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -79,23 +64,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -129,7 +97,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { uint32_t *ptr = (uint32_t *)stack; - llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -147,12 +115,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg) { /* Dump interesting properties of this task */ -#ifdef CONFIG_PRINT_TASKNAME - llerr("%s: PID=%d Stack Used=%lu of %lu\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("%s: PID=%d Stack Used=%lu of %lu\n", tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size); #else - llerr("PID: %d Stack Used=%lu of %lu\n", + alert("PID: %d Stack Used=%lu of %lu\n", tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size); #endif @@ -187,29 +155,29 @@ static inline void up_registerdump(void) { /* Yes.. dump the interrupt registers */ - llerr("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1], CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3], CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5], CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]); - llerr("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9], CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11], CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13], CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]); #ifdef CONFIG_ARMV7M_USEBASEPRI - llerr("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n", + alert("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI], getcontrol()); #else - llerr("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n", + alert("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK], getcontrol()); #endif #ifdef REG_EXC_RETURN - llerr("EXC_RETURN: %08x\n", CURRENT_REGS[REG_EXC_RETURN]); + alert("EXC_RETURN: %08x\n", CURRENT_REGS[REG_EXC_RETURN]); #endif } } @@ -279,12 +247,12 @@ static void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %08x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %08x\n", istackbase); - llerr(" size: %08x\n", istacksize); + alert("sp: %08x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %08x\n", istackbase); + alert(" size: %08x\n", istacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_intstack()); + alert(" used: %08x\n", up_check_intstack()); #endif /* Does the current stack pointer lie within the interrupt @@ -306,14 +274,14 @@ static void up_dumpstate(void) if (CURRENT_REGS) { sp = CURRENT_REGS[REG_R13]; - llerr("sp: %08x\n", sp); + alert("sp: %08x\n", sp); } - llerr("User stack:\n"); - llerr(" base: %08x\n", ustackbase); - llerr(" size: %08x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %08x\n", ustackbase); + alert(" size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_tcbstack(rtcb)); + alert(" used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -329,11 +297,11 @@ static void up_dumpstate(void) /* Show user stack info */ - llerr("sp: %08x\n", sp); - llerr("stack base: %08x\n", ustackbase); - llerr("stack size: %08x\n", ustacksize); + alert("sp: %08x\n", sp); + alert("stack base: %08x\n", ustackbase); + alert("stack size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr("stack used: %08x\n", up_check_tcbstack(rtcb)); + alert("stack used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -342,7 +310,7 @@ static void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { - llerr("ERROR: Stack pointer is not within the allocated stack\n"); + alert("ERROR: Stack pointer is not within the allocated stack\n"); } else { @@ -407,17 +375,17 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - llerr("Assertion failed at file:%s line: %d task: %s\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c index 790465d843..9218e4da8a 100644 --- a/arch/arm/src/armv7-r/arm_assert.c +++ b/arch/arm/src/armv7-r/arm_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-r/arm_assert.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -80,19 +65,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -144,7 +116,7 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg) { /* Dump interesting properties of this task */ -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 llerr("%s: PID=%d Stack Used=%lu of %lu\n", tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb), (unsigned long)tcb->adj_stack_size); @@ -395,12 +367,12 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 llerr("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else diff --git a/arch/arm/src/armv7-r/arm_dataabort.c b/arch/arm/src/armv7-r/arm_dataabort.c index aeb6654452..56cf88d8bc 100644 --- a/arch/arm/src/armv7-r/arm_dataabort.c +++ b/arch/arm/src/armv7-r/arm_dataabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-r/arm_dataabort.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -90,7 +75,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr) /* Crash -- possibly showing diagnostic debug information. */ - llerr("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n", + alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n", regs[REG_PC], dfar, dfsr); PANIC(); return regs; /* To keep the compiler happy */ diff --git a/arch/arm/src/armv7-r/arm_prefetchabort.c b/arch/arm/src/armv7-r/arm_prefetchabort.c index 8d000a16de..ee9c38be0a 100644 --- a/arch/arm/src/armv7-r/arm_prefetchabort.c +++ b/arch/arm/src/armv7-r/arm_prefetchabort.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-r/arm_prefetchabort.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -86,7 +71,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr) /* Crash -- possibly showing diagnostic debug information. */ - llerr("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n", + alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n", regs[REG_PC], ifar, ifsr); PANIC(); return regs; /* To keep the compiler happy */ diff --git a/arch/arm/src/armv7-r/arm_syscall.c b/arch/arm/src/armv7-r/arm_syscall.c index f3d2ae9f10..28fad77f4e 100644 --- a/arch/arm/src/armv7-r/arm_syscall.c +++ b/arch/arm/src/armv7-r/arm_syscall.c @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -74,9 +59,13 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_SYSCALL) -# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) +# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) +# define svcwarn(format, ...) llwarn(format, ##__VA_ARGS__) +# define svcinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else # define svcerr(x...) +# define svcwarn(x...) +# define svcinfo(x...) #endif /**************************************************************************** @@ -182,14 +171,14 @@ uint32_t *arm_syscall(uint32_t *regs) */ #if defined(CONFIG_DEBUG_SYSCALL) - svcerr("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); - svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], - regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], - regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcerr("CPSR: %08x\n", regs[REG_CPSR]); + svcinfo("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); + svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); + svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], + regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); + svcinfo("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Handle the SVCall according to the command in R0 */ @@ -507,14 +496,14 @@ uint32_t *arm_syscall(uint32_t *regs) #if defined(CONFIG_DEBUG_SYSCALL) /* Report what happened */ - svcerr("SYSCALL Exit: regs: %p\n", regs); - svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], - regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], - regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcerr("CPSR: %08x\n", regs[REG_CPSR]); + svcinfo("SYSCALL Exit: regs: %p\n", regs); + svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); + svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], + regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); + svcinfo("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Return the last value of curent_regs. This supports context switches @@ -529,7 +518,7 @@ uint32_t *arm_syscall(uint32_t *regs) uint32_t *arm_syscall(uint32_t *regs) { - llerr("SYSCALL from 0x%x\n", regs[REG_PC]); + alert("SYSCALL from 0x%x\n", regs[REG_PC]); CURRENT_REGS = regs; PANIC(); } diff --git a/arch/arm/src/armv7-r/arm_undefinedinsn.c b/arch/arm/src/armv7-r/arm_undefinedinsn.c index 8b5f8c689a..d23af75301 100644 --- a/arch/arm/src/armv7-r/arm_undefinedinsn.c +++ b/arch/arm/src/armv7-r/arm_undefinedinsn.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-r/arm_undefinedinsn.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -72,7 +57,7 @@ uint32_t *arm_undefinedinsn(uint32_t *regs) { - llerr("Undefined instruction at 0x%x\n", regs[REG_PC]); + alert("Undefined instruction at 0x%x\n", regs[REG_PC]); CURRENT_REGS = regs; PANIC(); return regs; /* To keep the compiler happy */ diff --git a/arch/arm/src/kl/kl_dumpgpio.c b/arch/arm/src/kl/kl_dumpgpio.c index ef41826e5b..60eea46009 100644 --- a/arch/arm/src/kl/kl_dumpgpio.c +++ b/arch/arm/src/kl/kl_dumpgpio.c @@ -41,11 +41,7 @@ /* Output debug info even if debug output is not selected. */ -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN #undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 #define CONFIG_DEBUG_INFO 1 #include @@ -122,12 +118,12 @@ void kl_dumpgpio(gpio_cfgset_t pinset, const char *msg) flags = enter_critical_section(); - llerr("GPIO%c pinset: %08x base: %08x -- %s\n", - g_portchar[port], pinset, base, msg); - llerr(" PDOR: %08x PDIR: %08x PDDR: %08x\n", - getreg32(base + KL_GPIO_PDOR_OFFSET), - getreg32(base + KL_GPIO_PDIR_OFFSET), - getreg32(base + KL_GPIO_PDDR_OFFSET)); + llinfo("GPIO%c pinset: %08x base: %08x -- %s\n", + g_portchar[port], pinset, base, msg); + llinfo(" PDOR: %08x PDIR: %08x PDDR: %08x\n", + getreg32(base + KL_GPIO_PDOR_OFFSET), + getreg32(base + KL_GPIO_PDIR_OFFSET), + getreg32(base + KL_GPIO_PDDR_OFFSET)); leave_critical_section(flags); } diff --git a/arch/arm/src/lpc11xx/lpc11_gpiodbg.c b/arch/arm/src/lpc11xx/lpc11_gpiodbg.c index b86b4973db..d88aeb7362 100644 --- a/arch/arm/src/lpc11xx/lpc11_gpiodbg.c +++ b/arch/arm/src/lpc11xx/lpc11_gpiodbg.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc11xx/lpc11_gpiodbg.c * - * Copyright (C) 2010-2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,11 +41,7 @@ /* Output debug info even if debug output is not selected. */ -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN #undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 #define CONFIG_DEBUG_INFO 1 #include @@ -158,32 +154,33 @@ int lpc11_dumpgpio(lpc11_pinset_t pinset, const char *msg) /* The following requires exclusive access to the GPIO registers */ flags = enter_critical_section(); - llerr("GPIO%c pin%d (pinset: %08x) -- %s\n", + llinfo("GPIO%c pin%d (pinset: %08x) -- %s\n", port + '0', pin, pinset, msg); #if defined(LPC176x) - llerr(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n", - pinsel, pinsel ? getreg32(pinsel) : 0, - pinmode, pinmode ? getreg32(pinmode) : 0, - g_odmode[port], getreg32(g_odmode[port])); + llinfo(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n", + pinsel, pinsel ? getreg32(pinsel) : 0, + pinmode, pinmode ? getreg32(pinmode) : 0, + g_odmode[port], getreg32(g_odmode[port])); #elif defined(LPC178x) - llerr(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon)); + llinfo(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon)); #endif base = g_fiobase[port]; - llerr(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n", - base+LPC11_FIO_DIR_OFFSET, getreg32(base+LPC11_FIO_DIR_OFFSET), - base+LPC11_FIO_MASK_OFFSET, getreg32(base+LPC11_FIO_MASK_OFFSET), - base+LPC11_FIO_PIN_OFFSET, getreg32(base+LPC11_FIO_PIN_OFFSET)); + llinfo(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n", + base+LPC11_FIO_DIR_OFFSET, getreg32(base+LPC11_FIO_DIR_OFFSET), + base+LPC11_FIO_MASK_OFFSET, getreg32(base+LPC11_FIO_MASK_OFFSET), + base+LPC11_FIO_PIN_OFFSET, getreg32(base+LPC11_FIO_PIN_OFFSET)); base = g_intbase[port]; - llerr(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n", - LPC11_GPIOINT_IOINTSTATUS, getreg32(LPC11_GPIOINT_IOINTSTATUS), - base+LPC11_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATR_OFFSET), - base+LPC11_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATF_OFFSET)); - llerr(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n", - base+LPC11_GPIOINT_INTENR_OFFSET, getreg32(base+LPC11_GPIOINT_INTENR_OFFSET), - base+LPC11_GPIOINT_INTENF_OFFSET, getreg32(base+LPC11_GPIOINT_INTENF_OFFSET)); + llinfo(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n", + LPC11_GPIOINT_IOINTSTATUS, getreg32(LPC11_GPIOINT_IOINTSTATUS), + base+LPC11_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATR_OFFSET), + base+LPC11_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC11_GPIOINT_INTSTATF_OFFSET)); + llinfo(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n", + base+LPC11_GPIOINT_INTENR_OFFSET, getreg32(base+LPC11_GPIOINT_INTENR_OFFSET), + base+LPC11_GPIOINT_INTENF_OFFSET, getreg32(base+LPC11_GPIOINT_INTENF_OFFSET)); + leave_critical_section(flags); return OK; } diff --git a/arch/arm/src/lpc17xx/lpc17_gpiodbg.c b/arch/arm/src/lpc17xx/lpc17_gpiodbg.c index 590aa80fb1..abe2534cdc 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpiodbg.c +++ b/arch/arm/src/lpc17xx/lpc17_gpiodbg.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc17xx/lpc17_gpiodbg.c * - * Copyright (C) 2010-2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,11 +41,7 @@ /* Output debug info even if debug output is not selected. */ -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN #undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 #define CONFIG_DEBUG_INFO 1 #include @@ -158,32 +154,33 @@ int lpc17_dumpgpio(lpc17_pinset_t pinset, const char *msg) /* The following requires exclusive access to the GPIO registers */ flags = enter_critical_section(); - llerr("GPIO%c pin%d (pinset: %08x) -- %s\n", - port + '0', pin, pinset, msg); + llinfo("GPIO%c pin%d (pinset: %08x) -- %s\n", + port + '0', pin, pinset, msg); #if defined(LPC176x) - llerr(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n", - pinsel, pinsel ? getreg32(pinsel) : 0, - pinmode, pinmode ? getreg32(pinmode) : 0, - g_odmode[port], getreg32(g_odmode[port])); + llinfo(" PINSEL[%08x]: %08x PINMODE[%08x]: %08x ODMODE[%08x]: %08x\n", + pinsel, pinsel ? getreg32(pinsel) : 0, + pinmode, pinmode ? getreg32(pinmode) : 0, + g_odmode[port], getreg32(g_odmode[port])); #elif defined(LPC178x) - llerr(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon)); + llinfo(" IOCON[%08x]: %08x\n", iocon, getreg32(iocon)); #endif base = g_fiobase[port]; - llerr(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n", - base+LPC17_FIO_DIR_OFFSET, getreg32(base+LPC17_FIO_DIR_OFFSET), - base+LPC17_FIO_MASK_OFFSET, getreg32(base+LPC17_FIO_MASK_OFFSET), - base+LPC17_FIO_PIN_OFFSET, getreg32(base+LPC17_FIO_PIN_OFFSET)); + llinfo(" FIODIR[%08x]: %08x FIOMASK[%08x]: %08x FIOPIN[%08x]: %08x\n", + base+LPC17_FIO_DIR_OFFSET, getreg32(base+LPC17_FIO_DIR_OFFSET), + base+LPC17_FIO_MASK_OFFSET, getreg32(base+LPC17_FIO_MASK_OFFSET), + base+LPC17_FIO_PIN_OFFSET, getreg32(base+LPC17_FIO_PIN_OFFSET)); base = g_intbase[port]; - llerr(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n", - LPC17_GPIOINT_IOINTSTATUS, getreg32(LPC17_GPIOINT_IOINTSTATUS), - base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET), - base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET)); - llerr(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n", - base+LPC17_GPIOINT_INTENR_OFFSET, getreg32(base+LPC17_GPIOINT_INTENR_OFFSET), - base+LPC17_GPIOINT_INTENF_OFFSET, getreg32(base+LPC17_GPIOINT_INTENF_OFFSET)); + llinfo(" IOINTSTATUS[%08x]: %08x INTSTATR[%08x]: %08x INSTATF[%08x]: %08x\n", + LPC17_GPIOINT_IOINTSTATUS, getreg32(LPC17_GPIOINT_IOINTSTATUS), + base+LPC17_GPIOINT_INTSTATR_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATR_OFFSET), + base+LPC17_GPIOINT_INTSTATF_OFFSET, getreg32(base+LPC17_GPIOINT_INTSTATF_OFFSET)); + llinfo(" INTENR[%08x]: %08x INTENF[%08x]: %08x\n", + base+LPC17_GPIOINT_INTENR_OFFSET, getreg32(base+LPC17_GPIOINT_INTENR_OFFSET), + base+LPC17_GPIOINT_INTENF_OFFSET, getreg32(base+LPC17_GPIOINT_INTENF_OFFSET)); + leave_critical_section(flags); return OK; } diff --git a/arch/arm/src/sama5/sama5d3x4x_pio.c b/arch/arm/src/sama5/sama5d3x4x_pio.c index 1fde4bacfe..5bd0e765f2 100644 --- a/arch/arm/src/sama5/sama5d3x4x_pio.c +++ b/arch/arm/src/sama5/sama5d3x4x_pio.c @@ -43,11 +43,7 @@ #ifdef CONFIG_DEBUG_GPIO /* Output informational debug info even if debug output is not enabled. */ -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 # define CONFIG_DEBUG_INFO 1 #endif diff --git a/arch/arm/src/stm32/stm32_dumpgpio.c b/arch/arm/src/stm32/stm32_dumpgpio.c index 3731e4158b..5de501f033 100644 --- a/arch/arm/src/stm32/stm32_dumpgpio.c +++ b/arch/arm/src/stm32/stm32_dumpgpio.c @@ -41,11 +41,7 @@ /* Output debug info even if debug output is not selected. */ -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN #undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 #define CONFIG_DEBUG_INFO 1 #include diff --git a/arch/arm/src/tiva/tiva_dumpgpio.c b/arch/arm/src/tiva/tiva_dumpgpio.c index f0f66756dd..dff948c376 100644 --- a/arch/arm/src/tiva/tiva_dumpgpio.c +++ b/arch/arm/src/tiva/tiva_dumpgpio.c @@ -41,11 +41,7 @@ /* Output debug info even if debug output is not selected. */ -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN #undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 #define CONFIG_DEBUG_INFO 1 #include diff --git a/arch/avr/src/avr/up_dumpstate.c b/arch/avr/src/avr/up_dumpstate.c index fa04857067..9e406b6cab 100644 --- a/arch/avr/src/avr/up_dumpstate.c +++ b/arch/avr/src/avr/up_dumpstate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/avr/up_dumpstate.c * - * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include #include @@ -101,7 +90,7 @@ static void up_stackdump(uint16_t sp, uint16_t stack_base) for (stack = sp & ~3; stack < stack_base; stack += 12) { uint8_t *ptr = (uint8_t *)stack; - llerr("%04x: %02x %02x %02x %02x %02x %02x %02x %02x" + alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x" " %02x %02x %02x %02x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7], @@ -119,28 +108,28 @@ static inline void up_registerdump(void) if (g_current_regs) { - llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", + alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", 0, g_current_regs[REG_R0], g_current_regs[REG_R1], g_current_regs[REG_R2], g_current_regs[REG_R3], g_current_regs[REG_R4], g_current_regs[REG_R5], g_current_regs[REG_R6], g_current_regs[REG_R7]); - llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", + alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", 8, g_current_regs[REG_R8], g_current_regs[REG_R9], g_current_regs[REG_R10], g_current_regs[REG_R11], g_current_regs[REG_R12], g_current_regs[REG_R13], g_current_regs[REG_R14], g_current_regs[REG_R15]); - llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", + alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", 16, g_current_regs[REG_R16], g_current_regs[REG_R17], g_current_regs[REG_R18], g_current_regs[REG_R19], g_current_regs[REG_R20], g_current_regs[REG_R21], g_current_regs[REG_R22], g_current_regs[REG_R23]); - llerr("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", + alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n", 24, g_current_regs[REG_R24], g_current_regs[REG_R25], g_current_regs[REG_R26], g_current_regs[REG_R27], @@ -148,12 +137,12 @@ static inline void up_registerdump(void) g_current_regs[REG_R30], g_current_regs[REG_R31]); #if !defined(REG_PC2) - llerr("PC: %02x%02x SP: %02x%02x SREG: %02x\n", + alert("PC: %02x%02x SP: %02x%02x SREG: %02x\n", g_current_regs[REG_PC0], g_current_regs[REG_PC1], g_current_regs[REG_SPH], g_current_regs[REG_SPL], g_current_regs[REG_SREG]); #else - llerr("PC: %02x%02x%02x SP: %02x%02x SREG: %02x\n", + alert("PC: %02x%02x%02x SP: %02x%02x SREG: %02x\n", g_current_regs[REG_PC0], g_current_regs[REG_PC1], g_current_regs[REG_PC2], g_current_regs[REG_SPH], g_current_regs[REG_SPL], g_current_regs[REG_SREG]); @@ -201,12 +190,12 @@ void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %04x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %04x\n", istackbase); - llerr(" size: %04x\n", istacksize); + alert("sp: %04x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %04x\n", istackbase); + alert(" size: %04x\n", istacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_intstack()); + alert(" used: %08x\n", up_check_intstack()); #endif /* Does the current stack pointer lie within the interrupt @@ -228,14 +217,14 @@ void up_dumpstate(void) if (g_current_regs) { sp = g_current_regs[REG_R13]; - llerr("sp: %04x\n", sp); + alert("sp: %04x\n", sp); } - llerr("User stack:\n"); - llerr(" base: %04x\n", ustackbase); - llerr(" size: %04x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %04x\n", ustackbase); + alert(" size: %04x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_tcbstack(rtcb)); + alert(" used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -247,11 +236,11 @@ void up_dumpstate(void) up_stackdump(sp, ustackbase); } #else - llerr("sp: %04x\n", sp); - llerr("stack base: %04x\n", ustackbase); - llerr("stack size: %04x\n", ustacksize); + alert("sp: %04x\n", sp); + alert("stack base: %04x\n", ustackbase); + alert("stack size: %04x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr("stack used: %08x\n", up_check_tcbstack(rtcb)); + alert("stack used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -260,7 +249,7 @@ void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); } else { diff --git a/arch/avr/src/avr32/up_dumpstate.c b/arch/avr/src/avr32/up_dumpstate.c index 4f67d1bef4..16a5406aa4 100644 --- a/arch/avr/src/avr32/up_dumpstate.c +++ b/arch/avr/src/avr32/up_dumpstate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/avr32/up_dumpstate.c * - * Copyright (C) 2010-2011, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include #include @@ -97,7 +86,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { uint32_t *ptr = (uint32_t *)stack; - llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -113,21 +102,21 @@ static inline void up_registerdump(void) if (g_current_regs) { - llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 0, g_current_regs[REG_R0], g_current_regs[REG_R1], g_current_regs[REG_R2], g_current_regs[REG_R3], g_current_regs[REG_R4], g_current_regs[REG_R5], g_current_regs[REG_R6], g_current_regs[REG_R7]); - llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 8, g_current_regs[REG_R8], g_current_regs[REG_R9], g_current_regs[REG_R10], g_current_regs[REG_R11], g_current_regs[REG_R12], g_current_regs[REG_R13], g_current_regs[REG_R14], g_current_regs[REG_R15]); - llerr("SR: %08x\n", g_current_regs[REG_SR]); + alert("SR: %08x\n", g_current_regs[REG_SR]); } } @@ -167,12 +156,12 @@ void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %08x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %08x\n", istackbase); - llerr(" size: %08x\n", istacksize); + alert("sp: %08x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %08x\n", istackbase); + alert(" size: %08x\n", istacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_intstack()); + alert(" used: %08x\n", up_check_intstack()); #endif /* Does the current stack pointer lie within the interrupt @@ -194,14 +183,14 @@ void up_dumpstate(void) if (g_current_regs) { sp = g_current_regs[REG_R13]; - llerr("sp: %08x\n", sp); + alert("sp: %08x\n", sp); } - llerr("User stack:\n"); - llerr(" base: %08x\n", ustackbase); - llerr(" size: %08x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %08x\n", ustackbase); + alert(" size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr(" used: %08x\n", up_check_tcbstack(rtcb)); + alert(" used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -213,11 +202,11 @@ void up_dumpstate(void) up_stackdump(sp, ustackbase); } #else - llerr("sp: %08x\n", sp); - llerr("stack base: %08x\n", ustackbase); - llerr("stack size: %08x\n", ustacksize); + alert("sp: %08x\n", sp); + alert("stack base: %08x\n", ustackbase); + alert("stack size: %08x\n", ustacksize); #ifdef CONFIG_STACK_COLORATION - llerr("stack used: %08x\n", up_check_tcbstack(rtcb)); + alert("stack used: %08x\n", up_check_tcbstack(rtcb)); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -226,7 +215,7 @@ void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); } else { diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c index 5ef623bd40..dc6411081e 100644 --- a/arch/avr/src/common/up_assert.c +++ b/arch/avr/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/common/up_assert.c * - * Copyright (C) 2010-2011, 2013-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011, 2013-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -79,23 +64,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP)) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -163,17 +131,17 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - llerr("Assertion failed at file:%s line: %d task: %s\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c index c7dc444767..1074adfb80 100644 --- a/arch/hc/src/m9s12/m9s12_assert.c +++ b/arch/hc/src/m9s12/m9s12_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/hc/src/m9s12/m9s12_assert.c * - * Copyright (C) 2011-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -79,23 +64,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -112,7 +80,7 @@ static void up_stackdump(uint16_t sp, uint16_t stack_base) for (stack = sp; stack < stack_base; stack += 16) { uint8_t *ptr = (uint8_t*)stack; - llerr("%04x: %02x %02x %02x %02x %02x %02x %02x %02x" + alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x" " %02x %02x %02x %02x %02x %02x %02x %02x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]); @@ -133,11 +101,11 @@ static inline void up_registerdump(void) if (g_current_regs) { - llerr("A:%02x B:%02x X:%02x%02x Y:%02x%02x PC:%02x%02x CCR:%02x\n", + alert("A:%02x B:%02x X:%02x%02x Y:%02x%02x PC:%02x%02x CCR:%02x\n", g_current_regs[REG_A], g_current_regs[REG_B], g_current_regs[REG_XH], g_current_regs[REG_XL], g_current_regs[REG_YH], g_current_regs[REG_YL], g_current_regs[REG_PCH], g_current_regs[REG_PCL], g_current_regs[REG_CCR]); - llerr("SP:%02x%02x FRAME:%02x%02x TMP:%02x%02x Z:%02x%02x XY:%02x\n", + alert("SP:%02x%02x FRAME:%02x%02x TMP:%02x%02x Z:%02x%02x XY:%02x\n", g_current_regs[REG_SPH], g_current_regs[REG_SPL], g_current_regs[REG_FRAMEH], g_current_regs[REG_FRAMEL], g_current_regs[REG_TMPL], g_current_regs[REG_TMPH], g_current_regs[REG_ZL], @@ -146,16 +114,16 @@ static inline void up_registerdump(void) #if CONFIG_HCS12_MSOFTREGS > 2 # error "Need to save more registers" #elif CONFIG_HCS12_MSOFTREGS == 2 - llerr("SOFTREGS: %02x%02x :%02x%02x\n", + alert("SOFTREGS: %02x%02x :%02x%02x\n", g_current_regs[REG_SOFTREG1], g_current_regs[REG_SOFTREG1+1], g_current_regs[REG_SOFTREG2], g_current_regs[REG_SOFTREG2+1]); #elif CONFIG_HCS12_MSOFTREGS == 1 - llerr("SOFTREGS: %02x%02x\n", g_current_regs[REG_SOFTREG1], + alert("SOFTREGS: %02x%02x\n", g_current_regs[REG_SOFTREG1], g_current_regs[REG_SOFTREG1+1]); #endif #ifndef CONFIG_HCS12_NONBANKED - llerr("PPAGE: %02x\n", g_current_regs[REG_PPAGE],); + alert("PPAGE: %02x\n", g_current_regs[REG_PPAGE],); #endif } } @@ -225,10 +193,10 @@ static void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %04x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %04x\n", istackbase); - llerr(" size: %04x\n", istacksize); + alert("sp: %04x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %04x\n", istackbase); + alert(" size: %04x\n", istacksize); /* Does the current stack pointer lie within the interrupt * stack? @@ -245,18 +213,18 @@ static void up_dumpstate(void) */ sp = g_intstackbase; - llerr("sp: %04x\n", sp); + alert("sp: %04x\n", sp); } /* Show user stack info */ - llerr("User stack:\n"); - llerr(" base: %04x\n", ustackbase); - llerr(" size: %04x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %04x\n", ustackbase); + alert(" size: %04x\n", ustacksize); #else - llerr("sp: %04x\n", sp); - llerr("stack base: %04x\n", ustackbase); - llerr("stack size: %04x\n", ustacksize); + alert("sp: %04x\n", sp); + alert("stack base: %04x\n", ustackbase); + alert("stack size: %04x\n", ustacksize); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -266,7 +234,7 @@ static void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { #if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4 - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); #endif } else @@ -326,17 +294,17 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - llerr("Assertion failed at file:%s line: %d task: %s\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/hc/src/m9s12/m9s12_dumpgpio.c b/arch/hc/src/m9s12/m9s12_dumpgpio.c index c9a0875176..9a4ae61a65 100644 --- a/arch/hc/src/m9s12/m9s12_dumpgpio.c +++ b/arch/hc/src/m9s12/m9s12_dumpgpio.c @@ -1,8 +1,7 @@ /**************************************************************************** * arch/arm/src/m9s12/m9s12_dumpgpio.c - * arch/arm/src/chip/m9s12_dumpgpio.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,12 +42,8 @@ /* Output debug info -- even if debug is not selected. */ #undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN #undef CONFIG_DEBUG_INFO #define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 #define CONFIG_DEBUG_INFO 1 #include @@ -177,39 +172,39 @@ static inline void hcs12_pimdump(uint8_t portndx) if (portndx >= HCS12_PIM_NPORTS) { - llerr(" Illegal PIM port index: %d\n", portndx); + llinfo(" Illegal PIM port index: %d\n", portndx); return; } ptr = &piminfo[portndx]; - llerr(" PIM Port%c:\n", ptr->name); - llerr(" IO:%02x INP:%02x DDR:%02x RDR:%02x\n", - getreg8(ptr->base+HCS12_PIM_IO_OFFSET), - getreg8(ptr->base+HCS12_PIM_INPUT_OFFSET), - getreg8(ptr->base+HCS12_PIM_DDR_OFFSET), - getreg8(ptr->base+HCS12_PIM_RDR_OFFSET)); + llinfo(" PIM Port%c:\n", ptr->name); + llinfo(" IO:%02x INP:%02x DDR:%02x RDR:%02x\n", + getreg8(ptr->base+HCS12_PIM_IO_OFFSET), + getreg8(ptr->base+HCS12_PIM_INPUT_OFFSET), + getreg8(ptr->base+HCS12_PIM_DDR_OFFSET), + getreg8(ptr->base+HCS12_PIM_RDR_OFFSET)); switch (ptr->form) { case PIMPORT_FORM1: - llerr(" PER:%02x PS:%02x\n", - getreg8(ptr->base+HCS12_PIM_PER_OFFSET), - getreg8(ptr->base+HCS12_PIM_PS_OFFSET)); + llinfo(" PER:%02x PS:%02x\n", + getreg8(ptr->base+HCS12_PIM_PER_OFFSET), + getreg8(ptr->base+HCS12_PIM_PS_OFFSET)); break; case PIMPORT_FORM2: - llerr(" PER:%02x PS:%02x WOM:%02x\n", - getreg8(ptr->base+HCS12_PIM_PER_OFFSET), - getreg8(ptr->base+HCS12_PIM_PS_OFFSET), - getreg8(ptr->base+HCS12_PIM_WOM_OFFSET)); + llinfo(" PER:%02x PS:%02x WOM:%02x\n", + getreg8(ptr->base+HCS12_PIM_PER_OFFSET), + getreg8(ptr->base+HCS12_PIM_PS_OFFSET), + getreg8(ptr->base+HCS12_PIM_WOM_OFFSET)); break; case PIMPORT_FORM3: - llerr(" PER:%02x PS:%02x IE:%02x IF:%02x\n", - getreg8(ptr->base+HCS12_PIM_PER_OFFSET), - getreg8(ptr->base+HCS12_PIM_PS_OFFSET), - getreg8(ptr->base+HCS12_PIM_IE_OFFSET), - getreg8(ptr->base+HCS12_PIM_IF_OFFSET)); + llinfo(" PER:%02x PS:%02x IE:%02x IF:%02x\n", + getreg8(ptr->base+HCS12_PIM_PER_OFFSET), + getreg8(ptr->base+HCS12_PIM_PS_OFFSET), + getreg8(ptr->base+HCS12_PIM_IE_OFFSET), + getreg8(ptr->base+HCS12_PIM_IF_OFFSET)); break; default: @@ -231,30 +226,30 @@ static inline void hcs12_mebidump(uint8_t portndx) if (portndx >= HCS12_MEBI_NPORTS) { - llerr(" Illegal MEBI port index: %d\n", portndx); + llinfo(" Illegal MEBI port index: %d\n", portndx); return; } ptr = &mebiinfo[portndx]; - llerr(" MEBI Port%c:\n", ptr->name); + llinfo(" MEBI Port%c:\n", ptr->name); switch (ptr->form) { case MEBIPORT_AB: - llerr(" DATA:%02x DDR:%02x\n", + llinfo(" DATA:%02x DDR:%02x\n", getreg8(ptr->data), getreg8(ptr->ddr)); break; case MEBIPORT_E: - llerr(" DATA:%02x DDR:%02x MODE:%02x PEAR:%02x\n", - getreg8(ptr->data), getreg8(ptr->ddr), - getreg8(HCS12_MEBI_MODE), getreg8(HCS12_MEBI_PEAR)); + llinfo(" DATA:%02x DDR:%02x MODE:%02x PEAR:%02x\n", + getreg8(ptr->data), getreg8(ptr->ddr), + getreg8(HCS12_MEBI_MODE), getreg8(HCS12_MEBI_PEAR)); break; case MEBIPORT_K: - llerr(" DATA:%02x DDR:%02x MODE:%02x\n", - getreg8(ptr->data), getreg8(ptr->ddr), - getreg8(HCS12_MEBI_MODE)); + llinfo(" DATA:%02x DDR:%02x MODE:%02x\n", + getreg8(ptr->data), getreg8(ptr->ddr), + getreg8(HCS12_MEBI_MODE)); break; default: @@ -279,7 +274,7 @@ int hcs12_dumpgpio(uint16_t pinset, const char *msg) uint8_t portndx = HCS12_PORTNDX(pinset); irqstate_t flags = enter_critical_section(); - llerr("pinset: %08x -- %s\n", pinset, msg); + llinfo("pinset: %08x -- %s\n", pinset, msg); if (HCS12_PIMPORT(pinset)) { @@ -295,4 +290,3 @@ int hcs12_dumpgpio(uint16_t pinset, const char *msg) } #endif /* CONFIG_DEBUG_GPIO */ - diff --git a/arch/mips/src/mips32/up_assert.c b/arch/mips/src/mips32/up_assert.c index 1a5174d67d..1f4ab15d6b 100644 --- a/arch/mips/src/mips32/up_assert.c +++ b/arch/mips/src/mips32/up_assert.c @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -79,23 +64,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -163,17 +131,17 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME - llerr("Assertion failed at file:%s line: %d task: %s\n", +#if CONFIG_TASK_NAME_SIZE > 0 + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/mips/src/mips32/up_dumpstate.c b/arch/mips/src/mips32/up_dumpstate.c index e31035f159..f5a2a8474d 100644 --- a/arch/mips/src/mips32/up_dumpstate.c +++ b/arch/mips/src/mips32/up_dumpstate.c @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include #include @@ -97,7 +86,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { uint32_t *ptr = (uint32_t *)stack; - llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -113,27 +102,27 @@ static inline void up_registerdump(void) if (g_current_regs) { - llerr("MFLO:%08x MFHI:%08x EPC:%08x STATUS:%08x\n", + alert("MFLO:%08x MFHI:%08x EPC:%08x STATUS:%08x\n", g_current_regs[REG_MFLO], g_current_regs[REG_MFHI], g_current_regs[REG_EPC], g_current_regs[REG_STATUS]); - llerr("AT:%08x V0:%08x V1:%08x A0:%08x A1:%08x A2:%08x A3:%08x\n", + alert("AT:%08x V0:%08x V1:%08x A0:%08x A1:%08x A2:%08x A3:%08x\n", g_current_regs[REG_AT], g_current_regs[REG_V0], g_current_regs[REG_V1], g_current_regs[REG_A0], g_current_regs[REG_A1], g_current_regs[REG_A2], g_current_regs[REG_A3]); - llerr("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x T7:%08x\n", + alert("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x T7:%08x\n", g_current_regs[REG_T0], g_current_regs[REG_T1], g_current_regs[REG_T2], g_current_regs[REG_T3], g_current_regs[REG_T4], g_current_regs[REG_T5], g_current_regs[REG_T6], g_current_regs[REG_T7]); - llerr("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n", + alert("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n", g_current_regs[REG_S0], g_current_regs[REG_S1], g_current_regs[REG_S2], g_current_regs[REG_S3], g_current_regs[REG_S4], g_current_regs[REG_S5], g_current_regs[REG_S6], g_current_regs[REG_S7]); #ifdef MIPS32_SAVE_GP - llerr("T8:%08x T9:%08x GP:%08x SP:%08x FP:%08x RA:%08x\n", + alert("T8:%08x T9:%08x GP:%08x SP:%08x FP:%08x RA:%08x\n", g_current_regs[REG_T8], g_current_regs[REG_T9], g_current_regs[REG_GP], g_current_regs[REG_SP], g_current_regs[REG_FP], g_current_regs[REG_RA]); #else - llerr("T8:%08x T9:%08x SP:%08x FP:%08x RA:%08x\n", + alert("T8:%08x T9:%08x SP:%08x FP:%08x RA:%08x\n", g_current_regs[REG_T8], g_current_regs[REG_T9], g_current_regs[REG_SP], g_current_regs[REG_FP], g_current_regs[REG_RA]); #endif @@ -180,10 +169,10 @@ void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %08x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %08x\n", istackbase); - llerr(" size: %08x\n", istacksize); + alert("sp: %08x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %08x\n", istackbase); + alert(" size: %08x\n", istacksize); /* Does the current stack pointer lie within the interrupt * stack? @@ -200,18 +189,18 @@ void up_dumpstate(void) */ sp = g_intstackbase; - llerr("sp: %08x\n", sp); + alert("sp: %08x\n", sp); } /* Show user stack info */ - llerr("User stack:\n"); - llerr(" base: %08x\n", ustackbase); - llerr(" size: %08x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %08x\n", ustackbase); + alert(" size: %08x\n", ustacksize); #else - llerr("sp: %08x\n", sp); - llerr("stack base: %08x\n", ustackbase); - llerr("stack size: %08x\n", ustacksize); + alert("sp: %08x\n", sp); + alert("stack base: %08x\n", ustackbase); + alert("stack size: %08x\n", ustacksize); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -221,7 +210,7 @@ void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { #if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4 - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); #endif } else diff --git a/arch/sh/src/common/up_assert.c b/arch/sh/src/common/up_assert.c index a82bde6e90..4919a30363 100644 --- a/arch/sh/src/common/up_assert.c +++ b/arch/sh/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_assert.c * - * Copyright (C) 2008-2009, 2012-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -80,10 +65,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -151,17 +132,17 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) void up_assert(const uint8_t *filename, int lineno) { -#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG_FEATURES) +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); #if CONFIG_TASK_NAME_SIZE > 0 - llerr("Assertion failed at file:%s line: %d task: %s\n", + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif diff --git a/arch/sh/src/m16c/m16c_dumpstate.c b/arch/sh/src/m16c/m16c_dumpstate.c index 54dfbd8b29..6cd4f545d4 100644 --- a/arch/sh/src/m16c/m16c_dumpstate.c +++ b/arch/sh/src/m16c/m16c_dumpstate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/m16c/m16c_assert.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -63,14 +52,6 @@ #ifdef CONFIG_ARCH_STACKDUMP -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -116,7 +97,7 @@ static void m16c_stackdump(uint16_t sp, uint16_t stack_base) for (stack = sp & ~7; stack < stack_base; stack += 8) { uint8_t *ptr = (uint8_t*)stack; - llerr("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n", + alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } } @@ -135,14 +116,14 @@ static inline void m16c_registerdump(void) { /* Yes.. dump the interrupt registers */ - llerr("PC: %02x%02x%02x FLG: %02x00%02x FB: %02x%02x SB: %02x%02x SP: %02x%02x\n", + alert("PC: %02x%02x%02x FLG: %02x00%02x FB: %02x%02x SB: %02x%02x SP: %02x%02x\n", ptr[REG_FLGPCHI] & 0xff, ptr[REG_PC], ptr[REG_PC+1], ptr[REG_FLGPCHI] >> 8, ptr[REG_FLG], ptr[REG_FB], ptr[REG_FB+1], ptr[REG_SB], ptr[REG_SB+1], ptr[REG_SP], ptr[REG_SP+1]); - llerr("R0: %02x%02x R1: %02x%02x R2: %02x%02x A0: %02x%02x A1: %02x%02x\n", + alert("R0: %02x%02x R1: %02x%02x R2: %02x%02x A0: %02x%02x A1: %02x%02x\n", ptr[REG_R0], ptr[REG_R0+1], ptr[REG_R1], ptr[REG_R1+1], ptr[REG_R2], ptr[REG_R2+1], ptr[REG_R3], ptr[REG_R3+1], ptr[REG_A0], ptr[REG_A0+1], ptr[REG_A1], ptr[REG_A1+1]); @@ -198,10 +179,10 @@ void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %04x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %04x\n", istackbase); - llerr(" size: %04x\n", istacksize); + alert("sp: %04x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %04x\n", istackbase); + alert(" size: %04x\n", istacksize); /* Does the current stack pointer lie within the interrupt * stack? @@ -216,18 +197,18 @@ void up_dumpstate(void) /* Extract the user stack pointer from the register area */ sp = m16c_getusersp(); - llerr("sp: %04x\n", sp); + alert("sp: %04x\n", sp); } /* Show user stack info */ - llerr("User stack:\n"); - llerr(" base: %04x\n", ustackbase); - llerr(" size: %04x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %04x\n", ustackbase); + alert(" size: %04x\n", ustacksize); #else - llerr("sp: %04x\n", sp); - llerr("stack base: %04x\n", ustackbase); - llerr("stack size: %04x\n", ustacksize); + alert("sp: %04x\n", sp); + alert("stack base: %04x\n", ustackbase); + alert("stack size: %04x\n", ustacksize); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -237,7 +218,7 @@ void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { #if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4 - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); #endif } else diff --git a/arch/sh/src/sh1/sh1_dumpstate.c b/arch/sh/src/sh1/sh1_dumpstate.c index a5f7f6c1ef..487bc854ad 100644 --- a/arch/sh/src/sh1/sh1_dumpstate.c +++ b/arch/sh/src/sh1/sh1_dumpstate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_assert.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -62,14 +51,6 @@ #ifdef CONFIG_ARCH_STACKDUMP -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -103,7 +84,7 @@ static void sh1_stackdump(uint32_t sp, uint32_t stack_base) for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { uint32_t *ptr = (uint32_t*)stack; - llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -123,17 +104,17 @@ static inline void sh1_registerdump(void) { /* Yes.. dump the interrupt registers */ - llerr("PC: %08x SR=%08x\n", + alert("PC: %08x SR=%08x\n", ptr[REG_PC], ptr[REG_SR]); - llerr("PR: %08x GBR: %08x MACH: %08x MACL: %08x\n", + alert("PR: %08x GBR: %08x MACH: %08x MACL: %08x\n", ptr[REG_PR], ptr[REG_GBR], ptr[REG_MACH], ptr[REG_MACL]); - llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 0, + alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 0, ptr[REG_R0], ptr[REG_R1], ptr[REG_R2], ptr[REG_R3], ptr[REG_R4], ptr[REG_R5], ptr[REG_R6], ptr[REG_R7]); - llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 8, + alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 8, ptr[REG_R8], ptr[REG_R9], ptr[REG_R10], ptr[REG_R11], ptr[REG_R12], ptr[REG_R13], ptr[REG_R14], ptr[REG_R15]); } @@ -179,10 +160,10 @@ void up_dumpstate(void) /* Show interrupt stack info */ - llerr("sp: %08x\n", sp); - llerr("IRQ stack:\n"); - llerr(" base: %08x\n", istackbase); - llerr(" size: %08x\n", istacksize); + alert("sp: %08x\n", sp); + alert("IRQ stack:\n"); + alert(" base: %08x\n", istackbase); + alert(" size: %08x\n", istacksize); /* Does the current stack pointer lie within the interrupt * stack? @@ -199,18 +180,18 @@ void up_dumpstate(void) */ sp = g_intstackbase; - llerr("sp: %08x\n", sp); + alert("sp: %08x\n", sp); } /* Show user stack info */ - llerr("User stack:\n"); - llerr(" base: %08x\n", ustackbase); - llerr(" size: %08x\n", ustacksize); + alert("User stack:\n"); + alert(" base: %08x\n", ustackbase); + alert(" size: %08x\n", ustacksize); #else - llerr("sp: %08x\n", sp); - llerr("stack base: %08x\n", ustackbase); - llerr("stack size: %08x\n", ustacksize); + alert("sp: %08x\n", sp); + alert("stack base: %08x\n", ustackbase); + alert("stack size: %08x\n", ustacksize); #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -220,7 +201,7 @@ void up_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { #if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4 - llerr("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); #endif } else diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c index 6106e2397e..c4daa69393 100644 --- a/arch/x86/src/common/up_assert.c +++ b/arch/x86/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/src/common/up_assert.c * - * Copyright (C) 2011-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -80,19 +65,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/* The following is just intended to keep some ugliness out of the mainline - * code. We are going to print the task name if: - * - * CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name - * (defined(CONFIG_DEBUG_FEATURES) || <-- And the debug is enabled (llerr used) - * defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used - */ - -#undef CONFIG_PRINT_TASKNAME -#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG_FEATURES) || defined(CONFIG_ARCH_STACKDUMP)) -# define CONFIG_PRINT_TASKNAME 1 -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -284,13 +256,13 @@ static void _up_assert(int errorcode) void up_assert(const uint8_t *filename, int lineno) { -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 struct tcb_s *rtcb = this_task(); #endif board_autoled_on(LED_ASSERTION); -#ifdef CONFIG_PRINT_TASKNAME +#if CONFIG_TASK_NAME_SIZE > 0 llerr("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else diff --git a/arch/x86/src/i486/up_regdump.c b/arch/x86/src/i486/up_regdump.c index 3c4137b198..b3da1b603e 100644 --- a/arch/x86/src/i486/up_regdump.c +++ b/arch/x86/src/i486/up_regdump.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/src/i486/up_regdump.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,50 +39,28 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include #include "up_internal.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ + /**************************************************************************** * Name: up_registerdump ****************************************************************************/ void up_registerdump(uint32_t *regs) { - llerr(" ds:%08x irq:%08x err:%08x\n", + alert(" ds:%08x irq:%08x err:%08x\n", regs[REG_DS], regs[REG_IRQNO], regs[REG_ERRCODE]); - llerr("edi:%08x esi:%08x ebp:%08x esp:%08x\n", + alert("edi:%08x esi:%08x ebp:%08x esp:%08x\n", regs[REG_EDI], regs[REG_ESI], regs[REG_EBP], regs[REG_ESP]); - llerr("ebx:%08x edx:%08x ecx:%08x eax:%08x\n", + alert("ebx:%08x edx:%08x ecx:%08x eax:%08x\n", regs[REG_EBX], regs[REG_EDX], regs[REG_ECX], regs[REG_EAX]); - llerr("eip:%08x cs:%08x flg:%08x sp:%08x ss:%08x\n", + alert("eip:%08x cs:%08x flg:%08x sp:%08x ss:%08x\n", regs[REG_EIP], regs[REG_CS], regs[REG_EFLAGS], regs[REG_SP], regs[REG_SS]); } diff --git a/arch/z16/src/common/up_assert.c b/arch/z16/src/common/up_assert.c index f647a9093b..1ef880a041 100644 --- a/arch/z16/src/common/up_assert.c +++ b/arch/z16/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_assert.c * - * Copyright (C) 2008-2009, 2012-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -158,17 +143,17 @@ void up_assert(void) #ifdef CONFIG_HAVE_FILENAME #if CONFIG_TASK_NAME_SIZE > 0 - llerr("Assertion failed at file:%s line: %d task: %s\n", + alert("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else - llerr("Assertion failed at file:%s line: %d\n", + alert("Assertion failed at file:%s line: %d\n", filename, lineno); #endif #else #if CONFIG_TASK_NAME_SIZE > 0 - llerr("Assertion failed: task: %s\n", rtcb->name); + alert("Assertion failed: task: %s\n", rtcb->name); #else - llerr("Assertion failed\n"); + alert("Assertion failed\n"); #endif #endif diff --git a/arch/z16/src/common/up_registerdump.c b/arch/z16/src/common/up_registerdump.c index 0604e0f7d4..f167926a52 100644 --- a/arch/z16/src/common/up_registerdump.c +++ b/arch/z16/src/common/up_registerdump.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_registerdump.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if - * debug is not selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include @@ -77,15 +62,15 @@ static void up_registerdump(void) #ifdef CONFIG_DEBUG_INFO FAR uint32_t *regs32 = (FAR uint32_t*)g_current_regs; - llinfo("R0 :%08x R1 :%08x R2 :%08x R3 :%08x " - "R4 :%08x R5 :%08x R6 :%08x R7 :%08x\n" - regs32[REG_R0/2], regs32[REG_R1/2], regs32[REG_R2/2], regs32[REG_R3/2], - regs32[REG_R4/2], regs32[REG_R5/2], regs32[REG_R6/2], regs32[REG_R7/2]); - llinfo("R8 :%08x R9 :%08x R10:%08x R11:%08x R12:%08x R13:%08x\n" - regs32[REG_R8/2], regs32[REG_R9/2], regs32[REG_R10/2], regs3[REG_R11/2], - regs32[REG_R12/2], regs32[REG_R13/2]); - llinfo("FP :%08x SP :%08x FLG:%04x\n" - regs32[REG_R14/2], regs32[REG_R15/2], g_current_regs[REG_FLAGS]); + alert("R0 :%08x R1 :%08x R2 :%08x R3 :%08x " + "R4 :%08x R5 :%08x R6 :%08x R7 :%08x\n" + regs32[REG_R0/2], regs32[REG_R1/2], regs32[REG_R2/2], regs32[REG_R3/2], + regs32[REG_R4/2], regs32[REG_R5/2], regs32[REG_R6/2], regs32[REG_R7/2]); + alert("R8 :%08x R9 :%08x R10:%08x R11:%08x R12:%08x R13:%08x\n" + regs32[REG_R8/2], regs32[REG_R9/2], regs32[REG_R10/2], regs3[REG_R11/2], + regs32[REG_R12/2], regs32[REG_R13/2]); + alert("FP :%08x SP :%08x FLG:%04x\n" + regs32[REG_R14/2], regs32[REG_R15/2], g_current_regs[REG_FLAGS]); #endif } diff --git a/arch/z16/src/common/up_stackdump.c b/arch/z16/src/common/up_stackdump.c index 9ae0cb71e4..4b439b8d87 100644 --- a/arch/z16/src/common/up_stackdump.c +++ b/arch/z16/src/common/up_stackdump.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_stackdump.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include "chip/chip.h" @@ -78,9 +67,9 @@ static void up_stackdump(void) chipreg_t stack_base = (chipreg_t)rtcb->adj_stack_ptr; chipreg_t stack_size = (chipreg_t)rtcb->adj_stack_size; - llinfo("stack_base: %08x\n", stack_base); - llinfo("stack_size: %08x\n", stack_size); - llinfo("sp: %08x\n", sp); + alert("stack_base: %08x\n", stack_base); + alert("stack_size: %08x\n", stack_size); + alert("sp: %08x\n", sp); if (sp >= stack_base || sp < stack_base - stack_size) { @@ -94,9 +83,9 @@ static void up_stackdump(void) for (stack = sp & ~0x0f; stack < stack_base; stack += 8*sizeof(chipreg_t)) { chipreg_t *ptr = (chipreg_t*)stack; - llinfo("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", - stack, ptr[0], ptr[1], ptr[2], ptr[3], - ptr[4], ptr[5], ptr[6], ptr[7]); + alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", + stack, ptr[0], ptr[1], ptr[2], ptr[3], + ptr[4], ptr[5], ptr[6], ptr[7]); } } } diff --git a/arch/z80/src/common/up_assert.c b/arch/z80/src/common/up_assert.c index 546b763751..ea1dd0c5d7 100644 --- a/arch/z80/src/common/up_assert.c +++ b/arch/z80/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_assert.c * - * Copyright (C) 2007-2009, 2012-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,21 +39,6 @@ #include -/* Output debug info if stack dump is selected -- even if debug is not - * selected. - */ - -#ifdef CONFIG_ARCH_STACKDUMP -# undef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_ERROR -# undef CONFIG_DEBUG_WARN -# undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -#endif - #include #include #include @@ -79,10 +64,6 @@ # undef CONFIG_ARCH_USBDUMP #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -161,17 +142,17 @@ void up_assert(void) #ifdef CONFIG_HAVE_FILENAME #if CONFIG_TASK_NAME_SIZE > 0 - llinfo("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + alert("Assertion failed at file:%s line: %d task: %s\n", + filename, lineno, rtcb->name); #else - llinfo("Assertion failed at file:%s line: %d\n", - filename, lineno); + alert("Assertion failed at file:%s line: %d\n", + filename, lineno); #endif #else #if CONFIG_TASK_NAME_SIZE > 0 - llinfo("Assertion failed: task: %s\n", rtcb->name); + alert("Assertion failed: task: %s\n", rtcb->name); #else - llinfo("Assertion failed\n"); + alert("Assertion failed\n"); #endif #endif diff --git a/arch/z80/src/common/up_stackdump.c b/arch/z80/src/common/up_stackdump.c index 89f197895f..0e4e4ea9c4 100644 --- a/arch/z80/src/common/up_stackdump.c +++ b/arch/z80/src/common/up_stackdump.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_stackdump.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -59,14 +48,6 @@ #ifdef CONFIG_ARCH_STACKDUMP -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -87,13 +68,13 @@ static void up_stackdump(void) uint16_t stack_base = (uint16_t)rtcb->adj_stack_ptr; uint16_t stack_size = (uint16_t)rtcb->adj_stack_size; - llinfo("stack_base: %04x\n", stack_base); - llinfo("stack_size: %04x\n", stack_size); - llinfo("sp: %04x\n", sp); + alert("stack_base: %04x\n", stack_base); + alert("stack_size: %04x\n", stack_size); + alert("sp: %04x\n", sp); if (sp >= stack_base || sp < stack_base - stack_size) { - llinfo("ERROR: Stack pointer is not within allocated stack\n"); + alert("ERROR: Stack pointer is not within allocated stack\n"); return; } else @@ -103,9 +84,9 @@ static void up_stackdump(void) for (stack = sp & ~0x0f; stack < stack_base; stack += 8*sizeof(uint16_t)) { uint16_t *ptr = (uint16_t*)stack; - llinfo("%04x: %04x %04x %04x %04x %04x %04x %04x %04x\n", - stack, ptr[0], ptr[1], ptr[2], ptr[3], - ptr[4], ptr[5], ptr[6], ptr[7]); + alert("%04x: %04x %04x %04x %04x %04x %04x %04x %04x\n", + stack, ptr[0], ptr[1], ptr[2], ptr[3], + ptr[4], ptr[5], ptr[6], ptr[7]); } } } diff --git a/arch/z80/src/ez80/ez80_registerdump.c b/arch/z80/src/ez80/ez80_registerdump.c index 4ccd09ce57..43faf25fee 100644 --- a/arch/z80/src/ez80/ez80_registerdump.c +++ b/arch/z80/src/ez80/ez80_registerdump.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_registerdump.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -81,23 +70,23 @@ static void ez80_registerdump(void) if (g_current_regs) { #ifdef CONFIG_EZ80_Z80MODE - llinfo("AF: %04x I: %04x\n", - g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); - llinfo("BC: %04x DE: %04x HL: %04x\n", - g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); - llinfo("IX: %04x IY: %04x\n", - g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); - llinfo("SP: %04x PC: %04x\n" - g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); + alert("AF: %04x I: %04x\n", + g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); + alert("BC: %04x DE: %04x HL: %04x\n", + g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); + alert("IX: %04x IY: %04x\n", + g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); + alert("SP: %04x PC: %04x\n" + g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); #else - llinfo("AF: %06x I: %06x\n", - g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); - llinfo("BC: %06x DE: %06x HL: %06x\n", - g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); - llinfo("IX: %06x IY: %06x\n", - g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); - llinfo("SP: %06x PC: %06x\n" - g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); + alert("AF: %06x I: %06x\n", + g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); + alert("BC: %06x DE: %06x HL: %06x\n", + g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); + alert("IX: %06x IY: %06x\n", + g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); + alert("SP: %06x PC: %06x\n" + g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); #endif } } diff --git a/arch/z80/src/z180/z180_registerdump.c b/arch/z80/src/z180/z180_registerdump.c index 83d7faaa55..32b351c36d 100644 --- a/arch/z80/src/z180/z180_registerdump.c +++ b/arch/z80/src/z180/z180_registerdump.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z180/z180_registerdump.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -72,16 +61,16 @@ static void z180_registerdump(void) { if (g_current_regs) { - llinfo("AF: %04x I: %04x\n", - g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); - llinfo("BC: %04x DE: %04x HL: %04x\n", - g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); - llinfo("IX: %04x IY: %04x\n", - g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); - llinfo("SP: %04x PC: %04x\n" - g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); - llinfo("CBAR: %02x BBR: %02x CBR: %02x\n" - inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR)); + alert("AF: %04x I: %04x\n", + g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); + alert("BC: %04x DE: %04x HL: %04x\n", + g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); + alert("IX: %04x IY: %04x\n", + g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); + alert("SP: %04x PC: %04x\n" + g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); + alert("CBAR: %02x BBR: %02x CBR: %02x\n" + inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR)); } } diff --git a/arch/z80/src/z8/z8_registerdump.c b/arch/z80/src/z8/z8_registerdump.c index f6a6b91ac7..92ba675b40 100644 --- a/arch/z80/src/z8/z8_registerdump.c +++ b/arch/z80/src/z8/z8_registerdump.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z8/z8_registerdump.c * - * Copyright (C) 2008-2009,2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,19 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -69,16 +56,16 @@ static inline void z8_dumpregs(FAR chipret_t *regs) { - llinfo("REGS: %04x %04x %04x %04x %04x %04x %04x %04x\n", - regs[XCPT_RR0], regs[XCPT_RR2], regs[XCPT_RR4], regs[XCPT_RR6], - regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]); + alert("REGS: %04x %04x %04x %04x %04x %04x %04x %04x\n", + regs[XCPT_RR0], regs[XCPT_RR2], regs[XCPT_RR4], regs[XCPT_RR6], + regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]); } static inline void z8_dumpstate(chipreg_t sp, chipreg_t pc, uint8_t irqctl, chipreg_t rpflags) { - llinfo("SP: %04x PC: %04x IRQCTL: %02x RP: %02x FLAGS: %02x\n", - sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff); + alert("SP: %04x PC: %04x IRQCTL: %02x RP: %02x FLAGS: %02x\n", + sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff); } /**************************************************************************** diff --git a/arch/z80/src/z80/z80_registerdump.c b/arch/z80/src/z80/z80_registerdump.c index 43494e24e8..7f02662a06 100644 --- a/arch/z80/src/z80/z80_registerdump.c +++ b/arch/z80/src/z80/z80_registerdump.c @@ -39,17 +39,6 @@ #include -/* Output debug info -- even if debug is not selected. */ - -#undef CONFIG_DEBUG_FEATURES -#undef CONFIG_DEBUG_ERROR -#undef CONFIG_DEBUG_WARN -#undef CONFIG_DEBUG_INFO -#define CONFIG_DEBUG_FEATURES 1 -#define CONFIG_DEBUG_ERROR 1 -#define CONFIG_DEBUG_WARN 1 -#define CONFIG_DEBUG_INFO 1 - #include #include @@ -60,14 +49,6 @@ #ifdef CONFIG_ARCH_STACKDUMP -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -80,14 +61,14 @@ static void z80_registerdump(void) { if (g_current_regs) { - llinfo("AF: %04x I: %04x\n", - g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); - llinfo("BC: %04x DE: %04x HL: %04x\n", - g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); - llinfo("IX: %04x IY: %04x\n", - g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); - llinfo("SP: %04x PC: %04x\n" - g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); + alert("AF: %04x I: %04x\n", + g_current_regs[XCPT_AF], g_current_regs[XCPT_I]); + alert("BC: %04x DE: %04x HL: %04x\n", + g_current_regs[XCPT_BC], g_current_regs[XCPT_DE], g_current_regs[XCPT_HL]); + alert("IX: %04x IY: %04x\n", + g_current_regs[XCPT_IX], g_current_regs[XCPT_IY]); + alert("SP: %04x PC: %04x\n" + g_current_regs[XCPT_SP], g_current_regs[XCPT_PC]); } } diff --git a/include/debug.h b/include/debug.h index 43f27a6cf5..2737b4e787 100644 --- a/include/debug.h +++ b/include/debug.h @@ -105,6 +105,9 @@ * CONFIG_DEBUG_ERROR be defined. This is intended for important error-related * information that you probably not want to suppress during normal debug * general debugging. + * + * alert() - is a special, high-priority, unconditional version that is really + * intended only for crash error reporting. */ #ifdef CONFIG_HAVE_FUNCTIONNAME @@ -132,6 +135,13 @@ /* C-99 style variadic macros are supported */ +#ifdef CONFIG_ARCH_LOWPUTC +# define alert(format, ...) \ + __arch_lowsyslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) +# else +# define alert(x...) +# endif + #ifdef CONFIG_DEBUG_ERROR # define err(format, ...) \ __arch_syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) @@ -149,11 +159,11 @@ #ifdef CONFIG_DEBUG_WARN # define warn(format, ...) \ - __arch_syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) + __arch_syslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # ifdef CONFIG_ARCH_LOWPUTC # define llwarn(format, ...) \ - __arch_lowsyslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) + __arch_lowsyslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # else # define llwarn(x...) # endif @@ -164,11 +174,11 @@ #ifdef CONFIG_DEBUG_INFO # define info(format, ...) \ - __arch_syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) + __arch_syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # ifdef CONFIG_ARCH_LOWPUTC # define llinfo(format, ...) \ - __arch_lowsyslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) + __arch_lowsyslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # else # define llinfo(x...) # endif @@ -543,6 +553,10 @@ /* Variadic macros NOT supported */ +#ifndef CONFIG_ARCH_LOWPUTC +# define alert (void) +# endif + #ifdef CONFIG_DEBUG_ERROR # ifndef CONFIG_ARCH_LOWPUTC # define llerr (void) @@ -1078,6 +1092,10 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, */ #ifndef CONFIG_CPP_HAVE_VARARGS +#ifndef CONFIG_ARCH_LOWPUTC +int alert(const char *format, ...); +#endif + #ifdef CONFIG_DEBUG_ERROR int err(const char *format, ...); diff --git a/libc/misc/lib_debug.c b/libc/misc/lib_debug.c index 1687ddfc8b..cd1e703c09 100644 --- a/libc/misc/lib_debug.c +++ b/libc/misc/lib_debug.c @@ -51,14 +51,28 @@ ****************************************************************************/ /**************************************************************************** - * Name: err, llerr, info + * Name: alert, err, llerr, warn, llwarn, info, llinfo * * Description: * If the cross-compiler's pre-processor does not support variable - * length arguments, then these additional APIs will be built. + * length arguments, then these additional APIs will be built. * ****************************************************************************/ +#ifdef CONFIG_ARCH_LOWPUTC +int alert(const char *format, ...) +{ + va_list ap; + int ret; + + va_start(ap, format); + ret = lowvsyslog(LOG_EMERG, format, ap); + va_end(ap); + + return ret; +} +#endif /* CONFIG_ARCH_LOWPUTC */ + #ifdef CONFIG_DEBUG_FEATURES int err(const char *format, ...) { @@ -66,7 +80,7 @@ int err(const char *format, ...) int ret; va_start(ap, format); - ret = vsyslog(LOG_DEBUG, format, ap); + ret = vsyslog(LOG_ERR, format, ap); va_end(ap); return ret; @@ -107,7 +121,7 @@ int llwarn(const char *format, ...) int ret; va_start(ap, format); - ret = lowvsyslog(LOG_DEBUG, format, ap); + ret = lowvsyslog(LOG_WARNING, format, ap); va_end(ap); return ret; @@ -122,7 +136,7 @@ int info(const char *format, ...) int ret; va_start(ap, format); - ret = vsyslog(LOG_DEBUG, format, ap); + ret = vsyslog(LOG_INFO, format, ap); va_end(ap); return ret; @@ -135,7 +149,7 @@ int llinfo(const char *format, ...) int ret; va_start(ap, format); - ret = lowvsyslog(LOG_DEBUG, format, ap); + ret = lowvsyslog(LOG_INFO, format, ap); va_end(ap); return ret;