forked from nuttx/nuttx-update
arch/arm64: syscall SYS_switch_context and SYS_restore_context use 0 para
reason: simplify context switch sys_call0(SYS_switch_context) sys_call0(SYS_restore_context) Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
f4d212fd6d
commit
fccd908114
4 changed files with 6 additions and 12 deletions
|
@ -447,8 +447,9 @@ static inline void up_irq_restore(irqstate_t flags)
|
|||
{ \
|
||||
if (!up_interrupt_context()) \
|
||||
{ \
|
||||
sys_call2(SYS_switch_context, (uintptr_t)rtcb, (uintptr_t)tcb); \
|
||||
sys_call0(SYS_switch_context); \
|
||||
} \
|
||||
UNUSED(rtcb); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
|
|
@ -57,24 +57,17 @@
|
|||
|
||||
void up_exit(int status)
|
||||
{
|
||||
struct tcb_s *tcb = this_task();
|
||||
UNUSED(status);
|
||||
|
||||
/* Destroy the task at the head of the ready to run list. */
|
||||
|
||||
nxtask_exit();
|
||||
|
||||
/* Now, perform the context switch to the new ready-to-run task at the
|
||||
* head of the list.
|
||||
*/
|
||||
|
||||
tcb = this_task();
|
||||
|
||||
/* Scheduler parameters will update inside syscall */
|
||||
|
||||
g_running_tasks[this_cpu()] = NULL;
|
||||
|
||||
/* Then switch contexts */
|
||||
|
||||
arm64_fullcontextrestore(tcb);
|
||||
arm64_fullcontextrestore();
|
||||
}
|
||||
|
|
|
@ -112,10 +112,10 @@
|
|||
|
||||
/* Context switching */
|
||||
|
||||
#define arm64_fullcontextrestore(next) \
|
||||
#define arm64_fullcontextrestore() \
|
||||
do \
|
||||
{ \
|
||||
sys_call1(SYS_restore_context, (uintptr_t)next); \
|
||||
sys_call0(SYS_restore_context); \
|
||||
} \
|
||||
while (1)
|
||||
|
||||
|
|
|
@ -162,5 +162,5 @@ retry:
|
|||
#endif
|
||||
|
||||
g_running_tasks[this_cpu()] = NULL;
|
||||
arm64_fullcontextrestore(rtcb);
|
||||
arm64_fullcontextrestore();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue