OSDN Git Service

hw/isa/superio: Add a keyboard/mouse controller (8042)
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 8 Mar 2018 22:39:34 +0000 (23:39 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Mar 2018 15:12:48 +0000 (16:12 +0100)
Since the PC87312 inherits this abstract model, we remove the I8042
instance in the PREP machine.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20180308223946.26784-14-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/isa/isa-superio.c
hw/ppc/prep.c
include/hw/isa/superio.h

index 4b5e280..041b47b 100644 (file)
@@ -17,6 +17,7 @@
 #include "sysemu/blockdev.h"
 #include "chardev/char.h"
 #include "hw/isa/superio.h"
+#include "hw/input/i8042.h"
 #include "hw/char/serial.h"
 #include "trace.h"
 
@@ -143,6 +144,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
                                     k->floppy.get_irq(sio, 0) : -1);
     }
 
+    /* Keyboard, mouse */
+    sio->kbc = isa_create_simple(bus, TYPE_I8042);
 }
 
 static void isa_superio_class_init(ObjectClass *oc, void *data)
index df774bd..5c78503 100644 (file)
@@ -641,7 +641,6 @@ static void ppc_prep_init(MachineState *machine)
                      hd[2 * i],
                     hd[2 * i + 1]);
     }
-    isa_create_simple(isa_bus, TYPE_I8042);
 
     cpu = POWERPC_CPU(first_cpu);
     sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
index e8007b9..2fc33bf 100644 (file)
@@ -30,6 +30,7 @@ typedef struct ISASuperIODevice {
     ISADevice *parallel[MAX_PARALLEL_PORTS];
     ISADevice *serial[MAX_SERIAL_PORTS];
     ISADevice *floppy;
+    ISADevice *kbc;
 } ISASuperIODevice;
 
 typedef struct ISASuperIOFuncs {