18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef ARCH_LOONGARCH_ENTRY_COMMON_H 38c2ecf20Sopenharmony_ci#define ARCH_LOONGARCH_ENTRY_COMMON_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <linux/sched.h> 68c2ecf20Sopenharmony_ci#include <linux/processor.h> 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_cistatic inline bool on_thread_stack(void) 98c2ecf20Sopenharmony_ci{ 108c2ecf20Sopenharmony_ci return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1)); 118c2ecf20Sopenharmony_ci} 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#endif 14