mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
Add initialization for idle task.
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -105,6 +106,8 @@ static inline void up_color_intstack(void)
|
||||
|
||||
void up_initialize(void)
|
||||
{
|
||||
FAR struct tcb_s *idle;
|
||||
|
||||
/* Colorize the interrupt stack */
|
||||
|
||||
up_color_intstack();
|
||||
@@ -113,6 +116,13 @@ void up_initialize(void)
|
||||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the idle task stack info */
|
||||
|
||||
idle = this_task(); /* It should be idle task */
|
||||
idle->stack_alloc_ptr = _END_BSS;
|
||||
idle->adj_stack_ptr = (FAR void *)g_idle_topstack;
|
||||
idle->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
|
||||
|
||||
/* Register devices */
|
||||
|
||||
#if defined(CONFIG_DEV_NULL)
|
||||
|
||||
@@ -77,6 +77,14 @@
|
||||
#define up_restorestate(regs) (g_current_regs = regs)
|
||||
#endif
|
||||
|
||||
#define _START_TEXT &_stext
|
||||
#define _END_TEXT &_etext
|
||||
#define _START_BSS &_sbss
|
||||
#define _END_BSS &_ebss
|
||||
#define _DATA_INIT &_eronly
|
||||
#define _START_DATA &_sdata
|
||||
#define _END_DATA &_edata
|
||||
|
||||
/* Determine which (if any) console driver to use. If a console is enabled
|
||||
* and no other console device is specified, then a serial console is
|
||||
* assumed.
|
||||
@@ -112,6 +120,7 @@ extern "C"
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef CONFIG_ARCH_RV64GC
|
||||
#ifdef CONFIG_SMP
|
||||
EXTERN volatile uint64_t *g_current_regs[CONFIG_SMP_NCPUS];
|
||||
@@ -153,6 +162,8 @@ EXTERN uint32_t _edata; /* End+1 of .data */
|
||||
EXTERN uint32_t _sbss; /* Start of .bss */
|
||||
EXTERN uint32_t _ebss; /* End+1 of .bss */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user