summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-07-14 10:20:11 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-16 17:28:51 -0500
commitf114784f69ec3b9af342148025de14dbd1b429a5 (patch)
tree7dbf5414152e5d77ab7debae8f5770791f61a0d3 /monitor.c
parentef74679a810fe6858f625b9d52b68cc3fc61eb3d (diff)
downloadqemu-f114784f69ec3b9af342148025de14dbd1b429a5.tar.gz
monitor: Add port write command
Useful for testing hardware emulations or manipulating its state to stress guest drivers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index c3ef099bda..e38c86e1a3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1185,6 +1185,25 @@ static void do_ioport_read(Monitor *mon, int count, int format, int size,
suffix, addr, size * 2, val);
}
+static void do_ioport_write(Monitor *mon, int count, int format, int size,
+ int addr, int val)
+{
+ addr &= IOPORTS_MASK;
+
+ switch (size) {
+ default:
+ case 1:
+ cpu_outb(NULL, addr, val);
+ break;
+ case 2:
+ cpu_outw(NULL, addr, val);
+ break;
+ case 4:
+ cpu_outl(NULL, addr, val);
+ break;
+ }
+}
+
static void do_boot_set(Monitor *mon, const char *bootdevice)
{
int res;