1
0
Fork 0
forked from nuttx/nuttx-update

arch: Initialize the idle thread stack info directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-10-23 11:46:53 +08:00 committed by Masayuki Ishikawa
parent 29c6f11239
commit efee1c6ded
24 changed files with 104 additions and 55 deletions

View file

@ -75,8 +75,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -77,8 +77,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -75,8 +75,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -63,8 +63,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -75,8 +75,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -63,8 +63,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -75,8 +75,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure. Zeroing

View file

@ -73,8 +73,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure. Zeroing

View file

@ -72,8 +72,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */
@ -98,14 +100,14 @@ void up_initial_state(struct tcb_s *tcb)
/* Condition code register:
*
* Bit 0: C Carry/Borrow status bit
* Bit 1: V Twos complement overflow status bit
* Bit 2: Z Zero status bit
* Bit 3: N Negative status bit
* Bit 4: I Maskable interrupt control bit
* Bit 5: H Half-carry status bit
* Bit 6: X Non-maskable interrupt control bit
* Bit 7: S STOP instruction control bit
* Bit 0: C Carry/Borrow status bit
* Bit 1: V Two's complement overflow status bit
* Bit 2: Z Zero status bit
* Bit 3: N Negative status bit
* Bit 4: I Maskable interrupt control bit
* Bit 5: H Half-carry status bit
* Bit 6: X Non-maskable interrupt control bit
* Bit 7: S STOP instruction control bit
*/
# ifdef CONFIG_SUPPRESS_INTERRUPTS

View file

@ -77,8 +77,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -75,8 +75,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -79,8 +79,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -77,8 +77,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -74,8 +74,10 @@ void up_initial_state(FAR struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (FAR void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -65,8 +65,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -92,8 +92,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -76,8 +76,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -76,8 +76,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -68,8 +68,10 @@ void up_initial_state(struct tcb_s *tcb)
{
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(sim_getsp() -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(sim_getsp() -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)sim_getsp();
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
memset(&tcb->xcp, 0, sizeof(struct xcptcontext));

View file

@ -73,8 +73,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -62,8 +62,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_ptr = (void *)g_idle_topstack;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -77,7 +77,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb, g_idlestack, IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = g_idlestack;
tcb->adj_stack_ptr = (char *)g_idlestack +
CONFIG_IDLETHREAD_STACKSIZE;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -57,8 +57,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb,
(void *)CONFIG_STACK_BASE, CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)CONFIG_STACK_BASE;
tcb->adj_stack_ptr = (void *)(CONFIG_STACK_BASE +
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */

View file

@ -57,8 +57,10 @@ void up_initial_state(struct tcb_s *tcb)
if (tcb->pid == 0)
{
up_use_stack(tcb,
(void *)CONFIG_STACK_BASE, CONFIG_IDLETHREAD_STACKSIZE);
tcb->stack_alloc_ptr = (void *)CONFIG_STACK_BASE;
tcb->adj_stack_ptr = (void *)(CONFIG_STACK_BASE +
CONFIG_IDLETHREAD_STACKSIZE);
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
/* Initialize the initial exception register context structure */