arch: x86: Set the idle task stack to prevent get/set errno on idle task resulting NULL reference

This commit is contained in:
Yang Chung-Fan 2020-05-26 01:01:21 +09:00 committed by patacongo
parent e1dbb6b2a9
commit 9345cb5553

View File

@ -43,6 +43,7 @@
#include <arch/board/board.h> #include <arch/board/board.h>
#include "sched/sched.h"
#include "up_arch.h" #include "up_arch.h"
#include "up_internal.h" #include "up_internal.h"
@ -100,6 +101,12 @@ static void up_calibratedelay(void)
void up_initialize(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 */ /* Initialize global variables */
g_current_regs = NULL; g_current_regs = NULL;
@ -119,8 +126,8 @@ void up_initialize(void)
#endif #endif
#ifdef CONFIG_ARCH_DMA #ifdef CONFIG_ARCH_DMA
/* Initialize the DMA subsystem if the weak function up_dma_initialize has been /* Initialize the DMA subsystem if the weak function up_dma_initialize
* brought into the build * has been brought into the build
*/ */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS #ifdef CONFIG_HAVE_WEAKFUNCTIONS