From 54ce6f22e86977b6e94692d90e13fce6fc9aa641 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Fri, 7 Oct 2016 12:14:27 +0200 Subject: qtest: ask endianness of the target in qtest_init() The target endianness is not deduced anymore from the architecture name but asked directly to the guest, using a new qtest command: "endianness". As it can't change (this is the value of TARGET_WORDS_BIGENDIAN), we store it to not have to ask every time we want to know if we have to byte-swap a value. Signed-off-by: Laurent Vivier CC: Greg Kurz CC: David Gibson CC: Peter Maydell Signed-off-by: David Gibson --- qtest.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qtest.c') diff --git a/qtest.c b/qtest.c index 22482cc..b53b39c 100644 --- a/qtest.c +++ b/qtest.c @@ -537,6 +537,13 @@ static void qtest_process_command(CharDriverState *chr, gchar **words) qtest_send_prefix(chr); qtest_send(chr, "OK\n"); + } else if (strcmp(words[0], "endianness") == 0) { + qtest_send_prefix(chr); +#if defined(TARGET_WORDS_BIGENDIAN) + qtest_sendf(chr, "OK big\n"); +#else + qtest_sendf(chr, "OK little\n"); +#endif #ifdef TARGET_PPC64 } else if (strcmp(words[0], "rtas") == 0) { uint64_t res, args, ret; -- cgit v1.1