This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 9345cb5 arch: x86: Set the idle task stack to prevent get/set errno
on idle task resulting NULL reference
9345cb5 is described below
commit 9345cb55534086a179221c38c7dfd143950a828c
Author: Yang Chung-Fan <[email protected]>
AuthorDate: Tue May 26 01:01:21 2020 +0900
arch: x86: Set the idle task stack to prevent get/set errno on idle task
resulting NULL reference
---
arch/x86_64/src/common/up_initialize.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/x86_64/src/common/up_initialize.c
b/arch/x86_64/src/common/up_initialize.c
index 61e2c3d..3e9dc67 100644
--- a/arch/x86_64/src/common/up_initialize.c
+++ b/arch/x86_64/src/common/up_initialize.c
@@ -43,6 +43,7 @@
#include <arch/board/board.h>
+#include "sched/sched.h"
#include "up_arch.h"
#include "up_internal.h"
@@ -100,6 +101,12 @@ static void up_calibratedelay(void)
void up_initialize(void)
{
+ struct tcb_s *rtcb = this_task();
+
+ rtcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
+ rtcb->stack_alloc_ptr =
+ (void *)(g_idle_topstack - CONFIG_IDLETHREAD_STACKSIZE);
+
/* Initialize global variables */
g_current_regs = NULL;
@@ -119,8 +126,8 @@ void up_initialize(void)
#endif
#ifdef CONFIG_ARCH_DMA
- /* Initialize the DMA subsystem if the weak function up_dma_initialize has
been
- * brought into the build
+ /* Initialize the DMA subsystem if the weak function up_dma_initialize
+ * has been brought into the build
*/
#ifdef CONFIG_HAVE_WEAKFUNCTIONS