This commit is contained in:
Jasmine Iwanek
2022-03-13 09:15:11 -04:00
parent c5d1a7b456
commit 66a687d68d
10 changed files with 411 additions and 342 deletions

View File

@@ -1613,79 +1613,72 @@ acpi_init(const device_t *info)
return dev; return dev;
} }
const device_t acpi_ali_device = const device_t acpi_ali_device = {
{ .name = "ALi M7101 ACPI",
"ALi M7101 ACPI", .internal_name = "acpi_ali",
"acpi_ali", .flags = DEVICE_PCI,
DEVICE_PCI, .local = VEN_ALI,
VEN_ALI, .init = acpi_init,
acpi_init, .close = acpi_close,
acpi_close, .reset = acpi_reset,
acpi_reset, { .available = NULL },
{ NULL }, .speed_changed = acpi_speed_changed,
acpi_speed_changed, .force_redraw = NULL,
NULL, .config = NULL
NULL
}; };
const device_t acpi_intel_device = const device_t acpi_intel_device = {
{ .name = "Intel ACPI",
"Intel ACPI", .internal_name = "acpi_intel",
"acpi_intel", .flags = DEVICE_PCI,
DEVICE_PCI, .local = VEN_INTEL,
VEN_INTEL, .init = acpi_init,
acpi_init, .close = acpi_close,
acpi_close, .reset = acpi_reset,
acpi_reset, { .available = NULL },
{ NULL }, .speed_changed = acpi_speed_changed,
acpi_speed_changed, .force_redraw = NULL,
NULL, .config = NULL
NULL
}; };
const device_t acpi_via_device = const device_t acpi_via_device = {
{ .name = "VIA ACPI",
"VIA ACPI", .internal_name = "acpi_via",
"acpi_via", .flags = DEVICE_PCI,
DEVICE_PCI, .local = VEN_VIA,
VEN_VIA, .init = acpi_init,
acpi_init, .close = acpi_close,
acpi_close, .reset = acpi_reset,
acpi_reset, { .available = NULL },
{ NULL }, .speed_changed = acpi_speed_changed,
acpi_speed_changed, .force_redraw = NULL,
NULL, .config = NULL
NULL
}; };
const device_t acpi_via_596b_device = {
const device_t acpi_via_596b_device = .name = "VIA VT82C596 ACPI",
{ .internal_name = "acpi_via_596b",
"VIA VT82C596 ACPI", .flags = DEVICE_PCI,
"acpi_via_596b", .local = VEN_VIA_596B,
DEVICE_PCI, .init = acpi_init,
VEN_VIA_596B, .close = acpi_close,
acpi_init, .reset = acpi_reset,
acpi_close, { .available = NULL },
acpi_reset, .speed_changed = acpi_speed_changed,
{ NULL }, .force_redraw = NULL,
acpi_speed_changed, .config = NULL
NULL,
NULL
}; };
const device_t acpi_smc_device = {
const device_t acpi_smc_device = .name = "SMC FDC73C931APM ACPI",
{ .internal_name = "acpi_smc",
"SMC FDC73C931APM ACPI", .flags = DEVICE_PCI,
"acpi_smc", .local = VEN_SMC,
DEVICE_PCI, .init = acpi_init,
VEN_SMC, .close = acpi_close,
acpi_init, .reset = acpi_reset,
acpi_close, { .available = NULL },
acpi_reset, .speed_changed = acpi_speed_changed,
{ NULL }, .force_redraw = NULL,
acpi_speed_changed, .config = NULL
NULL,
NULL
}; };

View File

@@ -123,49 +123,44 @@ static void
} }
const device_t apm_device = const device_t apm_device = {
{ .name = "Advanced Power Management",
"Advanced Power Management", .internal_name = "apm",
"apm", .flags = 0,
0, .local = 0,
0, .init = apm_init,
apm_init, .close = apm_close,
apm_close, .reset = NULL,
NULL, { .available = NULL },
{ NULL }, .speed_changed = NULL,
NULL, .force_redraw = NULL,
NULL, .config = NULL
NULL
}; };
const device_t apm_pci_device = {
const device_t apm_pci_device = .name = "Advanced Power Management (PCI)",
{ .internal_name = "apm_pci",
"Advanced Power Management (PCI)", .flags = DEVICE_PCI,
"apm_pci", .local = 0,
DEVICE_PCI, .init = apm_init,
0, .close = apm_close,
apm_init, .reset = apm_reset,
apm_close, { .available = NULL },
apm_reset, .speed_changed = NULL,
{ NULL }, .force_redraw = NULL,
NULL, .config = NULL
NULL,
NULL
}; };
const device_t apm_pci_acpi_device = {
const device_t apm_pci_acpi_device = .name = "Advanced Power Management (PCI)",
{ .internal_name = "apm_pci_acpi",
"Advanced Power Management (PCI)", .flags = DEVICE_PCI,
"apm_pci_acpi", .local = 1,
DEVICE_PCI, .init = apm_init,
1, .close = apm_close,
apm_init, .reset = apm_reset,
apm_close, { .available = NULL },
apm_reset, .speed_changed = NULL,
{ NULL }, .force_redraw = NULL,
NULL, .config = NULL
NULL,
NULL
}; };

View File

@@ -184,18 +184,16 @@ ddma_init(const device_t *info)
return dev; return dev;
} }
const device_t ddma_device = {
const device_t ddma_device = .name = "Distributed DMA",
{ .internal_name = "ddma",
"Distributed DMA", .flags = DEVICE_PCI,
"ddma", .local = 0,
DEVICE_PCI, .init = ddma_init,
0, .close = ddma_close,
ddma_init, .reset = NULL,
ddma_close, { .available = NULL },
NULL, .speed_changed = NULL,
{ NULL }, .force_redraw = NULL,
NULL, .config = NULL
NULL,
NULL
}; };

View File

@@ -121,11 +121,15 @@ ioapic_init(const device_t *info)
const device_t ioapic_device = { const device_t ioapic_device = {
"I/O Advanced Programmable Interrupt Controller", .name = "I/O Advanced Programmable Interrupt Controller",
"ioapic", .internal_name = "ioapic",
DEVICE_AT, .flags = DEVICE_AT,
0, .local = 0,
ioapic_init, ioapic_close, NULL, .init = ioapic_init,
{ NULL }, NULL, NULL, .close = ioapic_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };

View File

@@ -1120,113 +1120,156 @@ nvr_at_close(void *priv)
nvr_at_inited = 0; nvr_at_inited = 0;
} }
const device_t at_nvr_old_device = { const device_t at_nvr_old_device = {
"PC/AT NVRAM (No century)", .name = "PC/AT NVRAM (No century)",
"at_nvr_old", .internal_name = "at_nvr_old",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
0, .local = 0,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t at_nvr_device = { const device_t at_nvr_device = {
"PC/AT NVRAM", .name = "PC/AT NVRAM",
"at_nvr", .internal_name = "at_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
1, .local = 1,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t ps_nvr_device = { const device_t ps_nvr_device = {
"PS/1 or PS/2 NVRAM", .name = "PS/1 or PS/2 NVRAM",
"ps_nvr", .internal_name = "ps_nvr",
DEVICE_PS2, .flags = DEVICE_PS2,
2, .local = 2,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t amstrad_nvr_device = { const device_t amstrad_nvr_device = {
"Amstrad NVRAM", .name = "Amstrad NVRAM",
"amstrad_nvr", .internal_name = "amstrad_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
3, .local = 3,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t ibmat_nvr_device = { const device_t ibmat_nvr_device = {
"IBM AT NVRAM", .name = "IBM AT NVRAM",
"ibmat_nvr", .internal_name = "ibmat_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
4, .local = 4,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t piix4_nvr_device = { const device_t piix4_nvr_device = {
"Intel PIIX4 PC/AT NVRAM", .name = "Intel PIIX4 PC/AT NVRAM",
"piix4_nvr", .internal_name = "piix4_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
9, .local = 9,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t ami_1992_nvr_device = { const device_t ami_1992_nvr_device = {
"AMI Color 1992 PC/AT NVRAM", .name = "AMI Color 1992 PC/AT NVRAM",
"ami_1992_nvr", .internal_name = "ami_1992_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
12, .local = 12,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t ami_1994_nvr_device = { const device_t ami_1994_nvr_device = {
"AMI WinBIOS 1994 PC/AT NVRAM", .name = "AMI WinBIOS 1994 PC/AT NVRAM",
"ami_1994_nvr", .internal_name = "ami_1994_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
13, .local = 13,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t ami_1995_nvr_device = { const device_t ami_1995_nvr_device = {
"AMI WinBIOS 1995 PC/AT NVRAM", .name = "AMI WinBIOS 1995 PC/AT NVRAM",
"ami_1995_nvr", .internal_name = "ami_1995_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
14, .local = 14,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t via_nvr_device = { const device_t via_nvr_device = {
"VIA PC/AT NVRAM", .name = "VIA PC/AT NVRAM",
"via_nvr", .internal_name = "via_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
15, .local = 15,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };
const device_t p6rp4_nvr_device = { const device_t p6rp4_nvr_device = {
"ASUS P/I-P6RP4 PC/AT NVRAM", .name = "ASUS P/I-P6RP4 PC/AT NVRAM",
"p6rp4_nvr", .internal_name = "p6rp4_nvr",
DEVICE_ISA | DEVICE_AT, .flags = DEVICE_ISA | DEVICE_AT,
16, .local = 16,
nvr_at_init, nvr_at_close, nvr_at_reset, .init = nvr_at_init,
{ NULL }, nvr_at_speed_changed, .close = nvr_at_close,
NULL .reset = nvr_at_reset,
{ .available = NULL },
.speed_changed = nvr_at_speed_changed,
.force_redraw = NULL,
.config = NULL
}; };

View File

@@ -153,10 +153,15 @@ ps2_nvr_close(void *priv)
const device_t ps2_nvr_device = { const device_t ps2_nvr_device = {
"PS/2 Secondary NVRAM", .name = "PS/2 Secondary NVRAM",
"ps2_nvr", .internal_name = "ps2_nvr",
0, 0, .flags = 0,
ps2_nvr_init, ps2_nvr_close, NULL, .local = 0,
{ NULL }, NULL, .init = ps2_nvr_init,
NULL .close = ps2_nvr_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };

111
src/pit.c
View File

@@ -841,67 +841,76 @@ pit_init(const device_t *info)
return dev; return dev;
} }
const device_t i8253_device = {
const device_t i8253_device = .name = "Intel 8253/8253-5 Programmable Interval Timer",
{ .internal_name = "i8253",
"Intel 8253/8253-5 Programmable Interval Timer", .flags = DEVICE_ISA,
"i8253", .local = PIT_8253,
DEVICE_ISA, .init = pit_init,
PIT_8253, .close = pit_close,
pit_init, pit_close, NULL, .reset = NULL,
{ NULL }, NULL, NULL, { .available = NULL },
NULL .speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t i8254_device = {
const device_t i8254_device = .name = "Intel 8254 Programmable Interval Timer",
{ .internal_name = "i8254",
"Intel 8254 Programmable Interval Timer", .flags = DEVICE_ISA,
"i8254", .local = PIT_8254,
DEVICE_ISA, .init = pit_init,
PIT_8254, .close = pit_close,
pit_init, pit_close, NULL, .reset = NULL,
{ NULL }, NULL, NULL, { .available = NULL },
NULL .speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t i8254_sec_device = {
const device_t i8254_sec_device = .name = "Intel 8254 Programmable Interval Timer (Secondary)",
{ .internal_name = "i8254_sec",
"Intel 8254 Programmable Interval Timer (Secondary)", .flags = DEVICE_ISA,
"i8254_sec", .local = PIT_8254 | PIT_SECONDARY,
DEVICE_ISA, .init = pit_init,
PIT_8254 | PIT_SECONDARY, .close = pit_close,
pit_init, pit_close, NULL, .reset = NULL,
{ NULL }, NULL, NULL, { .available = NULL },
NULL .speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t i8254_ext_io_device = {
const device_t i8254_ext_io_device = .name = "Intel 8254 Programmable Interval Timer (External I/O)",
{ .internal_name = "i8254_ext_io",
"Intel 8254 Programmable Interval Timer (External I/O)", .flags = DEVICE_ISA,
"i8254_ext_io", .local = PIT_8254 | PIT_EXT_IO,
DEVICE_ISA, .init = pit_init,
PIT_8254 | PIT_EXT_IO, .close = pit_close,
pit_init, pit_close, NULL, .reset = NULL,
{ NULL }, NULL, NULL, { .available = NULL },
NULL .speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t i8254_ps2_device = {
const device_t i8254_ps2_device = .name = "Intel 8254 Programmable Interval Timer (PS/2)",
{ .internal_name = "i8254_ps2",
"Intel 8254 Programmable Interval Timer (PS/2)", .flags = DEVICE_ISA,
"i8254_ps2", .local = PIT_8254 | PIT_PS2 | PIT_EXT_IO,
DEVICE_ISA, .init = pit_init,
PIT_8254 | PIT_PS2 | PIT_EXT_IO, .close = pit_close,
pit_init, pit_close, NULL, .reset = NULL,
{ NULL }, NULL, NULL, { .available = NULL },
NULL .speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
pit_t * pit_t *
pit_common_init(int type, void (*out0)(int new_out, int old_out), void (*out1)(int new_out, int old_out)) pit_common_init(int type, void (*out0)(int new_out, int old_out), void (*out1)(int new_out, int old_out))
{ {

View File

@@ -173,46 +173,58 @@ port_6x_init(const device_t *info)
return dev; return dev;
} }
const device_t port_6x_device = { const device_t port_6x_device = {
"Port 6x Registers", .name = "Port 6x Registers",
"port_6x", .internal_name = "port_6x",
0, .flags = 0,
0, .local = 0,
port_6x_init, port_6x_close, NULL, .init = port_6x_init,
{ NULL }, NULL, NULL, .close = port_6x_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t port_6x_xi8088_device = { const device_t port_6x_xi8088_device = {
"Port 6x Registers (Xi8088)", .name = "Port 6x Registers (Xi8088)",
"port_6x_xi8088", .internal_name = "port_6x_xi8088",
0, .flags = 0,
PORT_6X_TURBO | PORT_6X_EXT_REF | PORT_6X_MIRROR, .local = PORT_6X_TURBO | PORT_6X_EXT_REF | PORT_6X_MIRROR,
port_6x_init, port_6x_close, NULL, .init = port_6x_init,
{ NULL }, NULL, NULL, .close = port_6x_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t port_6x_ps2_device = { const device_t port_6x_ps2_device = {
"Port 6x Registers (IBM PS/2)", .name = "Port 6x Registers (IBM PS/2)",
"port_6x_ps2", .internal_name = "port_6x_ps2",
0, .flags = 0,
PORT_6X_EXT_REF, .local = PORT_6X_EXT_REF,
port_6x_init, port_6x_close, NULL, .init = port_6x_init,
{ NULL }, NULL, NULL, .close = port_6x_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t port_6x_olivetti_device = { const device_t port_6x_olivetti_device = {
"Port 6x Registers (Olivetti)", .name = "Port 6x Registers (Olivetti)",
"port_6x_olivetti", .internal_name = "port_6x_olivetti",
0, .flags = 0,
PORT_6X_SWA, .local = PORT_6X_SWA,
port_6x_init, port_6x_close, NULL, .init = port_6x_init,
{ NULL }, NULL, NULL, .close = port_6x_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };

View File

@@ -216,46 +216,58 @@ port_92_init(const device_t *info)
return dev; return dev;
} }
const device_t port_92_device = { const device_t port_92_device = {
"Port 92 Register", .name = "Port 92 Register",
"port_92", .internal_name = "port_92",
0, .flags = 0,
0, .local = 0,
port_92_init, port_92_close, NULL, .init = port_92_init,
{ NULL }, NULL, NULL, .close = port_92_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t port_92_inv_device = { const device_t port_92_inv_device = {
"Port 92 Register (inverted bits 2-7)", .name = "Port 92 Register (inverted bits 2-7)",
"port_92_inv", .internal_name = "port_92_inv",
0, .flags = 0,
PORT_92_INV, .local = PORT_92_INV,
port_92_init, port_92_close, NULL, .init = port_92_init,
{ NULL }, NULL, NULL, .close = port_92_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t port_92_word_device = { const device_t port_92_word_device = {
"Port 92 Register (16-bit)", .name = "Port 92 Register (16-bit)",
"port_92_word", .internal_name = "port_92_word",
0, .flags = 0,
PORT_92_WORD, .local = PORT_92_WORD,
port_92_init, port_92_close, NULL, .init = port_92_init,
{ NULL }, NULL, NULL, .close = port_92_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t port_92_pci_device = { const device_t port_92_pci_device = {
"Port 92 Register (PCI)", .name = "Port 92 Register (PCI)",
"port_92_pci", .internal_name = "port_92_pci",
0, .flags = 0,
PORT_92_PCI, .local = PORT_92_PCI,
port_92_init, port_92_close, NULL, .init = port_92_init,
{ NULL }, NULL, NULL, .close = port_92_close,
NULL .reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };

View File

@@ -409,18 +409,16 @@ usb_init(const device_t *info)
return dev; return dev;
} }
const device_t usb_device = {
const device_t usb_device = .name = "Universal Serial Bus",
{ .internal_name = "usb",
"Universal Serial Bus", .flags = DEVICE_PCI,
"usb", .local = 0,
DEVICE_PCI, .init = usb_init,
0, .close = usb_close,
usb_init, .reset = usb_reset,
usb_close, { .available = NULL },
usb_reset, .speed_changed = NULL,
{ NULL }, .force_redraw = NULL,
NULL, .config = NULL
NULL,
NULL
}; };