mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
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
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user