summary refs log tree commit diff stats
path: root/hw/isa-bus.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-09-08 16:58:57 +0200
committerAurelien Jarno <aurelien@aurel32.net>2012-10-06 18:48:38 +0200
commit14e7a6456e1dba2c6499b3b05637fee9f553e6ce (patch)
tree65a82f8b9fb636a41865cefcdc0f46cdba20d521 /hw/isa-bus.c
parent129d42fb8496de5c1896160fddab949784d4dea4 (diff)
downloadfocaccia-qemu-14e7a6456e1dba2c6499b3b05637fee9f553e6ce.tar.gz
focaccia-qemu-14e7a6456e1dba2c6499b3b05637fee9f553e6ce.zip
isa: add a isa_vga_init() function
This function create a ISA VGA device according to the value of
vga_interface_type. It returns a ISADevice (and not a DeviceState).

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/isa-bus.c')
-rw-r--r--hw/isa-bus.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 47c93d37b6..214f19457d 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -19,6 +19,7 @@
 #include "hw.h"
 #include "monitor.h"
 #include "sysbus.h"
+#include "sysemu.h"
 #include "isa.h"
 #include "exec-memory.h"
 
@@ -166,6 +167,25 @@ ISADevice *isa_create_simple(ISABus *bus, const char *name)
     return dev;
 }
 
+ISADevice *isa_vga_init(ISABus *bus)
+{
+    switch (vga_interface_type) {
+    case VGA_CIRRUS:
+        return isa_create_simple(bus, "isa-cirrus-vga");
+    case VGA_QXL:
+        fprintf(stderr, "%s: qxl: no PCI bus\n", __func__);
+        return NULL;
+    case VGA_STD:
+        return isa_create_simple(bus, "isa-vga");
+    case VGA_VMWARE:
+        fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __func__);
+        return NULL;
+    case VGA_NONE:
+    default:
+        return NULL;
+    }
+}
+
 static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent)
 {
     ISADevice *d = ISA_DEVICE(dev);