Add logic so that a RAM log can be used in place of a console device

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4380 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-02-11 03:50:52 +00:00
parent ddd6b7d383
commit f03655f43a
85 changed files with 732 additions and 380 deletions
+6 -4
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/x86/src/common/up_initialize.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2011-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
@@ -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 */
+28 -9
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/x86/src/common/up_internal.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2011-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,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);
+3 -3
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/x86/src/qemu/qemu_lowsetup.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2011-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
@@ -129,7 +129,7 @@ void up_lowsetup(void)
/* Early serial driver initialization */
#ifdef CONFIG_USE_EARLYSERIALINIT
#ifdef USE_EARLYSERIALINIT
up_earlyserialinit();
#endif
+5 -5
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/x86/src/qemu/qemu_serial.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2011-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
@@ -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 */