diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-11 03:50:52 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-11 03:50:52 +0000 |
commit | 4a62de545bf87610c2415218e144ddef4dd0e75c (patch) | |
tree | 6c5b47ab79d40800d497f8a470aad5aa569ff9d6 /nuttx/arch/sh | |
parent | 24af177eb1a3e7036f8a3ee5342970ddeb151124 (diff) | |
download | px4-nuttx-4a62de545bf87610c2415218e144ddef4dd0e75c.tar.gz px4-nuttx-4a62de545bf87610c2415218e144ddef4dd0e75c.tar.bz2 px4-nuttx-4a62de545bf87610c2415218e144ddef4dd0e75c.zip |
Add logic so that a RAM log can be used in place of a console device
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4380 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sh')
-rw-r--r-- | nuttx/arch/sh/src/common/up_initialize.c | 8 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_internal.h | 37 | ||||
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_head.S | 6 | ||||
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_serial.c | 14 | ||||
-rw-r--r-- | nuttx/arch/sh/src/sh1/sh1_head.S | 10 | ||||
-rw-r--r-- | nuttx/arch/sh/src/sh1/sh1_serial.c | 14 |
6 files changed, 55 insertions, 34 deletions
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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 */ |