Hi, Brennan,

Did you check up_get_newintctx() ?

The function is called from up_initial_state() to create a new task
and needs to return (MSTATUS_MPPM | MSTATUS_MPIE).

Masayuki

________________________________
From: Brennan Ashton <bash...@brennanashton.com>
Sent: Monday, June 22, 2020 3:38
To: dev@nuttx.apache.org <dev@nuttx.apache.org>
Subject: Interrupt restore behavior on task activate

I'm bringing up support for a new RISC-V core but I'm running into some
issues around the sys tick.

My tick timer interrupt is disabled at activating a task, clearly this is
not correct.  This is code used across all architectures so I'm sure I just
do not understand something

void nxtask_activate(FAR struct tcb_s *tcb)
{
  irqstate_t flags = enter_critical_section();
  up_unblock_task(tcb);
  leave_critical_section(flags);
}


Won't we perform a context switch here and not leave the critical section?

--Brennan

Reply via email to