diff --git a/arch/arm/src/common/up_initialize.c b/arch/arm/src/common/up_initialize.c index 6b5117adf1b..6f0dc0bce78 100644 --- a/arch/arm/src/common/up_initialize.c +++ b/arch/arm/src/common/up_initialize.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -228,22 +229,10 @@ void up_initialize(void) ramlog_consoleinit(); #endif - /* Initialize the HW crypto and /dev/crypto */ +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ -#if defined(CONFIG_CRYPTO) - up_cryptoinitialize(); -#endif - -#if CONFIG_NFILE_DESCRIPTORS > 0 -#if defined(CONFIG_CRYPTO_CRYPTODEV) - devcrypto_register(); -#endif -#endif - - /* Initialize the Random Number Generator (RNG) */ - -#ifdef CONFIG_DEV_RANDOM - up_rnginitialize(); + (void)ptmx_register(); #endif /* Early initialization of the system logging device. Some SYSLOG channel @@ -253,6 +242,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c index 669821631c0..425b070d3c3 100644 --- a/arch/avr/src/common/up_initialize.c +++ b/arch/avr/src/common/up_initialize.c @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include @@ -258,6 +260,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -265,6 +273,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c index c5b1149d04a..51624646385 100644 --- a/arch/hc/src/common/up_initialize.c +++ b/arch/hc/src/common/up_initialize.c @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include "up_arch.h" #include "up_internal.h" @@ -184,6 +186,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -191,6 +199,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ diff --git a/arch/mips/src/common/up_initialize.c b/arch/mips/src/common/up_initialize.c index d6d634c9bc7..faa8edab970 100644 --- a/arch/mips/src/common/up_initialize.c +++ b/arch/mips/src/common/up_initialize.c @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include @@ -186,6 +188,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -193,6 +201,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ diff --git a/arch/rgmp/src/nuttx.c b/arch/rgmp/src/nuttx.c index 4a274264d7f..30824ccff02 100644 --- a/arch/rgmp/src/nuttx.c +++ b/arch/rgmp/src/nuttx.c @@ -45,14 +45,18 @@ #include #include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include +#include +#include + #include "task/task.h" #include "sched/sched.h" #include "group/group.h" @@ -85,23 +89,56 @@ static inline void up_switchcontext(struct tcb_s *ctcb, struct tcb_s *ntcb) void up_initialize(void) { - extern pidhash_t g_pidhash[]; - extern void vdev_init(void); - extern void nuttx_arch_init(void); + extern pidhash_t g_pidhash[]; + extern void vdev_init(void); + extern void nuttx_arch_init(void); - // initialize the current_task to g_idletcb - current_task = g_pidhash[PIDHASH(0)].tcb; + /* Initialize the current_task to g_idletcb */ - // OS memory alloc system is ready - use_os_kmalloc = 1; + current_task = g_pidhash[PIDHASH(0)].tcb; - // rgmp vdev init - vdev_init(); + /* OS memory alloc system is ready */ - nuttx_arch_init(); + use_os_kmalloc = 1; - // enable interrupt - local_irq_enable(); + /* rgmp vdev init */ + + vdev_init(); + + nuttx_arch_init(); + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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 */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + + /* Enable interrupt */ + + local_irq_enable(); } void up_idle(void) @@ -251,6 +288,7 @@ void up_release_stack(struct tcb_s *dtcb, uint8_t ttype) * hold the blocked task TCB. * ****************************************************************************/ + void up_block_task(struct tcb_s *tcb, tstate_t task_state) { /* Verify that the context switch can be performed */ diff --git a/arch/rgmp/src/x86/arch_nuttx.c b/arch/rgmp/src/x86/arch_nuttx.c index d5ae6916862..32f919cd784 100644 --- a/arch/rgmp/src/x86/arch_nuttx.c +++ b/arch/rgmp/src/x86/arch_nuttx.c @@ -44,7 +44,6 @@ #include #include - void nuttx_arch_init(void) { extern void e1000_mod_init(void); @@ -57,7 +56,6 @@ void nuttx_arch_init(void) // setup e1000 e1000_mod_init(); #endif - } void nuttx_arch_exit(void) diff --git a/arch/sh/src/common/up_initialize.c b/arch/sh/src/common/up_initialize.c index c333f4b9939..6b62007d0bf 100644 --- a/arch/sh/src/common/up_initialize.c +++ b/arch/sh/src/common/up_initialize.c @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include "up_arch.h" #include "up_internal.h" @@ -178,6 +180,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -185,6 +193,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ diff --git a/arch/sim/src/up_initialize.c b/arch/sim/src/up_initialize.c index cb07619eabd..56f8f435aa7 100644 --- a/arch/sim/src/up_initialize.c +++ b/arch/sim/src/up_initialize.c @@ -52,6 +52,8 @@ #include #include #include +#include +#include #include "up_internal.h" @@ -168,6 +170,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -175,6 +183,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #if defined(CONFIG_FS_FAT) && !defined(CONFIG_DISABLE_MOUNTPOINT) up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */ #endif diff --git a/arch/x86/src/common/up_initialize.c b/arch/x86/src/common/up_initialize.c index 853304038bd..1d3270e3a3f 100644 --- a/arch/x86/src/common/up_initialize.c +++ b/arch/x86/src/common/up_initialize.c @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include @@ -186,6 +188,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -193,6 +201,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ diff --git a/arch/z16/src/common/up_initialize.c b/arch/z16/src/common/up_initialize.c index f6a020203aa..2bb5d7316eb 100644 --- a/arch/z16/src/common/up_initialize.c +++ b/arch/z16/src/common/up_initialize.c @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include @@ -186,6 +188,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -193,6 +201,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */ diff --git a/arch/z80/src/common/up_initialize.c b/arch/z80/src/common/up_initialize.c index 9684998ff36..3bd7c6e9abd 100644 --- a/arch/z80/src/common/up_initialize.c +++ b/arch/z80/src/common/up_initialize.c @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include @@ -183,6 +185,12 @@ void up_initialize(void) ramlog_consoleinit(); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) + /* Register the master pseudo-terminal multiplexor device */ + + (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. @@ -190,6 +198,22 @@ void up_initialize(void) syslog_initialize(SYSLOG_INIT_EARLY); +#if defined(CONFIG_CRYPTO) + /* Initialize the HW crypto and /dev/crypto */ + + up_cryptoinitialize(); +#endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) + devcrypto_register(); +#endif + +#ifdef CONFIG_DEV_RANDOM + /* Initialize the Random Number Generator (RNG) */ + + up_rnginitialize(); +#endif + #ifndef CONFIG_NETDEV_LATEINIT /* Initialize the network */