aboutsummaryrefslogtreecommitdiff
path: root/tests/m48t59-test.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-02-16 22:44:03 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-18 08:39:10 -0600
commit872536bf5dfdf207d275cd627caec2aefb68aab9 (patch)
treedc65a96f89f6f0fa41c3f1298f8ad1e1748de961 /tests/m48t59-test.c
parentb73cf9e93f1c7fd6e949f71172c49848b4d70aa9 (diff)
downloadqemu-872536bf5dfdf207d275cd627caec2aefb68aab9.zip
qemu-872536bf5dfdf207d275cd627caec2aefb68aab9.tar.gz
qemu-872536bf5dfdf207d275cd627caec2aefb68aab9.tar.bz2
qtest: Add MMIO support
Introduce [qtest_]{read,write}[bwlq]() libqtest functions and corresponding QTest protocol commands to replace local versions in libi2c-omap.c. Also convert m48t59-test's cmos_{read,write}_mmio() to {read,write}b(). Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1361051043-27944-4-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'tests/m48t59-test.c')
-rw-r--r--tests/m48t59-test.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c
index 77d69b3..4081a5f 100644
--- a/tests/m48t59-test.c
+++ b/tests/m48t59-test.c
@@ -35,17 +35,14 @@ static bool use_mmio;
static uint8_t cmos_read_mmio(uint8_t reg)
{
- uint8_t data;
-
- memread(base + (uint32_t)reg_base + (uint32_t)reg, &data, 1);
- return data;
+ return readb(base + (uint32_t)reg_base + (uint32_t)reg);
}
static void cmos_write_mmio(uint8_t reg, uint8_t val)
{
uint8_t data = val;
- memwrite(base + (uint32_t)reg_base + (uint32_t)reg, &data, 1);
+ writeb(base + (uint32_t)reg_base + (uint32_t)reg, data);
}
static uint8_t cmos_read_ioio(uint8_t reg)