linux-user: Add support for big-endian aarch64

Enable big-endian mode for data accesses on aarch64 for big-endian linux
user mode. Activate it for all exception levels as documented by ARM:
Set the SCTLR EE bit for ELs 1 through 3. Additionally set bit E0E in
EL1 to enable it in EL0 as well.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20171220212308.12614-2-michael.weiser@gmx.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Michael Weiser 2018-01-11 13:25:31 +00:00 committed by Peter Maydell
parent 612061b277
commit dfdcf34031
1 changed files with 6 additions and 0 deletions

View File

@ -4629,6 +4629,12 @@ int main(int argc, char **argv, char **envp)
}
env->pc = regs->pc;
env->xregs[31] = regs->sp;
#ifdef TARGET_WORDS_BIGENDIAN
env->cp15.sctlr_el[1] |= SCTLR_E0E;
for (i = 1; i < 4; ++i) {
env->cp15.sctlr_el[i] |= SCTLR_EE;
}
#endif
}
#elif defined(TARGET_ARM)
{