Restrict CPU I/O instructions to architectures providing
I/O bus.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
softmmu/qtest.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index ff253068657..51fe256297a 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -31,7 +31,9 @@
#ifdef CONFIG_PSERIES
#include "hw/ppc/spapr_rtas.h"
#endif
+#ifdef TARGET_HAS_IOPORT
#include "exec/cpu-io.h"
+#endif
#define MAX_IRQ 256
@@ -462,7 +464,9 @@ static void qtest_process_command(CharBackend *chr, gchar
**words)
qemu_set_irq(irq, level);
qtest_send_prefix(chr);
qtest_send(chr, "OK\n");
- } else if (strcmp(words[0], "outb") == 0 ||
+ }
+#ifdef TARGET_HAS_IOPORT
+ else if (strcmp(words[0], "outb") == 0 ||
strcmp(words[0], "outw") == 0 ||
strcmp(words[0], "outl") == 0) {
unsigned long addr;
@@ -506,7 +510,9 @@ static void qtest_process_command(CharBackend *chr, gchar
**words)
}
qtest_send_prefix(chr);
qtest_sendf(chr, "OK 0x%04x\n", value);
- } else if (strcmp(words[0], "writeb") == 0 ||
+ }
+#endif /* TARGET_HAS_IOPORT */
+ else if (strcmp(words[0], "writeb") == 0 ||
strcmp(words[0], "writew") == 0 ||
strcmp(words[0], "writel") == 0 ||
strcmp(words[0], "writeq") == 0) {
--
2.26.2