diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 2fd18b1d8..244f07538 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -3856,8 +3856,10 @@ build You must also define CONFIG_GREGORIAN_TIME in order to use Julian time.
  • - CONFIG_DEV_CONSOLE: Set if architecture-specific logic - provides /dev/console. Enables stdout, stderr, stdin. + CONFIG_DEV_CONSOLE: Set if architecture-specific logic provides /dev/console. + Enables stdout, stderr, and stdin. + This implies the "normal" serial driver provides the console unless another console device is specified + (See CONFIG_DEV_LOWCONSOLE).
  • CONFIG_MUTEX_TYPES: Set to enable support for recursive and diff --git a/nuttx/arch/arm/src/arm/up_nommuhead.S b/nuttx/arch/arm/src/arm/up_nommuhead.S index afd195192..aac95b73a 100644 --- a/nuttx/arch/arm/src/arm/up_nommuhead.S +++ b/nuttx/arch/arm/src/arm/up_nommuhead.S @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/arm/up_nommuhead.S * - * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -110,7 +110,7 @@ __start: /* Perform early serial initialization */ mov fp, #0 -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT bl up_earlyserialinit #endif diff --git a/nuttx/arch/arm/src/common/up_initialize.c b/nuttx/arch/arm/src/common/up_initialize.c index 167111ddb..9d7ba0f19 100644 --- a/nuttx/arch/arm/src/common/up_initialize.c +++ b/nuttx/arch/arm/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/common/up_initialize.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -149,12 +149,14 @@ void up_initialize(void) devnull_register(); /* Standard /dev/null */ #endif - /* Initialize the serial device driver */ + /* Initialize the console device driver */ -#ifdef CONFIG_USE_SERIALDRIVER +#if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h index 306a44b49..6f98ac04d 100644 --- a/nuttx/arch/arm/src/common/up_internal.h +++ b/nuttx/arch/arm/src/common/up_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_internal.h * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __UP_INTERNAL_H -#define __UP_INTERNAL_H +#ifndef __ARCH_ARM_SRC_COMMON_UP_INTERNAL_H +#define __ARCH_ARM_SRC_COMMON_UP_INTERNAL_H /**************************************************************************** * Included Files @@ -62,13 +62,24 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS == 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# else +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# endif +#endig /* Check if an interrupt stack size is configured */ @@ -286,6 +297,14 @@ extern void lowconsole_init(void); # define lowconsole_init() #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + /* DMA **********************************************************************/ #ifdef CONFIG_ARCH_DMA @@ -364,4 +383,4 @@ extern size_t up_check_tcbstack_remain(FAR _TCB); #endif /* __ASSEMBLY__ */ -#endif /* __UP_INTERNAL_H */ +#endif /* __ARCH_ARM_SRC_COMMON_UP_INTERNAL_H */ diff --git a/nuttx/arch/arm/src/dm320/dm320_boot.c b/nuttx/arch/arm/src/dm320/dm320_boot.c index 6269ed8f8..df749b6da 100644 --- a/nuttx/arch/arm/src/dm320/dm320_boot.c +++ b/nuttx/arch/arm/src/dm320/dm320_boot.c @@ -1,8 +1,8 @@ /************************************************************************************ * arch/arm/src/dm320/dm320_boot.c * - * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -231,7 +231,7 @@ void up_boot(void) #endif /* Perform early serial initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif } diff --git a/nuttx/arch/arm/src/dm320/dm320_serial.c b/nuttx/arch/arm/src/dm320/dm320_serial.c index 120f19f72..b09104e57 100644 --- a/nuttx/arch/arm/src/dm320/dm320_serial.c +++ b/nuttx/arch/arm/src/dm320/dm320_serial.c @@ -2,8 +2,8 @@ * arch/arm/src/dm320/dm320_serial.c * arch/arm/src/chip/dm320_serial.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,7 +60,7 @@ #include "os_internal.h" #include "up_internal.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Pre-processor Definitions @@ -781,7 +781,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Definitions @@ -834,6 +834,6 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/imx/imx_boot.c b/nuttx/arch/arm/src/imx/imx_boot.c index 65a6951ce..53c656b2d 100644 --- a/nuttx/arch/arm/src/imx/imx_boot.c +++ b/nuttx/arch/arm/src/imx/imx_boot.c @@ -2,8 +2,8 @@ * arch/arm/src/imx/imx_boot.c * arch/arm/src/chip/imx_boot.c * - * Copyright (C) 2009,2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -219,7 +219,7 @@ void up_boot(void) #endif /* Perform early serial initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif } diff --git a/nuttx/arch/arm/src/imx/imx_serial.c b/nuttx/arch/arm/src/imx/imx_serial.c index 984f51649..556eb4ebd 100644 --- a/nuttx/arch/arm/src/imx/imx_serial.c +++ b/nuttx/arch/arm/src/imx/imx_serial.c @@ -2,8 +2,8 @@ * arch/arm/src/imx/imx_serial.c * arch/arm/src/chip/imx_serial.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +61,7 @@ #include "os_internal.h" #include "up_internal.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Pre-processor Definitions @@ -1181,7 +1181,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Definitions @@ -1239,6 +1239,6 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/kinetis/kinetis_serial.c b/nuttx/arch/arm/src/kinetis/kinetis_serial.c index 1e98b722f..dd1cd6873 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_serial.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/mips/src/kinetis/kinetis_serial.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,7 +77,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which UART with be tty0/console and which tty1-4? The console will always * be ttyS0. If there is no console then will use the lowest numbered UART. @@ -1319,7 +1319,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1346,5 +1346,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/kinetis/kinetis_start.c b/nuttx/arch/arm/src/kinetis/kinetis_start.c index 1ebb894e1..c8f20fbdd 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_start.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_start.c @@ -2,8 +2,8 @@ * arch/arm/src/kinetis/kinetis_start.c * arch/arm/src/chip/kinetis_start.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -135,7 +135,7 @@ void __start(void) */ kinetis_lowsetup(); -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/arm/src/lm3s/lm3s_serial.c b/nuttx/arch/arm/src/lm3s/lm3s_serial.c index f1f5ac9ba..50384a1b9 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_serial.c +++ b/nuttx/arch/arm/src/lm3s/lm3s_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/lm3s/lm3s_serial.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -110,7 +110,7 @@ * still must provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which UART with be tty0/console and which tty1? */ @@ -1038,7 +1038,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1065,4 +1065,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/lm3s/lm3s_start.c b/nuttx/arch/arm/src/lm3s/lm3s_start.c index 292467d56..f3f762b52 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_start.c +++ b/nuttx/arch/arm/src/lm3s/lm3s_start.c @@ -2,8 +2,8 @@ * arch/arm/src/lm3s/lm3s_start.c * arch/arm/src/chip/lm3s_start.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -130,7 +130,7 @@ void __start(void) /* Perform early serial initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif showprogress('D'); diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c index 80d483742..f5d1e3c01 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/lpc17xx/lpc17_serial.c * - * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -72,7 +72,7 @@ * provide some minimal implementation of up_putc. */ -#if defined(CONFIG_USE_SERIALDRIVER) && defined(HAVE_UART) +#if defined(USE_SERIALDRIVER) && defined(HAVE_UART) /* Configuration ************************************************************/ @@ -1417,7 +1417,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1444,4 +1444,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_start.c b/nuttx/arch/arm/src/lpc17xx/lpc17_start.c index 427e3a103..abbe6e213 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_start.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_start.c @@ -2,8 +2,8 @@ * arch/arm/src/lpc17xx/lpc17_start.c * arch/arm/src/chip/lpc17_start.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -129,7 +129,7 @@ void __start(void) /* Perform early serial initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif showprogress('D'); diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_head.S b/nuttx/arch/arm/src/lpc214x/lpc214x_head.S index 72d026aaa..678481154 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_head.S +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_head.S @@ -1,8 +1,8 @@ /***************************************************************************** * arch/arm/src/lpc214x/lpc214x_head.S * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -582,7 +582,7 @@ __start: /* Perform early serial initialization */ mov fp, #0 -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT bl up_earlyserialinit #endif diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c b/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c index 13a69716b..a838e3143 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/lpc214x/lpc214x_serial.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,7 +60,7 @@ #include "lpc214x_pinsel.h" #include "lpc214x_uart.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions @@ -816,7 +816,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -841,4 +841,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/lpc2378/lpc23xx_head.S b/nuttx/arch/arm/src/lpc2378/lpc23xx_head.S index d9b5fdfcb..a4cab8f05 100755 --- a/nuttx/arch/arm/src/lpc2378/lpc23xx_head.S +++ b/nuttx/arch/arm/src/lpc2378/lpc23xx_head.S @@ -6,8 +6,8 @@ * * This file is part of the NuttX RTOS and based on the lpc2148 port: * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -181,7 +181,7 @@ __start: /* Perform early serial initialization */ mov fp, #0 -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT bl up_earlyserialinit showprogress 'S' #endif diff --git a/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c b/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c index 7590c7c93..8d3a020c7 100755 --- a/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c +++ b/nuttx/arch/arm/src/lpc2378/lpc23xx_serial.c @@ -6,8 +6,8 @@ * * This file is part of the NuttX RTOS and based on the lpc2148 port: * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,7 +67,7 @@ #include "lpc23xx_uart.h" #include "lpc23xx_vic.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions @@ -947,7 +947,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -971,4 +971,4 @@ int up_putc(int ch) up_lowputc(ch); return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c b/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c index 42da03bbd..7abe15d4d 100755 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c @@ -1,8 +1,8 @@ /************************************************************************************ * arch/arm/src/lpc31xx/lpc31_boot.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -387,7 +387,7 @@ void up_boot(void) /* Perform early serial initialization if we are going to use the serial driver */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_lowputc.c b/nuttx/arch/arm/src/lpc31xx/lpc31_lowputc.c index 7d8a7cc32..72eb91748 100755 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_lowputc.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_lowputc.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/lpc31xx/lpc31_lowputc.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -71,7 +71,7 @@ * initialization suppressed? */ -# if defined(CONFIG_USE_EARLYSERIALINIT) || defined(CONFIG_SUPPRESS_LPC31_UART_CONFIG) +# if defined(USE_EARLYSERIALINIT) || defined(CONFIG_SUPPRESS_LPC31_UART_CONFIG) # undef NEED_LOWSETUP # else # define NEED_LOWSETUP 1 diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_serial.c b/nuttx/arch/arm/src/lpc31xx/lpc31_serial.c index ceb15d6a2..770731882 100755 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_serial.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/lpc31xx/lpc31_serial.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,7 +60,7 @@ #include "lpc31_cgudrvr.h" #include "lpc31_uart.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions @@ -826,7 +826,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -853,4 +853,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/sam3u/sam3u_serial.c b/nuttx/arch/arm/src/sam3u/sam3u_serial.c index 4e32e8fa9..063de7a58 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_serial.c +++ b/nuttx/arch/arm/src/sam3u/sam3u_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/sam3u/sam3u_serial.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -143,7 +143,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which UART/USART with be tty0/console and which tty1? tty2? tty3? tty4? */ @@ -1420,7 +1420,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1447,4 +1447,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/sam3u/sam3u_start.c b/nuttx/arch/arm/src/sam3u/sam3u_start.c index 75cf8fa5c..aceda2c46 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_start.c +++ b/nuttx/arch/arm/src/sam3u/sam3u_start.c @@ -2,8 +2,8 @@ * arch/arm/src/sam3u/sam3u_start.c * arch/arm/src/chip/sam3u_start.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -129,7 +129,7 @@ void __start(void) /* Perform early serial initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif showprogress('D'); diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c index f589f18cb..9e103092f 100644 --- a/nuttx/arch/arm/src/stm32/stm32_serial.c +++ b/nuttx/arch/arm/src/stm32/stm32_serial.c @@ -95,7 +95,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER #ifdef HAVE_UART /**************************************************************************** @@ -1255,7 +1255,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1282,4 +1282,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/arm/src/stm32/stm32_start.c b/nuttx/arch/arm/src/stm32/stm32_start.c index 5434e3429..b1b2af297 100644 --- a/nuttx/arch/arm/src/stm32/stm32_start.c +++ b/nuttx/arch/arm/src/stm32/stm32_start.c @@ -2,7 +2,7 @@ * arch/arm/src/stm32/stm32_start.c * arch/arm/src/chip/stm32_start.c * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -140,7 +140,7 @@ void __start(void) /* Perform early serial initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif showprogress('D'); diff --git a/nuttx/arch/arm/src/str71x/str71x_head.S b/nuttx/arch/arm/src/str71x/str71x_head.S index 744e5865a..e83affa37 100644 --- a/nuttx/arch/arm/src/str71x/str71x_head.S +++ b/nuttx/arch/arm/src/str71x/str71x_head.S @@ -1,8 +1,8 @@ /***************************************************************************** * arch/arm/src/str71x/str71x_head.S * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +61,7 @@ .globl str71x_prccuinit /* Clock initialization */ .globl up_lowsetup /* Early initialization of UART */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT .globl up_earlyserialinit /* Early initialization of serial driver */ #endif #ifdef CONFIG_ARCH_LEDS @@ -541,7 +541,7 @@ __flashstart: /* Perform early serial initialization */ mov fp, #0 -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT bl up_earlyserialinit #endif diff --git a/nuttx/arch/arm/src/str71x/str71x_serial.c b/nuttx/arch/arm/src/str71x/str71x_serial.c index 31389404c..1cc6731ac 100644 --- a/nuttx/arch/arm/src/str71x/str71x_serial.c +++ b/nuttx/arch/arm/src/str71x/str71x_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/str71x/str71x_serial.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -93,7 +93,7 @@ * still must provide some minimal implementation of up_putc(). */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which UART with be tty0/console and which tty1? tty2? tty3? */ @@ -1019,7 +1019,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1046,4 +1046,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_config.h b/nuttx/arch/avr/src/at32uc3/at32uc3_config.h index 004c8b2d1..72536083a 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_config.h +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_config.h @@ -146,13 +146,27 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) || !defined(HAVE_RS232_DEVICE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# elif defined(HAVE_RS232_DEVICE) +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# else +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# endif +#endig /* If GPIO IRQ support is defined, then a set of GPIOs must all be included */ diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c b/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c index 37a4c48dc..2fb04a1ca 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c @@ -1,8 +1,8 @@ /****************************************************************************** * arch/avr/src/at32uc3/at32uc3_lowconsole.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -362,7 +362,7 @@ void up_consoleinit(void) * by up_earlyserialinit()). */ -#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_USE_EARLYSERIALINIT) +#if defined(HAVE_SERIAL_CONSOLE) && !defined(USE_EARLYSERIALINIT) usart_configure(AVR32_CONSOLE_BASE, AVR32_CONSOLE_BAUD, AVR32_CONSOLE_PARITY, AVR32_CONSOLE_BITS, (bool)AVR32_CONSOLE_2STOP); #endif diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c b/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c index d8d62488a..d1281491c 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c @@ -1,8 +1,8 @@ /************************************************************************** * arch/avr/src/at32uc3/at32uc3_lowinit.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -95,7 +95,7 @@ void up_lowinit(void) * available as soon as possible). */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c b/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c index e0c2bae48..ff5c5490d 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/at32uc3/at32uc3_serial.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,7 +78,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which USART with be tty0/console and which tty1? */ @@ -808,7 +808,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -835,5 +835,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/avr/src/at90usb/at90usb_config.h b/nuttx/arch/avr/src/at90usb/at90usb_config.h index 7505c162d..e6d2fb89e 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_config.h +++ b/nuttx/arch/avr/src/at90usb/at90usb_config.h @@ -1,8 +1,8 @@ /************************************************************************************ * arch/avr/src/at90usb/at90usb_config.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -65,13 +65,27 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) || !defined(HAVE_USART_DEVICE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# elif defined(HAVE_USART_DEVICE) +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# else +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# endif +#endig /************************************************************************************ * Public Types diff --git a/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c b/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c index f7a1b921e..5f8964f6c 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c @@ -1,8 +1,8 @@ /************************************************************************** * arch/avr/src/at90usb/at90usb_lowinit.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -142,7 +142,7 @@ void up_lowinit(void) * available as soon as possible). */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/avr/src/at90usb/at90usb_serial.c b/nuttx/arch/avr/src/at90usb/at90usb_serial.c index 88769bc0b..f75f38062 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_serial.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/at90usb/at90usb_serial.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,7 +77,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Private Types @@ -588,7 +588,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -615,5 +615,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/avr/src/atmega/atmega_config.h b/nuttx/arch/avr/src/atmega/atmega_config.h index bf314ad49..e0a7968cc 100644 --- a/nuttx/arch/avr/src/atmega/atmega_config.h +++ b/nuttx/arch/avr/src/atmega/atmega_config.h @@ -1,8 +1,8 @@ /************************************************************************************ * arch/avr/src/atmega/atmega_config.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -70,13 +70,27 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) || !defined(HAVE_USART_DEVICE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# elif defined(HAVE_USART_DEVICE) +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# else +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# endif +#endig /************************************************************************************ * Public Types diff --git a/nuttx/arch/avr/src/atmega/atmega_lowinit.c b/nuttx/arch/avr/src/atmega/atmega_lowinit.c index bb0a4d512..8456f0e11 100644 --- a/nuttx/arch/avr/src/atmega/atmega_lowinit.c +++ b/nuttx/arch/avr/src/atmega/atmega_lowinit.c @@ -1,8 +1,8 @@ /************************************************************************** * arch/avr/src/atmega/atmega_lowinit.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -142,7 +142,7 @@ void up_lowinit(void) * available as soon as possible). */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/avr/src/atmega/atmega_serial.c b/nuttx/arch/avr/src/atmega/atmega_serial.c index 813fa9e8f..b3106b1d0 100644 --- a/nuttx/arch/avr/src/atmega/atmega_serial.c +++ b/nuttx/arch/avr/src/atmega/atmega_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/atmega/atmega_serial.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,7 +77,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which USART with be tty0/console and which tty1? */ @@ -982,7 +982,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1009,5 +1009,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/avr/src/common/up_initialize.c b/nuttx/arch/avr/src/common/up_initialize.c index abbff8532..eed1b4135 100644 --- a/nuttx/arch/avr/src/common/up_initialize.c +++ b/nuttx/arch/avr/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/common/up_initialize.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,13 +57,24 @@ * This will probably have to be revisited someday. */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# else +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# endif +#endig /**************************************************************************** * Private Types @@ -162,12 +173,14 @@ void up_initialize(void) devnull_register(); /* Standard /dev/null */ #endif - /* Initialize the serial device driver */ + /* Initialize the console device driver */ -#ifdef CONFIG_USE_SERIALDRIVER +#if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/avr/src/common/up_internal.h b/nuttx/arch/avr/src/common/up_internal.h index e65b5627d..bc62be720 100644 --- a/nuttx/arch/avr/src/common/up_internal.h +++ b/nuttx/arch/avr/src/common/up_internal.h @@ -172,6 +172,14 @@ extern void lowconsole_init(void); # define lowconsole_init() #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + /* Defined in chip/xxx_timerisr.c */ extern void up_timerinit(void); diff --git a/nuttx/arch/hc/src/common/up_initialize.c b/nuttx/arch/hc/src/common/up_initialize.c index 9385cee1c..a1973e94a 100755 --- a/nuttx/arch/hc/src/common/up_initialize.c +++ b/nuttx/arch/hc/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/hc/src/common/up_initialize.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -148,12 +148,14 @@ void up_initialize(void) devnull_register(); /* Standard /dev/null */ #endif - /* Initialize the serial device driver */ + /* Initialize the console device driver */ -#ifdef CONFIG_USE_SERIALDRIVER +#if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/hc/src/common/up_internal.h b/nuttx/arch/hc/src/common/up_internal.h index efc4ce4b0..22677dd0f 100755 --- a/nuttx/arch/hc/src/common/up_internal.h +++ b/nuttx/arch/hc/src/common/up_internal.h @@ -1,8 +1,8 @@ /**************************************************************************** * arch/hc/src/common/up_internal.h * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -62,13 +62,24 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# else +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# endif +#endig /* Check if an interrupt stack size is configured */ @@ -167,6 +178,12 @@ extern void lowconsole_init(void); # define lowconsole_init() #endif +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + extern void up_lowputc(char ch); extern void up_puts(const char *str); extern void up_lowputs(const char *str); diff --git a/nuttx/arch/hc/src/m9s12/m9s12_serial.c b/nuttx/arch/hc/src/m9s12/m9s12_serial.c index 7b5ba365e..24d3e7765 100755 --- a/nuttx/arch/hc/src/m9s12/m9s12_serial.c +++ b/nuttx/arch/hc/src/m9s12/m9s12_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/hc/src/m9s12/m9s12_serial.c * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -54,13 +54,13 @@ * disabled if we are using ROM-resident serial I/O */ -#if !defined(HAVE_SERIAL_CONSOLE) || !defined(CONFIG_USE_SERIALDRIVER) || \ +#if !defined(HAVE_SERIAL_CONSOLE) || !defined(USE_SERIALDRIVER) || \ defined(CONFIG_HCS12_SERIALMON) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT #endif -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Yes, which is ttyS0 and which is ttyS1 */ @@ -735,7 +735,7 @@ static bool up_txempty(struct uart_dev_s *dev) * ****************************************************************************/ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT void up_earlyserialinit(void) { /* Disable all UARTS */ @@ -813,7 +813,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -841,4 +841,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/mips/src/common/up_initialize.c b/nuttx/arch/mips/src/common/up_initialize.c index 15e242a6e..0a061990b 100644 --- a/nuttx/arch/mips/src/common/up_initialize.c +++ b/nuttx/arch/mips/src/common/up_initialize.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/common/up_initialize.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -149,12 +149,14 @@ void up_initialize(void) devnull_register(); /* Standard /dev/null */ #endif - /* Initialize the serial device driver */ + /* Initialize the console device driver */ -#ifdef CONFIG_USE_SERIALDRIVER +#if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/mips/src/common/up_internal.h b/nuttx/arch/mips/src/common/up_internal.h index bca7656b8..25b5174a5 100755 --- a/nuttx/arch/mips/src/common/up_internal.h +++ b/nuttx/arch/mips/src/common/up_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/common/up_internal.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -62,13 +62,24 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# else +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# endif +#endig /* Check if an interrupt stack size is configured */ @@ -177,6 +188,14 @@ extern void lowconsole_init(void); # define lowconsole_init() #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + /* Debug */ #ifdef CONFIG_ARCH_STACKDUMP diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c index 6000f7684..fd0c41552 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/pic32/pic32mx-lowinit.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -195,7 +195,7 @@ void pic32mx_lowinit(void) * available as soon as possible). */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c b/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c index 0646a0037..334c03d1c 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/pic32mx/pic32mx-serial.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -77,7 +77,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which UART with be tty0/console and which tty1? The console will always * be ttyS0. If there is no console then will use the lowest numbered UART. @@ -868,7 +868,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -895,5 +895,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/sh/src/common/up_initialize.c b/nuttx/arch/sh/src/common/up_initialize.c index 92587ba31..b81e3b972 100644 --- a/nuttx/arch/sh/src/common/up_initialize.c +++ b/nuttx/arch/sh/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/sh/src/common/up_initialize.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -142,10 +142,12 @@ void up_initialize(void) * will have to detect that case. */ -#ifdef CONFIG_USE_SERIALDRIVER +#if defined(USE_SERIALDRIVER) up_consoleinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/sh/src/common/up_internal.h b/nuttx/arch/sh/src/common/up_internal.h index 7b1fb5f33..1b6e41635 100644 --- a/nuttx/arch/sh/src/common/up_internal.h +++ b/nuttx/arch/sh/src/common/up_internal.h @@ -1,8 +1,8 @@ /**************************************************************************** * arch/sh/src/common/up_internal.h * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -66,13 +66,24 @@ * will have to detect that case. */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# else +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# endif +#endig /* Check if an interrupt stack size is configured */ @@ -166,6 +177,14 @@ extern void lowconsole_init(void); # define lowconsole_init() #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + /* Defined in up_watchdog.c */ extern void up_wdtinit(void); diff --git a/nuttx/arch/sh/src/m16c/m16c_head.S b/nuttx/arch/sh/src/m16c/m16c_head.S index 72ab065ad..d0ab43761 100644 --- a/nuttx/arch/sh/src/m16c/m16c_head.S +++ b/nuttx/arch/sh/src/m16c/m16c_head.S @@ -1,8 +1,8 @@ /************************************************************************************ * arch/sh/src/m16c/m16c_head.S * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -244,7 +244,7 @@ __start: /* Perform early console initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT .globl _up_earlyconsoleinit /* Early initialization of console driver */ jsr.a _up_earlyconsoleinit /* Call it */ showprogress 'D' diff --git a/nuttx/arch/sh/src/m16c/m16c_serial.c b/nuttx/arch/sh/src/m16c/m16c_serial.c index d18b4af59..a3bc2485c 100644 --- a/nuttx/arch/sh/src/m16c/m16c_serial.c +++ b/nuttx/arch/sh/src/m16c/m16c_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/sh/src/m16c/m16c_serial.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -101,9 +101,9 @@ /* Are there any UARTs? */ #if defined(CONFIG_UART0_DISABLE) && defined(CONFIG_UART1_DISABLE) && defined(CONFIG_UART2_DISABLE) -# ifdef CONFIG_USE_SERIALDRIVER +# ifdef USE_SERIALDRIVER # error "Serial driver selected, but UARTs not enabled" -# undef CONFIG_USE_SERIALDRIVER +# undef USE_SERIALDRIVER # endif #endif @@ -137,7 +137,7 @@ # warning "No console is defined" #endif -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which UART with be tty0/console and which tty1 and tty2? */ @@ -1172,7 +1172,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1199,7 +1199,7 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ #elif defined(CONFIG_UART0_SERIAL_CONSOLE) || defined(CONFIG_UART1_SERIAL_CONSOLE)|| defined(CONFIG_UART2_SERIAL_CONSOLE) # error "A serial console selected, but corresponding UART not enabled" #endif /* !CONFIG_UART0_DISABLE && !CONFIG_UART1_DISABLE && !CONFIG_UART2_DISABLE */ diff --git a/nuttx/arch/sh/src/sh1/sh1_head.S b/nuttx/arch/sh/src/sh1/sh1_head.S index 15a82fcda..9a52b9bb3 100644 --- a/nuttx/arch/sh/src/sh1/sh1_head.S +++ b/nuttx/arch/sh/src/sh1/sh1_head.S @@ -1,8 +1,8 @@ /***************************************************************************** * arch/sh/src/sh1/sh1_head.S * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +61,7 @@ /* Called functions */ .globl _up_lowsetup /* Early initialization of UART */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT .globl _up_earlyconsoleinit /* Early initialization of console driver */ #endif #ifdef CONFIG_ARCH_LEDS @@ -426,7 +426,7 @@ __start0: /* Perform early console initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT mov.l .Learlyconsole, r0 /* Address of up_earlyconsoleinit */ jsr @r0 /* Call it */ or r0, r0 /* Delay slot */ @@ -481,7 +481,7 @@ __start0: .long _sbss .Lebss: .long _ebss -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT .Learlyconsole: .long _up_earlyconsoleinit #endif diff --git a/nuttx/arch/sh/src/sh1/sh1_serial.c b/nuttx/arch/sh/src/sh1/sh1_serial.c index 3f87ee4db..027da35fa 100644 --- a/nuttx/arch/sh/src/sh1/sh1_serial.c +++ b/nuttx/arch/sh/src/sh1/sh1_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_serial.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,9 +67,9 @@ /* Are there any SCIs? */ #if !defined(CONFIG_SH1_SCI0) && !defined(CONFIG_SH1_SCI1) -# ifdef CONFIG_USE_SERIALDRIVER +# ifdef USE_SERIALDRIVER # error "Serial driver selected, but SCIs not enabled" -# undef CONFIG_USE_SERIALDRIVER +# undef USE_SERIALDRIVER # endif #endif @@ -90,7 +90,7 @@ # undef CONFIG_SCI1_SERIAL_CONSOLE #endif -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which SCI with be tty0/console and which tty1? */ @@ -927,7 +927,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -954,4 +954,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/x86/src/common/up_initialize.c b/nuttx/arch/x86/src/common/up_initialize.c index 0ceeddbb6..92d4d3537 100644 --- a/nuttx/arch/x86/src/common/up_initialize.c +++ b/nuttx/arch/x86/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/x86/src/common/up_initialize.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -149,12 +149,14 @@ void up_initialize(void) devnull_register(); /* Standard /dev/null */ #endif - /* Initialize the serial device driver */ + /* Initialize the console device driver */ -#ifdef CONFIG_USE_SERIALDRIVER +#if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/x86/src/common/up_internal.h b/nuttx/arch/x86/src/common/up_internal.h index 185d0afc0..f95a9bc74 100644 --- a/nuttx/arch/x86/src/common/up_internal.h +++ b/nuttx/arch/x86/src/common/up_internal.h @@ -1,8 +1,8 @@ /**************************************************************************** * arch/x86/src/common/up_internal.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,13 +61,24 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# else +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# endif +#endig /* Check if an interrupt stack size is configured */ @@ -192,6 +203,14 @@ extern void lowconsole_init(void); # define lowconsole_init() #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + /* Defined in up_watchdog.c */ extern void up_wdtinit(void); diff --git a/nuttx/arch/x86/src/qemu/qemu_lowsetup.c b/nuttx/arch/x86/src/qemu/qemu_lowsetup.c index 20250c33d..3b58f696c 100644 --- a/nuttx/arch/x86/src/qemu/qemu_lowsetup.c +++ b/nuttx/arch/x86/src/qemu/qemu_lowsetup.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/x86/src/qemu/qemu_lowsetup.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -129,7 +129,7 @@ void up_lowsetup(void) /* Early serial driver initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/x86/src/qemu/qemu_serial.c b/nuttx/arch/x86/src/qemu/qemu_serial.c index 527ca0c05..4c7d462ea 100644 --- a/nuttx/arch/x86/src/qemu/qemu_serial.c +++ b/nuttx/arch/x86/src/qemu/qemu_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/x86/src/qemu/qemu_serial.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,7 +51,7 @@ * driver for this platform. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Pre-processor Definitions @@ -88,7 +88,7 @@ void uart_putreg(uart_addrwidth_t base, unsigned int offset, uart_datawidth_t va outb(value, base + offset); } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -113,4 +113,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/z16/src/common/up_initialize.c b/nuttx/arch/z16/src/common/up_initialize.c index 063ccdf71..ab653f368 100644 --- a/nuttx/arch/z16/src/common/up_initialize.c +++ b/nuttx/arch/z16/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * common/up_initialize.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -162,12 +162,16 @@ void up_initialize(void) /* Initialize the serial device driver */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER up_serialinit(); #endif -#ifdef CONFIG_USE_LOWCONSOLE + /* Initialize the console device driver */ + +#if defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/z16/src/common/up_internal.h b/nuttx/arch/z16/src/common/up_internal.h index 117d7f405..e0c8ffc61 100644 --- a/nuttx/arch/z16/src/common/up_internal.h +++ b/nuttx/arch/z16/src/common/up_internal.h @@ -1,8 +1,8 @@ /**************************************************************************** * common/up_internal.h * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -64,11 +64,11 @@ #if defined(CONFIG_Z16_LOWPUTC) || defined(CONFIG_Z16_LOWGETC) || \ CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# define CONFIG_USE_LOWCONSOLE 1 -# define CONFIG_USE_LOWUARTINIT 1 +# define USE_LOWCONSOLE 1 +# define USE_LOWUARTINIT 1 #elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 #endif /* Macros for portability */ @@ -131,15 +131,21 @@ void up_addregion(void); /* Defined in up_serial.c */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER extern void up_earlyserialinit(void); extern void up_serialinit(void); #endif -#ifdef CONFIG_USE_LOWCONSOLE +#ifdef USE_LOWCONSOLE extern void lowconsole_init(void); #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#endif + /* Defined in up_timerisr.c */ extern void up_timerinit(void); diff --git a/nuttx/arch/z16/src/z16f/z16f_head.S b/nuttx/arch/z16/src/z16f/z16f_head.S index 569b0a3fd..db757d6d7 100755 --- a/nuttx/arch/z16/src/z16f/z16f_head.S +++ b/nuttx/arch/z16/src/z16f/z16f_head.S @@ -2,8 +2,8 @@ * arch/z16/src/z16f/z16f_head.S * Z16F Reset Entry Point * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,9 +55,9 @@ #ifdef CONFIG_ARCH_LEDS xref _up_ledinit:EROM #endif -#if defined(CONFIG_USE_LOWUARTINIT) +#if defined(USE_LOWUARTINIT) xref _z16f_lowuartinit:EROM -#elif defined(CONFIG_USE_EARLYSERIALINIT) +#elif defined(USE_EARLYSERIALINIT) xref _up_earlyserialinit:EROM #endif xref _os_start:EROM @@ -161,7 +161,7 @@ _z16f_reset: #endif /* Perform VERY early UART initialization so that we can use it here */ -#ifdef CONFIG_USE_LOWUARTINIT +#ifdef USE_LOWUARTINIT call _z16f_lowuartinit /* Initialize the UART for debugging */ #endif /* Initialize the hardware stack overflow register */ @@ -214,7 +214,7 @@ _z16f_reset8: call _z16f_lowinit /* Perform low-level hardware initialization */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT /* Perform early serial initialization */ call _up_earlyserialinit diff --git a/nuttx/arch/z16/src/z16f/z16f_lowuart.S b/nuttx/arch/z16/src/z16f/z16f_lowuart.S index 1df5b62ca..1aa11a557 100755 --- a/nuttx/arch/z16/src/z16f/z16f_lowuart.S +++ b/nuttx/arch/z16/src/z16f/z16f_lowuart.S @@ -2,8 +2,8 @@ * arch/z16/src/z16f/z16f_lowuart.asm * Z16F UART management * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,7 +42,7 @@ #include "chip/chip.h" #include "common/up_internal.h" -#ifdef CONFIG_USE_LOWUARTINIT +#ifdef USE_LOWUARTINIT /************************************************************************* * External References / External Definitions @@ -121,7 +121,7 @@ _z16f_lowuartinit: ld.b Z16F_UART0_CTL0, r0 /* Z16F_UART0_CTL0 = %c0 */ #endif ret /* Return */ -#endif /* CONFIG_USE_LOWUARTINIT */ +#endif /* USE_LOWUARTINIT */ /************************************************************************* * Name: _up_lowputc diff --git a/nuttx/arch/z16/src/z16f/z16f_serial.c b/nuttx/arch/z16/src/z16f/z16f_serial.c index 20b888caf..ffe03decc 100644 --- a/nuttx/arch/z16/src/z16f/z16f_serial.c +++ b/nuttx/arch/z16/src/z16f/z16f_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/z16/src/z16f/z16f_serial.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,7 +57,7 @@ #include "os_internal.h" #include "up_internal.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions @@ -737,7 +737,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Definitions @@ -803,4 +803,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/z80/src/common/up_initialize.c b/nuttx/arch/z80/src/common/up_initialize.c index 1c71fa517..a4659a2e9 100644 --- a/nuttx/arch/z80/src/common/up_initialize.c +++ b/nuttx/arch/z80/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/z80/src/common/up_initialize.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -153,14 +153,18 @@ void up_initialize(void) /* Initialize the serial device driver */ -#ifdef CONFIG_USE_LOWUARTINIT +#ifdef USE_LOWUARTINIT up_lowuartinit(); #endif -#ifdef CONFIG_USE_SERIALDRIVER + /* Initialize the console device driver */ + +#if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/z80/src/common/up_internal.h b/nuttx/arch/z80/src/common/up_internal.h index 2e5afb2e3..919a74353 100644 --- a/nuttx/arch/z80/src/common/up_internal.h +++ b/nuttx/arch/z80/src/common/up_internal.h @@ -69,15 +69,15 @@ /* Determine which (if any) console driver to use */ #if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER +# undef USE_SERIALDRIVER # ifdef CONFIG_HAVE_LOWUARTINIT -# define CONFIG_USE_LOWUARTINIT 1 +# define USE_LOWUARTINIT 1 # else -# undef CONFIG_USE_LOWUARTINIT +# undef USE_LOWUARTINIT # endif #elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# undef CONFIG_USE_LOWUARTINIT +# define USE_SERIALDRIVER 1 +# undef USE_LOWUARTINIT #endif /**************************************************************************** @@ -105,7 +105,7 @@ extern "C" { EXTERN void up_irqinitialize(void); EXTERN int up_timerisr(int irq, FAR chipreg_t *regs); -#ifdef CONFIG_USE_LOWUARTINIT +#ifdef USE_LOWUARTINIT EXTERN void up_lowuartinit(void); #endif @@ -125,7 +125,7 @@ void up_addregion(void); /* Defined in up_serial.c */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER EXTERN void up_serialinit(void); #else # define up_serialinit() @@ -139,6 +139,14 @@ EXTERN void lowconsole_init(void); # define lowconsole_init() #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + /* Low level string output */ extern void up_puts(const char *str); diff --git a/nuttx/arch/z80/src/ez80/ez80_lowuart.c b/nuttx/arch/z80/src/ez80/ez80_lowuart.c index 307cecc59..ed4f92fac 100644 --- a/nuttx/arch/z80/src/ez80/ez80_lowuart.c +++ b/nuttx/arch/z80/src/ez80/ez80_lowuart.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_loweruart.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -49,7 +49,7 @@ #include "chip/chip.h" #include "common/up_internal.h" -#ifdef CONFIG_USE_LOWUARTINIT +#ifdef USE_LOWUARTINIT /**************************************************************************** * Private Definitions @@ -253,4 +253,4 @@ void up_lowuartinit(void) #endif /* HAVE_SERIAL */ } -#endif /* CONFIG_USE_LOWUARTINIT */ +#endif /* USE_LOWUARTINIT */ diff --git a/nuttx/arch/z80/src/ez80/ez80_serial.c b/nuttx/arch/z80/src/ez80/ez80_serial.c index 7b3ea7409..8fbbe46c1 100644 --- a/nuttx/arch/z80/src/ez80/ez80_serial.c +++ b/nuttx/arch/z80/src/ez80/ez80_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/z80/src/ez08/ez80_serial.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,7 +58,7 @@ #include "os_internal.h" #include "up_internal.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions @@ -774,7 +774,7 @@ int up_putc(int ch) #endif } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Definitions @@ -839,4 +839,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/z80/src/z8/z8_lowuart.c b/nuttx/arch/z80/src/z8/z8_lowuart.c index 15a7999ec..07832572c 100644 --- a/nuttx/arch/z80/src/z8/z8_lowuart.c +++ b/nuttx/arch/z80/src/z8/z8_lowuart.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/z80/src/z8/z8_loweruart.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -49,7 +49,7 @@ #include "chip/chip.h" #include "common/up_internal.h" -#ifdef CONFIG_USE_LOWUARTINIT +#ifdef USE_LOWUARTINIT extern uint32_t get_freq(void); @@ -127,4 +127,4 @@ void up_lowuartinit(void) putreg8(0xc0, U1CTL0); /* Transmit enable, Receive enable, no Parity, 1 Stop bit */ #endif } -#endif /* CONFIG_USE_LOWUARTINIT */ \ No newline at end of file +#endif /* USE_LOWUARTINIT */ \ No newline at end of file diff --git a/nuttx/arch/z80/src/z8/z8_serial.c b/nuttx/arch/z80/src/z8/z8_serial.c index f1427eaae..db13ab67d 100755 --- a/nuttx/arch/z80/src/z8/z8_serial.c +++ b/nuttx/arch/z80/src/z8/z8_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/z80/src/z8/z8_serial.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,7 +58,7 @@ #include "os_internal.h" #include "up_internal.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER extern uint32_t get_freq(void); @@ -790,7 +790,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Definitions @@ -856,4 +856,4 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index fc1743ced..a69c51e7e 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -303,6 +303,9 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_GREGORIAN_TIME in order to use Julian time. CONFIG_DEV_CONSOLE - Set if architecture-specific logic provides /dev/console. Enables stdout, stderr, stdin. + This implies the "normal" serial driver provides the + console unless another console device is specified + (See CONFIG_DEV_LOWCONSOLE). CONFIG_MUTEX_TYPES - Set to enable support for recursive and errorcheck mutexes. Enables pthread_mutexattr_settype(). CONFIG_PRIORITY_INHERITANCE - Set to enable support for diff --git a/nuttx/configs/demo9s12ne64/ostest/defconfig b/nuttx/configs/demo9s12ne64/ostest/defconfig index 52252cf3d..fbb39a52d 100755 --- a/nuttx/configs/demo9s12ne64/ostest/defconfig +++ b/nuttx/configs/demo9s12ne64/ostest/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/demo9s12ne64/ostest/defconfig # -# Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/ne64badge/ostest/defconfig b/nuttx/configs/ne64badge/ostest/defconfig index 7af1d943b..b39d11d44 100755 --- a/nuttx/configs/ne64badge/ostest/defconfig +++ b/nuttx/configs/ne64badge/ostest/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/ne64badge/ostest/defconfig # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/ntosd-dm320/uip/defconfig b/nuttx/configs/ntosd-dm320/uip/defconfig index 8b4d65dcf..a57bb9483 100644 --- a/nuttx/configs/ntosd-dm320/uip/defconfig +++ b/nuttx/configs/ntosd-dm320/uip/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/ntosd-dm320/uip/defconfig # -# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/pjrc-8051/defconfig b/nuttx/configs/pjrc-8051/defconfig index add9fa13d..706cb1792 100644 --- a/nuttx/configs/pjrc-8051/defconfig +++ b/nuttx/configs/pjrc-8051/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/pjrc-8051/defconfig # -# Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007-2011, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/skp16c26/src/up_lcdconsole.c b/nuttx/configs/skp16c26/src/up_lcdconsole.c index c4e1d0e79..1ae00fb22 100644 --- a/nuttx/configs/skp16c26/src/up_lcdconsole.c +++ b/nuttx/configs/skp16c26/src/up_lcdconsole.c @@ -1,8 +1,8 @@ /************************************************************************************ * configs/scp16c26/src/up_lcd.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -84,7 +84,7 @@ * ************************************************************************************/ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT # warning "You probably need to define CONFIG_ARCH_LOWCONSOLE" void up_earlyconsoleinit(void) { @@ -101,7 +101,7 @@ void up_earlyconsoleinit(void) * ************************************************************************************/ -#if CONFIG_USE_SERIALDRIVER +#if USE_SERIALDRIVER # warning "You probably need to define CONFIG_ARCH_LOWCONSOLE" void up_consoleinit(void) { diff --git a/nuttx/configs/xtrs/nsh/defconfig b/nuttx/configs/xtrs/nsh/defconfig index c7c4e48a7..b59210923 100644 --- a/nuttx/configs/xtrs/nsh/defconfig +++ b/nuttx/configs/xtrs/nsh/defconfig @@ -1,8 +1,8 @@ ############################################################################ # sim/xtrs/nsh/defconfig # -# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/xtrs/ostest/defconfig b/nuttx/configs/xtrs/ostest/defconfig index 582caa1c7..be9e82c73 100644 --- a/nuttx/configs/xtrs/ostest/defconfig +++ b/nuttx/configs/xtrs/ostest/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/xtrs/ostest/defconfig # -# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/xtrs/pashello/defconfig b/nuttx/configs/xtrs/pashello/defconfig index a05103b82..dc5f45044 100644 --- a/nuttx/configs/xtrs/pashello/defconfig +++ b/nuttx/configs/xtrs/pashello/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/xtrs/pashello/defconfig # -# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/xtrs/src/xtr_serial.c b/nuttx/configs/xtrs/src/xtr_serial.c index f37d2876a..c0c9f1f4c 100644 --- a/nuttx/configs/xtrs/src/xtr_serial.c +++ b/nuttx/configs/xtrs/src/xtr_serial.c @@ -6,7 +6,7 @@ * * This file is a part of NuttX and hence * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,7 +60,7 @@ #include "os_internal.h" #include "up_internal.h" -#ifdef CONFIG_USE_SERIAL_DRIVER +#ifdef USE_SERIAL_DRIVER /**************************************************************************** * Definitions @@ -393,7 +393,7 @@ void up_serialinit(void) (void)uart_register("/dev/console", &g_uartport); (void)uart_register("/dev/ttyS0", &g_uartport); } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index e32d2612b..e51a2fb48 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/z80sim/ostest/defconfig # -# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/z80sim/src/z80_serial.c b/nuttx/configs/z80sim/src/z80_serial.c index 0e66c804f..bdb4e6221 100644 --- a/nuttx/configs/z80sim/src/z80_serial.c +++ b/nuttx/configs/z80sim/src/z80_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * board/z80_serial.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -56,7 +56,7 @@ #include "os_internal.h" #include "up_internal.h" -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions @@ -342,7 +342,7 @@ void up_serialinit(void) (void)uart_register("/dev/console", &g_uartport); (void)uart_register("/dev/ttyS0", &g_uartport); } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig index 8caa8dfb4..83b08c963 100644 --- a/nuttx/configs/z8encore000zco/ostest/defconfig +++ b/nuttx/configs/z8encore000zco/ostest/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/z8encore000zco/ostest/defconfig # -# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig index a5c501ec8..4448f34ad 100644 --- a/nuttx/configs/z8f64200100kit/ostest/defconfig +++ b/nuttx/configs/z8f64200100kit/ostest/defconfig @@ -1,8 +1,8 @@ ############################################################################ # configs/z8f64200100kit/ostest/defconfig # -# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2008, 2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/drivers/ramlog.c b/nuttx/drivers/ramlog.c index 79f57636c..741979e7f 100644 --- a/nuttx/drivers/ramlog.c +++ b/nuttx/drivers/ramlog.c @@ -56,7 +56,7 @@ #include #include #include -//#include +#include #include @@ -65,23 +65,6 @@ /**************************************************************************** * Private Types ****************************************************************************/ -/* Configuration ************************************************************/ -/* CONFIG_RAMLOG - Enables the RAM logging feature - * CONFIG_RAMLOG_CONSOLE - Use the RAM logging device as a system console. - * CONFIG_RAMLOG_SYSLOG - Use the RAM logging device for the syslogging - * interface. This should have: - * CONFIG_SYSLOG=ramlog - * CONFIG_RAMLOG_NPOLLWAITERS - The number of threads than can be waiting - * for this driver on poll(). Default: 4 - */ - -#ifndef CONFIG_RAMLOG_NPOLLWAITERS -# define CONFIG_RAMLOG_NPOLLWAITERS 4 -#endif - -#ifndef CONFIG_SYSLOG -# undef CONFIG_RAMLOG_SYSLOG -#endif /**************************************************************************** * Private Types @@ -91,7 +74,7 @@ struct ramlog_dev_s { volatile uint8_t rl_nwaiters; /* Number of threads waiting for data */ volatile uint16_t rl_head; /* The head index (where data is added) */ - volatile uint16_t rl_tail; /* The tail index (where data is remove) */ + volatile uint16_t rl_tail; /* The tail index (where data is removed) */ sem_t rl_exclsem; /* Enforces mutually exclusive access */ sem_t rl_waitsem; /* Used to wait for data */ size_t rl_bufsize; /* Size of the RAM buffer */ @@ -135,6 +118,12 @@ static const struct file_operations g_ramlogfops = #endif }; +/* This is the pre-allocated buffer used for the console RAM log */ + +#ifdef CONFIG_RAMLOG_CONSOLE +static char g_consoleramlog[CONFIG_RAMLOG_CONSOLE_BUFSIZE]; +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -570,6 +559,25 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen) return ret; } +/**************************************************************************** + * Name: ramlog_consoleinit + * + * Description: + * Create the RAM logging device and register it at the specified path. + * Mostly likely this path will be /dev/console + * + ****************************************************************************/ + +#ifdef CONFIG_RAMLOG_CONSOLE +int ramlog_consoleinit(void) +{ + /* Register a RAM log as the console device */ + + return ramlog_register("/dev/console", g_consoleramlog, + CONFIG_RAMLOG_CONSOLE_BUFSIZE); +} +#endif + /**************************************************************************** * Name: ramlog * diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c index cff810743..2d09574f9 100644 --- a/nuttx/drivers/serial/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -1,8 +1,8 @@ /************************************************************************************ * drivers/serial/serial.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -139,7 +139,7 @@ static void uart_pollnotify(FAR uart_dev_t *dev, pollevent_t eventset) { int i; - for (i = 0; i < CONFIG_DEV_CONSOLE_NPOLLWAITERS; i++) + for (i = 0; i < CONFIG_SERIAL_NPOLLWAITERS; i++) { struct pollfd *fds = dev->fds[i]; if (fds) @@ -449,7 +449,7 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) * slot for the poll structure reference */ - for (i = 0; i < CONFIG_DEV_CONSOLE_NPOLLWAITERS; i++) + for (i = 0; i < CONFIG_SERIAL_NPOLLWAITERS; i++) { /* Find an available slot */ @@ -463,7 +463,7 @@ int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) } } - if (i >= CONFIG_DEV_CONSOLE_NPOLLWAITERS) + if (i >= CONFIG_SERIAL_NPOLLWAITERS) { fds->priv = NULL; ret = -EBUSY; diff --git a/nuttx/include/nuttx/ramlog.h b/nuttx/include/nuttx/ramlog.h new file mode 100644 index 000000000..4f42de965 --- /dev/null +++ b/nuttx/include/nuttx/ramlog.h @@ -0,0 +1,151 @@ +/**************************************************************************** + * include/nuttx/ramlog.h + * The RAM logging driver + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ +/* The RAM logging driver is a driver that was intended to support debugging + * output (syslogging) when the normal serial output is not available. For + * example, if you are using a telnet or USB serial console, the debug + * output will get lost. + * + * The RAM logging driver is similar to a pipe in that it saves the + * debugging output in a FIFO in RAM. It differs from a pipe in numerous + * details as needed to support logging. + * + * This driver is built when CONFIG_RAMLOG is defined in the Nuttx + * configuration. + */ + +#ifndef __INCLUDE_NUTTX_RAMLOG_H +#define __INCLUDE_NUTTX_RAMLOG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#ifdef CONFIG_RAMLOG + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ +/* CONFIG_RAMLOG - Enables the RAM logging feature + * CONFIG_RAMLOG_CONSOLE - Use the RAM logging device as a system console. + * CONFIG_RAMLOG_SYSLOG - Use the RAM logging device for the syslogging + * interface. This should have: + * CONFIG_SYSLOG=ramlog + * CONFIG_RAMLOG_NPOLLWAITERS - The number of threads than can be waiting + * for this driver on poll(). Default: 4 + * + * If CONFIG_RAMLOG_CONSOLE is selected, then the following may also be + * provided: + * + * CONFIG_RAMLOG_CONSOLE_BUFSIZE - Size of the console RAM log. Default: 1024 + */ + +#ifndef CONFIG_RAMLOG_NPOLLWAITERS +# define CONFIG_RAMLOG_NPOLLWAITERS 4 +#endif + +#ifndef CONFIG_SYSLOG +# undef CONFIG_RAMLOG_SYSLOG +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ +/**************************************************************************** + * Name: ramlog_register + * + * Description: + * Create the RAM logging device and register it at the specified path. + * Mostly likely this path will be /dev/console + * + ****************************************************************************/ + +EXTERN int ramlog_register(FAR const char *devpath, FAR char *buffer, + size_t buflen); + +/**************************************************************************** + * Name: ramlog_consoleinit + * + * Description: + * Create the RAM logging device and register it at the specified path. + * Mostly likely this path will be /dev/console + * + ****************************************************************************/ + +#ifdef CONFIG_RAMLOG_CONSOLE +EXTERN int ramlog_consoleinit(void) +#endif + +/**************************************************************************** + * Name: ramlog + * + * Description: + * This is the low-level system logging interface. The debugging/syslogging + * interfaces are lib_rawprintf() and lib_lowprinf(). The difference is + * the lib_rawprintf() writes to fd=1 (stdout) and lib_lowprintf() uses + * a lower level interface that works from interrupt handlers. This + * function is a a low-level interface used to implement lib_lowprintf() + * when CONFIG_RAMLOG_SYSLOG=y and CONFIG_SYSLOG=ramlog + * + ****************************************************************************/ + +#ifdef CONFIG_RAMLOG_SYSLOG +# warning "Missing logic" +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* CONFIG_RAMLOG */ +#endif /* __INCLUDE_NUTTX_RAMLOG_H */ diff --git a/nuttx/include/nuttx/serial.h b/nuttx/include/nuttx/serial.h index 8a1b1f444..880bc1c01 100644 --- a/nuttx/include/nuttx/serial.h +++ b/nuttx/include/nuttx/serial.h @@ -54,8 +54,8 @@ /* Maximum number of threads than can be waiting for POLL events */ -#ifndef CONFIG_DEV_CONSOLE_NPOLLWAITERS -# define CONFIG_DEV_CONSOLE_NPOLLWAITERS 2 +#ifndef CONFIG_SERIAL_NPOLLWAITERS +# define CONFIG_SERIAL_NPOLLWAITERS 2 #endif /* vtable access helpers */ @@ -211,7 +211,7 @@ struct uart_dev_s */ #ifndef CONFIG_DISABLE_POLL - struct pollfd *fds[CONFIG_DEV_CONSOLE_NPOLLWAITERS]; + struct pollfd *fds[CONFIG_SERIAL_NPOLLWAITERS]; #endif };