riscv: Introduce is_compat_thread() into compat.h
[linux-2.6-microblaze.git] / arch / riscv / include / asm / compat.h
index 91517b5..da4b28c 100644 (file)
@@ -20,6 +20,14 @@ static inline int is_compat_task(void)
        return test_thread_flag(TIF_32BIT);
 }
 
+static inline int is_compat_thread(struct thread_info *thread)
+{
+       if (!IS_ENABLED(CONFIG_COMPAT))
+               return 0;
+
+       return test_ti_thread_flag(thread, TIF_32BIT);
+}
+
 struct compat_user_regs_struct {
        compat_ulong_t pc;
        compat_ulong_t ra;