aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-04-28 18:45:47 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-29 08:28:15 -0500
commit1a63e059de2f2936d2066532b9f8ca22675cf11c (patch)
tree0f2a9e9c3db043dea9cc28351a34cce7612f1786 /tests/libqos
parent61e477f4c731c4ff3f1a44dbfc55c8a5903c8d52 (diff)
libqos: Convert fw_cfg values to host endianness
The fw_cfg ABI is Little Endian, so byte-swap the generically read byte array to host endianness. This unbreaks the fw_cfg tests on ppc. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1367167547-19931-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'tests/libqos')
-rw-r--r--tests/libqos/fw_cfg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c
index 799139edee..e386ff7ba7 100644
--- a/tests/libqos/fw_cfg.c
+++ b/tests/libqos/fw_cfg.c
@@ -11,6 +11,7 @@
*/
#include "libqos/fw_cfg.h"
+#include "qemu/bswap.h"
void qfw_cfg_select(QFWCFG *fw_cfg, uint16_t key)
{
@@ -32,20 +33,20 @@ uint16_t qfw_cfg_get_u16(QFWCFG *fw_cfg, uint16_t key)
{
uint16_t value;
qfw_cfg_get(fw_cfg, key, &value, sizeof(value));
- return value;
+ return le16_to_cpu(value);
}
uint32_t qfw_cfg_get_u32(QFWCFG *fw_cfg, uint16_t key)
{
uint32_t value;
qfw_cfg_get(fw_cfg, key, &value, sizeof(value));
- return value;
+ return le32_to_cpu(value);
}
uint64_t qfw_cfg_get_u64(QFWCFG *fw_cfg, uint16_t key)
{
uint64_t value;
qfw_cfg_get(fw_cfg, key, &value, sizeof(value));
- return value;
+ return le64_to_cpu(value);
}