@@ -12,11 +12,18 @@
#include <linux/sched/task_stack.h>
#include <asm-generic/compat.h>
+#ifdef CONFIG_COMPAT
+
static inline int is_compat_task(void)
{
return test_thread_flag(TIF_32BIT);
}
+static inline int is_compat_thread(struct thread_info *thread)
+{
+ return test_ti_thread_flag(thread, TIF_32BIT);
+}
+
struct compat_user_regs_struct {
compat_ulong_t pc;
compat_ulong_t ra;
@@ -126,4 +133,13 @@ static inline void cregs_to_regs(struct compat_user_regs_struct *cregs,
regs->t6 = (unsigned long) cregs->t6;
};
+#else
+
+static inline int is_compat_thread(struct thread_info *thread)
+{
+ return 0;
+}
+
+#endif
+
#endif /* __ASM_COMPAT_H */
This allows checking if some thread other than current is 32-bit. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> --- arch/riscv/include/asm/compat.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)