hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> (hw/ppc) Message-Id: <20180308223946.26784-4-f4bug@amsat.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
55f613ac25
commit
47973a2dbf
@ -942,6 +942,7 @@ F: include/hw/display/vga.h
|
|||||||
F: include/hw/char/parallel.h
|
F: include/hw/char/parallel.h
|
||||||
F: include/hw/dma/i8257.h
|
F: include/hw/dma/i8257.h
|
||||||
F: include/hw/i2c/pm_smbus.h
|
F: include/hw/i2c/pm_smbus.h
|
||||||
|
F: include/hw/input/i8042.h
|
||||||
F: include/hw/timer/hpet.h
|
F: include/hw/timer/hpet.h
|
||||||
F: include/hw/timer/i8254*
|
F: include/hw/timer/i8254*
|
||||||
F: include/hw/timer/mc146818rtc*
|
F: include/hw/timer/mc146818rtc*
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "hw/timer/mc146818rtc.h"
|
#include "hw/timer/mc146818rtc.h"
|
||||||
#include "hw/ide.h"
|
#include "hw/ide.h"
|
||||||
#include "hw/timer/i8254.h"
|
#include "hw/timer/i8254.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/char/serial.h"
|
#include "hw/char/serial.h"
|
||||||
#include "qemu/cutils.h"
|
#include "qemu/cutils.h"
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ static void clipper_init(MachineState *machine)
|
|||||||
mc146818_rtc_init(isa_bus, 1900, rtc_irq);
|
mc146818_rtc_init(isa_bus, 1900, rtc_irq);
|
||||||
|
|
||||||
i8254_pit_init(isa_bus, 0x40, 0, NULL);
|
i8254_pit_init(isa_bus, 0x40, 0, NULL);
|
||||||
isa_create_simple(isa_bus, "i8042");
|
isa_create_simple(isa_bus, TYPE_I8042);
|
||||||
|
|
||||||
/* VGA setup. Don't bother loading the bios. */
|
/* VGA setup. Don't bother loading the bios. */
|
||||||
pci_vga_init(pci_bus);
|
pci_vga_init(pci_bus);
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "hw/timer/mc146818rtc.h"
|
#include "hw/timer/mc146818rtc.h"
|
||||||
#include "hw/dma/i8257.h"
|
#include "hw/dma/i8257.h"
|
||||||
#include "hw/timer/i8254.h"
|
#include "hw/timer/i8254.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/audio/pcspk.h"
|
#include "hw/audio/pcspk.h"
|
||||||
#include "hw/pci/msi.h"
|
#include "hw/pci/msi.h"
|
||||||
#include "hw/sysbus.h"
|
#include "hw/sysbus.h"
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "hw/hw.h"
|
#include "hw/hw.h"
|
||||||
#include "ui/console.h"
|
#include "ui/console.h"
|
||||||
#include "hw/i386/pc.h"
|
#include "hw/i386/pc.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/qdev.h"
|
#include "hw/qdev.h"
|
||||||
|
|
||||||
/* debug only vmmouse */
|
/* debug only vmmouse */
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "hw/hw.h"
|
#include "hw/hw.h"
|
||||||
#include "hw/isa/isa.h"
|
#include "hw/isa/isa.h"
|
||||||
#include "hw/i386/pc.h"
|
#include "hw/i386/pc.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "sysemu/hw_accel.h"
|
#include "sysemu/hw_accel.h"
|
||||||
#include "hw/qdev.h"
|
#include "hw/qdev.h"
|
||||||
#include "qemu/log.h"
|
#include "qemu/log.h"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "hw/isa/isa.h"
|
#include "hw/isa/isa.h"
|
||||||
#include "hw/i386/pc.h"
|
#include "hw/i386/pc.h"
|
||||||
#include "hw/input/ps2.h"
|
#include "hw/input/ps2.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
|
|
||||||
/* debug PC keyboard */
|
/* debug PC keyboard */
|
||||||
@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
|
|||||||
qemu_register_reset(kbd_reset, s);
|
qemu_register_reset(kbd_reset, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TYPE_I8042 "i8042"
|
|
||||||
#define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
|
#define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
|
||||||
|
|
||||||
typedef struct ISAKBDState {
|
typedef struct ISAKBDState {
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "hw/isa/vt82c686.h"
|
#include "hw/isa/vt82c686.h"
|
||||||
#include "hw/timer/mc146818rtc.h"
|
#include "hw/timer/mc146818rtc.h"
|
||||||
#include "hw/timer/i8254.h"
|
#include "hw/timer/i8254.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "sysemu/blockdev.h"
|
#include "sysemu/blockdev.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
#include "sysemu/qtest.h"
|
#include "sysemu/qtest.h"
|
||||||
@ -363,7 +364,7 @@ static void mips_fulong2e_init(MachineState *machine)
|
|||||||
i8257_dma_init(isa_bus, 0);
|
i8257_dma_init(isa_bus, 0);
|
||||||
|
|
||||||
/* Super I/O */
|
/* Super I/O */
|
||||||
isa_create_simple(isa_bus, "i8042");
|
isa_create_simple(isa_bus, TYPE_I8042);
|
||||||
|
|
||||||
mc146818_rtc_init(isa_bus, 2000, NULL);
|
mc146818_rtc_init(isa_bus, 2000, NULL);
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "hw/timer/i8254.h"
|
#include "hw/timer/i8254.h"
|
||||||
#include "hw/display/vga.h"
|
#include "hw/display/vga.h"
|
||||||
#include "hw/audio/pcspk.h"
|
#include "hw/audio/pcspk.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/sysbus.h"
|
#include "hw/sysbus.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
#include "sysemu/qtest.h"
|
#include "sysemu/qtest.h"
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include "hw/loader.h"
|
#include "hw/loader.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
#include "hw/timer/mc146818rtc.h"
|
#include "hw/timer/mc146818rtc.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/timer/i8254.h"
|
#include "hw/timer/i8254.h"
|
||||||
#include "sysemu/blockdev.h"
|
#include "sysemu/blockdev.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
@ -1213,7 +1214,7 @@ void mips_malta_init(MachineState *machine)
|
|||||||
i8257_dma_init(isa_bus, 0);
|
i8257_dma_init(isa_bus, 0);
|
||||||
|
|
||||||
/* Super I/O */
|
/* Super I/O */
|
||||||
isa_create_simple(isa_bus, "i8042");
|
isa_create_simple(isa_bus, TYPE_I8042);
|
||||||
|
|
||||||
mc146818_rtc_init(isa_bus, 2000, NULL);
|
mc146818_rtc_init(isa_bus, 2000, NULL);
|
||||||
serial_hds_isa_init(isa_bus, 0, 2);
|
serial_hds_isa_init(isa_bus, 0, 2);
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "hw/loader.h"
|
#include "hw/loader.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
#include "hw/timer/mc146818rtc.h"
|
#include "hw/timer/mc146818rtc.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/timer/i8254.h"
|
#include "hw/timer/i8254.h"
|
||||||
#include "sysemu/block-backend.h"
|
#include "sysemu/block-backend.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
@ -286,7 +287,7 @@ void mips_r4k_init(MachineState *machine)
|
|||||||
hd[MAX_IDE_DEVS * i],
|
hd[MAX_IDE_DEVS * i],
|
||||||
hd[MAX_IDE_DEVS * i + 1]);
|
hd[MAX_IDE_DEVS * i + 1]);
|
||||||
|
|
||||||
isa_create_simple(isa_bus, "i8042");
|
isa_create_simple(isa_bus, TYPE_I8042);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mips_machine_init(MachineClass *mc)
|
static void mips_machine_init(MachineClass *mc)
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include "hw/ide.h"
|
#include "hw/ide.h"
|
||||||
#include "hw/loader.h"
|
#include "hw/loader.h"
|
||||||
#include "hw/timer/mc146818rtc.h"
|
#include "hw/timer/mc146818rtc.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/isa/pc87312.h"
|
#include "hw/isa/pc87312.h"
|
||||||
#include "hw/net/ne2000-isa.h"
|
#include "hw/net/ne2000-isa.h"
|
||||||
#include "sysemu/arch_init.h"
|
#include "sysemu/arch_init.h"
|
||||||
@ -640,7 +641,7 @@ static void ppc_prep_init(MachineState *machine)
|
|||||||
hd[2 * i],
|
hd[2 * i],
|
||||||
hd[2 * i + 1]);
|
hd[2 * i + 1]);
|
||||||
}
|
}
|
||||||
isa_create_simple(isa_bus, "i8042");
|
isa_create_simple(isa_bus, TYPE_I8042);
|
||||||
|
|
||||||
cpu = POWERPC_CPU(first_cpu);
|
cpu = POWERPC_CPU(first_cpu);
|
||||||
sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
|
sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
|
||||||
@ -770,7 +771,7 @@ static void ibm_40p_init(MachineState *machine)
|
|||||||
|
|
||||||
/* add some more devices */
|
/* add some more devices */
|
||||||
if (defaults_enabled()) {
|
if (defaults_enabled()) {
|
||||||
isa_create_simple(isa_bus, "i8042");
|
isa_create_simple(isa_bus, TYPE_I8042);
|
||||||
m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
|
m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
|
||||||
|
|
||||||
dev = DEVICE(isa_create(isa_bus, "cs4231a"));
|
dev = DEVICE(isa_create(isa_bus, "cs4231a"));
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "hw/char/serial.h"
|
#include "hw/char/serial.h"
|
||||||
#include "hw/char/parallel.h"
|
#include "hw/char/parallel.h"
|
||||||
#include "hw/timer/m48t59.h"
|
#include "hw/timer/m48t59.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
#include "hw/block/fdc.h"
|
#include "hw/block/fdc.h"
|
||||||
#include "net/net.h"
|
#include "net/net.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#undef DEBUG_PUV3
|
#undef DEBUG_PUV3
|
||||||
#include "hw/unicore32/puv3.h"
|
#include "hw/unicore32/puv3.h"
|
||||||
|
#include "hw/input/i8042.h"
|
||||||
|
|
||||||
#define KERNEL_LOAD_ADDR 0x03000000
|
#define KERNEL_LOAD_ADDR 0x03000000
|
||||||
#define KERNEL_MAX_SIZE 0x00800000 /* Just a guess */
|
#define KERNEL_MAX_SIZE 0x00800000 /* Just a guess */
|
||||||
|
@ -189,15 +189,6 @@ void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
|
|||||||
void vmmouse_get_data(uint32_t *data);
|
void vmmouse_get_data(uint32_t *data);
|
||||||
void vmmouse_set_data(const uint32_t *data);
|
void vmmouse_set_data(const uint32_t *data);
|
||||||
|
|
||||||
/* pckbd.c */
|
|
||||||
#define I8042_A20_LINE "a20"
|
|
||||||
|
|
||||||
void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
|
|
||||||
MemoryRegion *region, ram_addr_t size,
|
|
||||||
hwaddr mask);
|
|
||||||
void i8042_isa_mouse_fake_event(void *opaque);
|
|
||||||
void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
|
|
||||||
|
|
||||||
/* pc.c */
|
/* pc.c */
|
||||||
extern int fd_bootchk;
|
extern int fd_bootchk;
|
||||||
|
|
||||||
|
24
include/hw/input/i8042.h
Normal file
24
include/hw/input/i8042.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* QEMU PS/2 Controller
|
||||||
|
*
|
||||||
|
* Copyright (c) 2003 Fabrice Bellard
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
#ifndef HW_INPUT_I8042_H
|
||||||
|
#define HW_INPUT_I8042_H
|
||||||
|
|
||||||
|
#include "hw/hw.h"
|
||||||
|
#include "hw/isa/isa.h"
|
||||||
|
|
||||||
|
#define TYPE_I8042 "i8042"
|
||||||
|
|
||||||
|
#define I8042_A20_LINE "a20"
|
||||||
|
|
||||||
|
void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
|
||||||
|
MemoryRegion *region, ram_addr_t size,
|
||||||
|
hwaddr mask);
|
||||||
|
void i8042_isa_mouse_fake_event(void *opaque);
|
||||||
|
void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
|
||||||
|
|
||||||
|
#endif /* HW_INPUT_I8042_H */
|
Loading…
Reference in New Issue
Block a user