1
2
3
4
5
6
7
8
9
10#ifndef HW_ISA_SUPERIO_H
11#define HW_ISA_SUPERIO_H
12
13#include "sysemu/sysemu.h"
14#include "hw/isa/isa.h"
15
16#define TYPE_ISA_SUPERIO "isa-superio"
17#define ISA_SUPERIO(obj) \
18 OBJECT_CHECK(ISASuperIODevice, (obj), TYPE_ISA_SUPERIO)
19#define ISA_SUPERIO_GET_CLASS(obj) \
20 OBJECT_GET_CLASS(ISASuperIOClass, (obj), TYPE_ISA_SUPERIO)
21#define ISA_SUPERIO_CLASS(klass) \
22 OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO)
23
24#define SUPERIO_MAX_SERIAL_PORTS 4
25
26typedef struct ISASuperIODevice {
27
28 ISADevice parent_obj;
29
30
31 ISADevice *parallel[MAX_PARALLEL_PORTS];
32 ISADevice *serial[SUPERIO_MAX_SERIAL_PORTS];
33 ISADevice *floppy;
34 ISADevice *kbc;
35 ISADevice *ide;
36} ISASuperIODevice;
37
38typedef struct ISASuperIOFuncs {
39 size_t count;
40 bool (*is_enabled)(ISASuperIODevice *sio, uint8_t index);
41 uint16_t (*get_iobase)(ISASuperIODevice *sio, uint8_t index);
42 unsigned int (*get_irq)(ISASuperIODevice *sio, uint8_t index);
43 unsigned int (*get_dma)(ISASuperIODevice *sio, uint8_t index);
44} ISASuperIOFuncs;
45
46typedef struct ISASuperIOClass {
47
48 ISADeviceClass parent_class;
49
50 DeviceRealize parent_realize;
51
52 ISASuperIOFuncs parallel;
53 ISASuperIOFuncs serial;
54 ISASuperIOFuncs floppy;
55 ISASuperIOFuncs ide;
56} ISASuperIOClass;
57
58#define TYPE_FDC37M81X_SUPERIO "fdc37m81x-superio"
59#define TYPE_SMC37C669_SUPERIO "smc37c669-superio"
60
61#endif
62