@@ -107,6 +107,9 @@ static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
regs->pstate = COMPAT_PSR_MODE_USR;
if (pc & 1)
regs->pstate |= COMPAT_PSR_T_BIT;
+#ifdef CONFIG_CPU_BIG_ENDIAN
+ regs->pstate |= COMPAT_PSR_E_BIT;
+#endif
regs->compat_sp = sp;
}
#endif
@@ -481,6 +481,10 @@ static void compat_setup_return(struct pt_regs *regs, struct k_sigaction *ka,
spsr &= ~COMPAT_PSR_T_BIT;
}
+#ifdef CONFIG_CPU_BIG_ENDIAN
+ spsr |= COMPAT_PSR_E_BIT;
+#endif
+
if (ka->sa.sa_flags & SA_RESTORER) {
retcode = ptr_to_compat(ka->sa.sa_restorer);
} else {