diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index ef2ffdb70e3..17f765201a4 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -6668,9 +6668,9 @@ int syslog_channel(FAR const struct syslog_channel_s *channel);
#include <nuttx/syslog/syslog.h>
#ifndef CONFIG_ARCH_SYSLOG
-int syslog_initialize(enum syslog_init_e phase);
+int syslog_initialize(void);
#else
-# define syslog_initialize(phase)
+# define syslog_initialize()
#endif
Description:
@@ -6693,13 +6693,6 @@ int syslog_initialize(enum syslog_init_e phase);
If CONFIG_ARCH_SYSLOG is selected, then the architecture-specific logic will provide its own SYSLOG device initialize which must include as a minimum a call to syslog_channel() to use the device.
-
Input Parameters:
-
Returned Value:
Zero (OK) is returned on success; a negated errno value is returned on any failure.
@@ -6707,19 +6700,8 @@ int syslog_initialize(enum syslog_init_e phase);
Different types of SYSLOG devices have different OS initialization
requirements. Some are available immediately at reset, some are available
after some basic OS initialization, and some only after OS is fully
- initialized. In order to satisfy these different initialization
- requirements, syslog_initialize() is called twice from the boot-up logic:
+ initialized.
-
- -
-
- syslog_initialize() is called from the architecture-specific up_initialize() function as some as basic hardware resources have been initialized: Timers, interrupts, etc. In this case, syslog_initialize() is called with the argument SYSLOG_INIT_EARLY.
-
- -
-
- syslog_initialize() is called again from nx_start() when the full OS initialization has completed, just before the application main entry point is spawned. In this case, syslog_initialize() is called with the argument SYSLOG_INIT_LATE.
-
-
There are other types of SYSLOG channel devices that may require even further initialization. For example, the file SYSLOG channel (described below) cannot be initialized until the necessary file systems have been mounted.
diff --git a/arch/arm/src/common/up_initialize.c b/arch/arm/src/common/up_initialize.c
index e4d63b87874..7e802f4b61a 100644
--- a/arch/arm/src/common/up_initialize.c
+++ b/arch/arm/src/common/up_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -201,13 +200,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c
index 7b4cbc10671..4c76df08205 100644
--- a/arch/avr/src/common/up_initialize.c
+++ b/arch/avr/src/common/up_initialize.c
@@ -48,7 +48,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -230,13 +229,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c
index 95b7a7a79a2..3397f049875 100644
--- a/arch/hc/src/common/up_initialize.c
+++ b/arch/hc/src/common/up_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -163,13 +162,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/mips/src/common/up_initialize.c b/arch/mips/src/common/up_initialize.c
index a741582bd08..2bab501228f 100644
--- a/arch/mips/src/common/up_initialize.c
+++ b/arch/mips/src/common/up_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -165,13 +164,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/or1k/src/common/up_initialize.c b/arch/or1k/src/common/up_initialize.c
index e0015f102b3..bfc6d42b6fa 100644
--- a/arch/or1k/src/common/up_initialize.c
+++ b/arch/or1k/src/common/up_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -256,13 +255,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
/* Print OpenRISC CPU information */
or1k_print_cpuinfo();
diff --git a/arch/renesas/src/common/up_initialize.c b/arch/renesas/src/common/up_initialize.c
index 1e040349c3a..af513983b09 100644
--- a/arch/renesas/src/common/up_initialize.c
+++ b/arch/renesas/src/common/up_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -149,13 +148,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/risc-v/src/common/up_initialize.c b/arch/risc-v/src/common/up_initialize.c
index a6d01916571..989837bab68 100644
--- a/arch/risc-v/src/common/up_initialize.c
+++ b/arch/risc-v/src/common/up_initialize.c
@@ -44,7 +44,6 @@
#include
#include
#include
-#include
#include
#include
@@ -147,12 +146,5 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
board_autoled_on(LED_IRQSENABLED);
}
diff --git a/arch/sim/src/sim/up_initialize.c b/arch/sim/src/sim/up_initialize.c
index 5ef6abba367..ee2531d780a 100644
--- a/arch/sim/src/sim/up_initialize.c
+++ b/arch/sim/src/sim/up_initialize.c
@@ -50,7 +50,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -240,13 +239,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/x86/src/common/up_initialize.c b/arch/x86/src/common/up_initialize.c
index efc6f7345d3..82731becb0d 100644
--- a/arch/x86/src/common/up_initialize.c
+++ b/arch/x86/src/common/up_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -165,13 +164,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/xtensa/src/common/xtensa_initialize.c b/arch/xtensa/src/common/xtensa_initialize.c
index 516146819ea..9d92d6efaf5 100644
--- a/arch/xtensa/src/common/xtensa_initialize.c
+++ b/arch/xtensa/src/common/xtensa_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -173,13 +172,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/z16/src/common/up_initialize.c b/arch/z16/src/common/up_initialize.c
index 51cd2eba5d8..4ce2e09e0cd 100644
--- a/arch/z16/src/common/up_initialize.c
+++ b/arch/z16/src/common/up_initialize.c
@@ -49,7 +49,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -165,13 +164,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on only minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/arch/z80/src/common/up_initialize.c b/arch/z80/src/common/up_initialize.c
index 61556c9ada7..beaf3d0e165 100644
--- a/arch/z80/src/common/up_initialize.c
+++ b/arch/z80/src/common/up_initialize.c
@@ -50,7 +50,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -164,13 +163,6 @@ void up_initialize(void)
ptmx_register();
#endif
- /* Early initialization of the system logging device. Some SYSLOG channel
- * can be initialized early in the initialization sequence because they
- * depend on minimal OS initialization.
- */
-
- syslog_initialize(SYSLOG_INIT_EARLY);
-
#if defined(CONFIG_CRYPTO)
/* Initialize the HW crypto and /dev/crypto */
diff --git a/drivers/syslog/README.txt b/drivers/syslog/README.txt
index dbc46df567c..6b8541cd80f 100644
--- a/drivers/syslog/README.txt
+++ b/drivers/syslog/README.txt
@@ -189,9 +189,9 @@ SYSLOG Channels
Prototype:
#ifndef CONFIG_ARCH_SYSLOG
- int syslog_initialize(enum syslog_init_e phase);
+ int syslog_initialize(void);
#else
- # define syslog_initialize(phase)
+ # define syslog_initialize()
#endif
Description:
@@ -209,10 +209,6 @@ SYSLOG Channels
logic will provide its own SYSLOG device initialize which must include
as a minimum a call to syslog_channel() to use the device.
- Input Parameters:
-
- * phase - One of {SYSLOG_INIT_EARLY, SYSLOG_INIT_LATE}
-
Returned Value:
Zero (OK) is returned on success; a negated errno value is returned on
any failure.
@@ -220,17 +216,7 @@ SYSLOG Channels
Different types of SYSLOG devices have different OS initialization
requirements. Some are available immediately at reset, some are available
after some basic OS initialization, and some only after OS is fully
- initialized. In order to satisfy these different initialization
- requirements, syslog_initialize() is called twice from the boot-up logic:
-
- * syslog_initialize() is called from the architecture-specific
- up_initialize() function as some as basic hardware resources have been
- initialized: Timers, interrupts, etc. In this case,
- syslog_initialize() is called with the argument SYSLOG_INIT_EARLY.
- * syslog_initialize() is called again from nx_start() when the full OS
- initialization has completed, just before the application main entry
- point is spawned. In this case, syslog_initialize() is called with
- the argument SYSLOG_INIT_LATE.
+ initialized.
There are other types of SYSLOG channel devices that may require even
further initialization. For example, the file SYSLOG channel (described
diff --git a/drivers/syslog/ramlog.c b/drivers/syslog/ramlog.c
index bbb76707098..7823d4596de 100644
--- a/drivers/syslog/ramlog.c
+++ b/drivers/syslog/ramlog.c
@@ -93,12 +93,6 @@ struct ramlog_dev_s
* Private Function Prototypes
****************************************************************************/
-/* Syslog channel methods */
-
-#ifdef CONFIG_RAMLOG_SYSLOG
-static int ramlog_flush(void);
-#endif
-
/* Helper functions */
#ifndef CONFIG_RAMLOG_NONBLOCKING
@@ -117,19 +111,6 @@ static ssize_t ramlog_write(FAR struct file *filep, FAR const char *buffer,
static int ramlog_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-#ifdef CONFIG_RAMLOG_SYSLOG
-static const struct syslog_channel_s g_ramlog_syslog_channel =
-{
- ramlog_putc,
- ramlog_putc,
- ramlog_flush
-};
-#endif
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -180,17 +161,6 @@ static struct ramlog_dev_s g_sysdev =
* Private Functions
****************************************************************************/
-/****************************************************************************
- * Name: ramlog_flush
- ****************************************************************************/
-
-#ifdef CONFIG_RAMLOG_SYSLOG
-static int ramlog_flush(void)
-{
- return OK;
-}
-#endif
-
/****************************************************************************
* Name: ramlog_readnotify
****************************************************************************/
@@ -720,7 +690,7 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen)
}
/****************************************************************************
- * Name: ramlog_syslog_channel
+ * Name: ramlog_syslog_register
*
* Description:
* Use a pre-allocated RAM logging device and register it at the path
@@ -729,21 +699,11 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen)
****************************************************************************/
#ifdef CONFIG_RAMLOG_SYSLOG
-int ramlog_syslog_channel(void)
+void ramlog_syslog_register(void)
{
- int ret;
-
/* Register the syslog character driver */
- ret = register_driver(CONFIG_SYSLOG_DEVPATH, &g_ramlogfops, 0666, &g_sysdev);
- if (ret < 0)
- {
- return ret;
- }
-
- /* Use the RAMLOG as the SYSLOG channel */
-
- return syslog_channel(&g_ramlog_syslog_channel);
+ register_driver(CONFIG_SYSLOG_DEVPATH, &g_ramlogfops, 0666, &g_sysdev);
}
#endif
diff --git a/drivers/syslog/syslog_filechannel.c b/drivers/syslog/syslog_filechannel.c
index e7db19296b3..ce6fa1fc3cf 100644
--- a/drivers/syslog/syslog_filechannel.c
+++ b/drivers/syslog/syslog_filechannel.c
@@ -178,8 +178,7 @@ int syslog_file_channel(FAR const char *devpath)
{
/* We should still be able to back-up and re-initialized everything */
- syslog_initialize(SYSLOG_INIT_EARLY);
- syslog_initialize(SYSLOG_INIT_LATE);
+ syslog_channel(saved_channel);
goto errout_with_lock;
}
diff --git a/drivers/syslog/syslog_initialize.c b/drivers/syslog/syslog_initialize.c
index 87c575b2bb9..45baf8dac99 100644
--- a/drivers/syslog/syslog_initialize.c
+++ b/drivers/syslog/syslog_initialize.c
@@ -71,7 +71,7 @@
* as a minimum a call to syslog_channel() to use the device.
*
* Input Parameters:
- * phase - One of {SYSLOG_INIT_EARLY, SYSLOG_INIT_LATE}
+ * None
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
@@ -79,41 +79,26 @@
*
****************************************************************************/
-int syslog_initialize(enum syslog_init_e phase)
+int syslog_initialize(void)
{
int ret = OK;
#if defined(CONFIG_SYSLOG_CHAR)
- if (phase == SYSLOG_INIT_LATE)
- {
- /* Enable use of a character device as the SYSLOG device */
-
- ret = syslog_dev_channel();
- }
-
-#elif defined(CONFIG_RAMLOG_SYSLOG)
- if (phase == SYSLOG_INIT_EARLY)
- {
- /* Use the RAMLOG as the SYSLOG device */
-
- ret = ramlog_syslog_channel();
- }
+ /* Enable use of a character device as the SYSLOG device */
+ ret = syslog_dev_channel();
#elif defined(CONFIG_SYSLOG_CONSOLE)
- if (phase == SYSLOG_INIT_LATE)
- {
- /* Use the console device as the SYSLOG device */
+ /* Use the console device as the SYSLOG device */
- ret = syslog_console_channel();
- }
+ ret = syslog_console_channel();
+#endif
+#ifdef CONFIG_RAMLOG_SYSLOG
+ ramlog_syslog_register();
#endif
#ifdef CONFIG_SYSLOG_CHARDEV
- if (phase == SYSLOG_INIT_EARLY)
- {
- syslog_register();
- }
+ syslog_register();
#endif
return ret;
diff --git a/include/nuttx/syslog/ramlog.h b/include/nuttx/syslog/ramlog.h
index c25471ebf18..a764eaef57b 100644
--- a/include/nuttx/syslog/ramlog.h
+++ b/include/nuttx/syslog/ramlog.h
@@ -130,7 +130,7 @@ extern "C"
int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen);
/****************************************************************************
- * Name: ramlog_syslog_channel
+ * Name: ramlog_syslog_register
*
* Description:
* Create the RAM logging device and register it at the specified path.
@@ -139,7 +139,7 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen);
****************************************************************************/
#ifdef CONFIG_RAMLOG_SYSLOG
-int ramlog_syslog_channel(void);
+void ramlog_syslog_register(void);
#endif
/****************************************************************************
diff --git a/include/nuttx/syslog/syslog.h b/include/nuttx/syslog/syslog.h
index cd9a9823132..de57bdd99fd 100644
--- a/include/nuttx/syslog/syslog.h
+++ b/include/nuttx/syslog/syslog.h
@@ -97,15 +97,6 @@
* Public Types
****************************************************************************/
-/* Initialization phases */
-
-enum syslog_init_e
-{
- SYSLOG_INIT_RESET = 0, /* Power on SYSLOG initialization phase */
- SYSLOG_INIT_EARLY, /* Early initialization in up_initialize() */
- SYSLOG_INIT_LATE /* Late initialization in nx_start(). */
-};
-
/* This structure provides the interface to a SYSLOG device */
typedef CODE ssize_t (*syslog_write_t)(FAR const char *buf, size_t buflen);
@@ -181,7 +172,7 @@ int syslog_channel(FAR const struct syslog_channel_s *channel);
* as a minimum a call to syslog_channel() to use the device.
*
* Input Parameters:
- * phase - One of {SYSLOG_INIT_EARLY, SYSLOG_INIT_LATE}
+ * None
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
@@ -190,9 +181,9 @@ int syslog_channel(FAR const struct syslog_channel_s *channel);
****************************************************************************/
#ifndef CONFIG_ARCH_SYSLOG
-int syslog_initialize(enum syslog_init_e phase);
+int syslog_initialize(void);
#else
-# define syslog_initialize(phase)
+# define syslog_initialize()
#endif
/****************************************************************************
diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c
index 8992cd5d36c..c840cb9eafe 100644
--- a/sched/init/nx_start.c
+++ b/sched/init/nx_start.c
@@ -801,7 +801,7 @@ void nx_start(void)
* depend on having IDLE task file structures setup.
*/
- syslog_initialize(SYSLOG_INIT_LATE);
+ syslog_initialize();
#ifdef CONFIG_SMP
/* Start all CPUs *********************************************************/