]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/vga-isa.c
hw: include hw header files with full paths
[mirror_qemu.git] / hw / vga-isa.c
index cb6af91a7e901c8cbe88831e893ae1a7fe1a228c..ffad5226fd445db312c078ae8e2e6b7a9c195faa 100644 (file)
@@ -1,6 +1,8 @@
 /*
  * QEMU ISA VGA Emulator.
  *
+ * see docs/specs/standard-vga.txt for virtual hardware specs.
+ *
  * Copyright (c) 2003 Fabrice Bellard
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include "hw.h"
-#include "console.h"
-#include "pc.h"
-#include "vga_int.h"
-#include "pixel_ops.h"
-#include "qemu-timer.h"
-#include "loader.h"
+#include "hw/hw.h"
+#include "ui/console.h"
+#include "hw/pc.h"
+#include "hw/vga_int.h"
+#include "ui/pixel_ops.h"
+#include "qemu/timer.h"
+#include "hw/loader.h"
 
 typedef struct ISAVGAState {
     ISADevice dev;
@@ -49,7 +51,7 @@ static int vga_initfn(ISADevice *dev)
     MemoryRegion *vga_io_memory;
     const MemoryRegionPortio *vga_ports, *vbe_ports;
 
-    vga_common_init(s, VGA_RAM_SIZE);
+    vga_common_init(s);
     s->legacy_address_space = isa_address_space(dev);
     vga_io_memory = vga_init_io(s, &vga_ports, &vbe_ports);
     isa_register_portio_list(dev, 0x3b0, vga_ports, s, "vga");
@@ -69,22 +71,31 @@ static int vga_initfn(ISADevice *dev)
     return 0;
 }
 
+static Property vga_isa_properties[] = {
+    DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void vga_class_initfn(ObjectClass *klass, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(klass);
     ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
     ic->init = vga_initfn;
+    dc->reset = vga_reset_isa;
+    dc->vmsd = &vmstate_vga_common;
+    dc->props = vga_isa_properties;
 }
 
-static DeviceInfo vga_info = {
-    .name     = "isa-vga",
-    .size     = sizeof(ISAVGAState),
-    .vmsd     = &vmstate_vga_common,
-    .reset     = vga_reset_isa,
-    .class_init          = vga_class_initfn,
+static const TypeInfo vga_info = {
+    .name          = "isa-vga",
+    .parent        = TYPE_ISA_DEVICE,
+    .instance_size = sizeof(ISAVGAState),
+    .class_init    = vga_class_initfn,
 };
 
-static void vga_register(void)
+static void vga_register_types(void)
 {
-    isa_qdev_register(&vga_info);
+    type_register_static(&vga_info);
 }
-device_init(vga_register)
+
+type_init(vga_register_types)