From 0b01a999bec958b6d44f7664dbe16f98b20c1740 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Mon, 18 Jan 2021 17:09:36 +0100 Subject: [PATCH] cpu/mips32r2_common: Inline thread_yield_higher function --- cpu/mips32r2_common/include/thread_arch.h | 51 +++++++++++++++++++++++ cpu/mips32r2_common/thread_arch.c | 12 ------ 2 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 cpu/mips32r2_common/include/thread_arch.h diff --git a/cpu/mips32r2_common/include/thread_arch.h b/cpu/mips32r2_common/include/thread_arch.h new file mode 100644 index 0000000000..00799085ca --- /dev/null +++ b/cpu/mips32r2_common/include/thread_arch.h @@ -0,0 +1,51 @@ +/* + * Copyright(C) 2017, 2016, Imagination Technologies Limited and/or its + * affiliated group companies. + * + * This file is subject to the terms and conditions of the GNU Lesser General + * Public License v2.1. See the file LICENSE in the top level directory for more + * details. + */ + +/** + * @ingroup cpu_mips32r2_common + * @{ + * + * @file + * @brief Implementation of the kernels thread interface + * + * @author Neil Jones + * + * @} + */ +#ifndef THREAD_ARCH_H +#define THREAD_ARCH_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define THREAD_API_INLINED + +#ifndef DOXYGEN /* Doxygen is in core/include/thread.h */ + +static inline __attribute__((always_inline)) void thread_yield_higher(void) +{ + /* + * throw a syscall exception to get into exception level + * we context switch at exception level. + * + * Note syscall 1 is reserved for UHI see: + * http://wiki.prplfoundation.org/w/images/4/42/UHI_Reference_Manual.pdf + */ + __asm volatile ("syscall 2"); +} + +#endif /* DOXYGEN */ + +#ifdef __cplusplus +} +#endif + +#endif /* THREAD_ARCH_H */ +/** @} */ diff --git a/cpu/mips32r2_common/thread_arch.c b/cpu/mips32r2_common/thread_arch.c index 449ce1e203..b574462fc1 100644 --- a/cpu/mips32r2_common/thread_arch.c +++ b/cpu/mips32r2_common/thread_arch.c @@ -141,18 +141,6 @@ void cpu_switch_context_exit(void) UNREACHABLE(); } -void thread_yield_higher(void) -{ - /* - * throw a syscall exception to get into exception level - * we context switch at exception level. - * - * Note syscall 1 is reserved for UHI see: - * http://wiki.prplfoundation.org/w/images/4/42/UHI_Reference_Manual.pdf - */ - __asm volatile ("syscall 2"); -} - struct linkctx* exctx_find(reg_t id, struct gpctx *gp) { struct linkctx **ctx = (struct linkctx **)&gp->link;