mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
ef74679a81
commit
f114784f69
2 changed files with 24 additions and 0 deletions
19
monitor.c
19
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue