hw/isa/superio: Add a keyboard/mouse controller (8042)
[qemu/ar7.git] / include / hw / isa / superio.h
blob2fc33bf3d3fba1b7e940a492dbbb891298f75680
1 /*
2 * Generic ISA Super I/O
4 * Copyright (c) 2018 Philippe Mathieu-Daudé
6 * This code is licensed under the GNU GPLv2 and later.
7 * See the COPYING file in the top-level directory.
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10 #ifndef HW_ISA_SUPERIO_H
11 #define HW_ISA_SUPERIO_H
13 #include "qemu-common.h"
14 #include "sysemu/sysemu.h"
15 #include "hw/isa/isa.h"
17 #define TYPE_ISA_SUPERIO "isa-superio"
18 #define ISA_SUPERIO(obj) \
19 OBJECT_CHECK(ISASuperIODevice, (obj), TYPE_ISA_SUPERIO)
20 #define ISA_SUPERIO_GET_CLASS(obj) \
21 OBJECT_GET_CLASS(ISASuperIOClass, (obj), TYPE_ISA_SUPERIO)
22 #define ISA_SUPERIO_CLASS(klass) \
23 OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO)
25 typedef struct ISASuperIODevice {
26 /*< private >*/
27 ISADevice parent_obj;
28 /*< public >*/
30 ISADevice *parallel[MAX_PARALLEL_PORTS];
31 ISADevice *serial[MAX_SERIAL_PORTS];
32 ISADevice *floppy;
33 ISADevice *kbc;
34 } ISASuperIODevice;
36 typedef struct ISASuperIOFuncs {
37 size_t count;
38 bool (*is_enabled)(ISASuperIODevice *sio, uint8_t index);
39 uint16_t (*get_iobase)(ISASuperIODevice *sio, uint8_t index);
40 unsigned int (*get_irq)(ISASuperIODevice *sio, uint8_t index);
41 unsigned int (*get_dma)(ISASuperIODevice *sio, uint8_t index);
42 } ISASuperIOFuncs;
44 typedef struct ISASuperIOClass {
45 /*< private >*/
46 ISADeviceClass parent_class;
47 /*< public >*/
48 DeviceRealize parent_realize;
50 ISASuperIOFuncs parallel;
51 ISASuperIOFuncs serial;
52 ISASuperIOFuncs floppy;
53 } ISASuperIOClass;
55 #endif /* HW_ISA_SUPERIO_H */