[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 35/69] hw/isa/pc87312: Inherit from the abstract TYPE
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 35/69] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO |
Date: |
Tue, 13 Mar 2018 23:46:45 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/isa/pc87312.c | 11 ++++++++++-
include/hw/isa/pc87312.h | 6 ++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index fda91fed21..6b8100ff56 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -270,6 +270,7 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
ISABus *bus;
Chardev *chr;
DriveInfo *drive;
+ Error *local_err = NULL;
char name[5];
int i;
@@ -279,6 +280,12 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
isa_register_ioport(isa, &s->io, s->iobase);
pc87312_hard_reset(s);
+ ISA_SUPERIO_GET_CLASS(dev)->parent_realize(dev, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
if (is_parallel_enabled(s)) {
/* FIXME use a qdev chardev prop instead of parallel_hds[] */
chr = parallel_hds[0];
@@ -381,7 +388,9 @@ static Property pc87312_properties[] = {
static void pc87312_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ISASuperIOClass *sc = ISA_SUPERIO_CLASS(klass);
+ sc->parent_realize = dc->realize;
dc->realize = pc87312_realize;
dc->reset = pc87312_reset;
dc->vmsd = &vmstate_pc87312;
@@ -392,7 +401,7 @@ static void pc87312_class_init(ObjectClass *klass, void
*data)
static const TypeInfo pc87312_type_info = {
.name = TYPE_PC87312_SUPERIO,
- .parent = TYPE_ISA_DEVICE,
+ .parent = TYPE_ISA_SUPERIO,
.instance_size = sizeof(PC87312State),
.instance_init = pc87312_initfn,
.class_init = pc87312_class_init,
diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h
index b65b219a8a..f3761d6fe1 100644
--- a/include/hw/isa/pc87312.h
+++ b/include/hw/isa/pc87312.h
@@ -25,14 +25,16 @@
#ifndef QEMU_PC87312_H
#define QEMU_PC87312_H
-#include "hw/isa/isa.h"
+#include "hw/isa/superio.h"
#define TYPE_PC87312_SUPERIO "pc87312"
#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERIO)
typedef struct PC87312State {
- ISADevice dev;
+ /*< private >*/
+ ISASuperIODevice parent_dev;
+ /*< public >*/
uint16_t iobase;
uint8_t config; /* initial configuration */
--
2.14.3
- [Qemu-devel] [PULL 31/69] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO, (continued)
- [Qemu-devel] [PULL 31/69] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 32/69] hw/isa/pc87312: Use uint16_t for the ISA I/O base address, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 33/69] hw/isa/pc87312: Use 'unsigned int' for the irq value, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 34/69] hw/isa/superio: Add a Super I/O template based on the PC87312 device, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 36/69] hw/isa/superio: Factor out the parallel code from pc87312.c, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 37/69] hw/isa/superio: Factor out the serial code from pc87312.c, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 39/69] hw/isa/superio: Add a keyboard/mouse controller (8042), Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 41/69] hw/mips/malta: Code movement, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 38/69] hw/isa/superio: Factor out the floppy disc controller code from pc87312.c, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 40/69] hw/isa/superio: Factor out the IDE code from pc87312.c, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 35/69] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO,
Paolo Bonzini <=
- [Qemu-devel] [PULL 42/69] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 46/69] MAINTAINERS: Add entries for the VT82C686B Super I/O, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 47/69] MAINTAINERS: Split the Alpha TCG/machine section, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 49/69] hw/alpha/dp264: Add the ISA DMA controller, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 48/69] hw/isa/superio: Add the SMC FDC37C669 Super I/O, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 45/69] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 44/69] hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init(), Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 43/69] hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init(), Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 51/69] hw/i386/pc: Factor out the superio code, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 50/69] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO, Paolo Bonzini, 2018/03/13