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

xtensa: inline up_switch_context #58

Merged
merged 1 commit into from
Dec 25, 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
10 changes: 10 additions & 0 deletions arch/xtensa/include/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <sys/types.h>
#ifndef __ASSEMBLY__
# include <stdbool.h>
# include <arch/syscall.h>
#endif

#include <arch/types.h>
Expand Down Expand Up @@ -458,6 +459,15 @@ noinstrument_function static inline_function bool up_interrupt_context(void)
}
#endif

#define up_switch_context(tcb, rtcb) \
do { \
if (!up_interrupt_context()) \
{ \
sys_call2(SYS_switch_context, (uintptr_t)&rtcb->xcp.regs, \
(uintptr_t)tcb->xcp.regs); \
} \
} while (0)

/****************************************************************************
* Name: up_getusrpc
****************************************************************************/
Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ list(
xtensa_releasestack.c
xtensa_registerdump.c
xtensa_sigdeliver.c
xtensa_switchcontext.c
xtensa_swint.c
xtensa_stackframe.c
xtensa_saveusercontext.c
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/common/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CMN_CSRCS += xtensa_irqdispatch.c xtensa_lowputs.c xtensa_mdelay.c
CMN_CSRCS += xtensa_modifyreg8.c xtensa_modifyreg16.c xtensa_modifyreg32.c
CMN_CSRCS += xtensa_mpu.c xtensa_nputs.c xtensa_oneshot.c xtensa_perf.c
CMN_CSRCS += xtensa_releasestack.c xtensa_registerdump.c xtensa_sigdeliver.c
CMN_CSRCS += xtensa_switchcontext.c xtensa_swint.c xtensa_stackframe.c
CMN_CSRCS += xtensa_swint.c xtensa_stackframe.c
CMN_CSRCS += xtensa_saveusercontext.c xtensa_schedsigaction.c xtensa_udelay.c
CMN_CSRCS += xtensa_usestack.c xtensa_tcbinfo.c

Expand Down
3 changes: 0 additions & 3 deletions arch/xtensa/src/common/xtensa.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@
#define xtensa_context_restore(regs)\
sys_call1(SYS_restore_context, (uintptr_t)regs)

#define xtensa_switchcontext(saveregs, restoreregs)\
sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs)

/* Interrupt codes from other CPUs: */

#define CPU_INTCODE_NONE 0
Expand Down
76 changes: 0 additions & 76 deletions arch/xtensa/src/common/xtensa_switchcontext.c

This file was deleted.

Loading