Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64: syscall SYS_switch_context and SYS_restore_context use 0 para #14911

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arch/arm64/include/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 1 addition & 8 deletions arch/arm64/src/common/arm64_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
4 changes: 2 additions & 2 deletions arch/arm64/src/common/arm64_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/src/common/arm64_sigdeliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ void arm64_sigdeliver(void)
#endif

g_running_tasks[this_cpu()] = NULL;
arm64_fullcontextrestore(rtcb);
arm64_fullcontextrestore();
}