mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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 <lvivier@redhat.com> CC: Greg Kurz <groug@kaod.org> CC: David Gibson <david@gibson.dropbear.id.au> CC: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
44a3dd9b87
commit
54ce6f22e8
5 changed files with 45 additions and 50 deletions
|
@ -409,6 +409,14 @@ int64_t qtest_clock_step(QTestState *s, int64_t step);
|
|||
*/
|
||||
int64_t qtest_clock_set(QTestState *s, int64_t val);
|
||||
|
||||
/**
|
||||
* qtest_big_endian:
|
||||
* @s: QTestState instance to operate on.
|
||||
*
|
||||
* Returns: True if the architecture under test has a big endian configuration.
|
||||
*/
|
||||
bool qtest_big_endian(QTestState *s);
|
||||
|
||||
/**
|
||||
* qtest_get_arch:
|
||||
*
|
||||
|
@ -874,12 +882,14 @@ static inline int64_t clock_set(int64_t val)
|
|||
}
|
||||
|
||||
/**
|
||||
* qtest_big_endian:
|
||||
* target_big_endian:
|
||||
*
|
||||
* Returns: True if the architecture under test has a big endian configuration.
|
||||
*/
|
||||
bool qtest_big_endian(void);
|
||||
|
||||
static inline bool target_big_endian(void)
|
||||
{
|
||||
return qtest_big_endian(global_qtest);
|
||||
}
|
||||
|
||||
QDict *qmp_fd_receive(int fd);
|
||||
void qmp_fd_sendv(int fd, const char *fmt, va_list ap);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue