Commit 48a18b3c authored by Hervé Poussineau's avatar Hervé Poussineau Committed by Anthony Liguori

isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() functions

NULL is a valid bus/device, so there is no change in behaviour.
Signed-off-by: default avatarHervé Poussineau <hpoussin@reactos.org>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 0fa29915
......@@ -473,7 +473,7 @@ struct soundhw {
int enabled;
int isa;
union {
int (*init_isa) (qemu_irq *pic);
int (*init_isa) (ISABus *bus, qemu_irq *pic);
int (*init_pci) (PCIBus *bus);
} init;
};
......@@ -628,7 +628,7 @@ void select_soundhw(const char *optarg)
}
}
void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus)
void audio_init(ISABus *isa_bus, qemu_irq *isa_pic, PCIBus *pci_bus)
{
struct soundhw *c;
......@@ -636,7 +636,7 @@ void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus)
if (c->enabled) {
if (c->isa) {
if (isa_pic) {
c->init.init_isa(isa_pic);
c->init.init_isa(isa_bus, isa_pic);
}
} else {
if (pci_bus) {
......@@ -650,7 +650,7 @@ void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus)
void select_soundhw(const char *optarg)
{
}
void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus)
void audio_init(ISABus *isa_bus, qemu_irq *isa_pic, PCIBus *pci_bus)
{
}
#endif
......
......@@ -27,7 +27,7 @@ void do_acpitable_option(const char *optarg);
void do_smbios_option(const char *optarg);
void cpudef_init(void);
int audio_available(void);
void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus);
void audio_init(ISABus *isa_bus, qemu_irq *isa_pic, PCIBus *pci_bus);
int tcg_available(void);
int kvm_available(void);
int xen_available(void);
......
......@@ -275,7 +275,7 @@ static void Adlib_fini (AdlibState *s)
AUD_remove_card (&s->card);
}
int Adlib_init (qemu_irq *pic)
int Adlib_init (ISABus *bus, qemu_irq *pic)
{
AdlibState *s = &glob_adlib;
struct audsettings as;
......
......@@ -50,6 +50,7 @@ static void clipper_init(ram_addr_t ram_size,
{
CPUState *cpus[4];
PCIBus *pci_bus;
ISABus *isa_bus;
qemu_irq rtc_irq;
long size, i;
const char *palcode_filename;
......@@ -68,10 +69,11 @@ static void clipper_init(ram_addr_t ram_size,
/* Init the chipset. */
pci_bus = typhoon_init(ram_size, &rtc_irq, cpus, clipper_pci_map_irq);
isa_bus = NULL;
rtc_init(1980, rtc_irq);
pit_init(0x40, 0);
isa_create_simple("i8042");
rtc_init(isa_bus, 1980, rtc_irq);
pit_init(isa_bus, 0x40, 0);
isa_create_simple(isa_bus, "i8042");
/* VGA setup. Don't bother loading the bios. */
alpha_pci_vga_setup(pci_bus);
......@@ -79,7 +81,7 @@ static void clipper_init(ram_addr_t ram_size,
/* Serial code setup. */
for (i = 0; i < MAX_SERIAL_PORTS; ++i) {
if (serial_hds[i]) {
serial_isa_init(i, serial_hds[i]);
serial_isa_init(isa_bus, i, serial_hds[i]);
}
}
......
......@@ -791,11 +791,12 @@ PCIBus *typhoon_init(ram_addr_t ram_size, qemu_irq *p_rtc_irq,
/* ??? Technically there should be a cy82c693ub pci-isa bridge. */
{
qemu_irq isa_pci_irq, *isa_irqs;
ISABus *isa_bus;
isa_bus_new(NULL, addr_space_io);
isa_bus = isa_bus_new(NULL, addr_space_io);
isa_pci_irq = *qemu_allocate_irqs(typhoon_set_isa_irq, s, 1);
isa_irqs = i8259_init(isa_pci_irq);
isa_bus_irqs(isa_irqs);
isa_irqs = i8259_init(isa_bus, isa_pci_irq);
isa_bus_irqs(isa_bus, isa_irqs);
}
return b;
......
......@@ -2,19 +2,19 @@
int es1370_init(PCIBus *bus);
/* sb16.c */
int SB16_init(qemu_irq *pic);
int SB16_init(ISABus *bus, qemu_irq *pic);
/* adlib.c */
int Adlib_init(qemu_irq *pic);
int Adlib_init(ISABus *bus, qemu_irq *pic);
/* gus.c */
int GUS_init(qemu_irq *pic);
int GUS_init(ISABus *bus, qemu_irq *pic);
/* ac97.c */
int ac97_init(PCIBus *bus);
/* cs4231a.c */
int cs4231a_init(qemu_irq *pic);
int cs4231a_init(ISABus *bus, qemu_irq *pic);
/* intel-hda.c + hda-audio.c */
int intel_hda_and_codec_init(PCIBus *bus);
......@@ -659,9 +659,9 @@ static int cs4231a_initfn (ISADevice *dev)
return 0;
}
int cs4231a_init (qemu_irq *pic)
int cs4231a_init (ISABus *bus, qemu_irq *pic)
{
isa_create_simple ("cs4231a");
isa_create_simple (bus, "cs4231a");
return 0;
}
......
......@@ -7,11 +7,11 @@
/* fdc.c */
#define MAX_FD 2
static inline ISADevice *fdctrl_init_isa(DriveInfo **fds)
static inline ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds)
{
ISADevice *dev;
dev = isa_try_create("isa-fdc");
dev = isa_try_create(bus, "isa-fdc");
if (!dev) {
return NULL;
}
......
......@@ -293,9 +293,9 @@ static int gus_initfn (ISADevice *dev)
return 0;
}
int GUS_init (qemu_irq *pic)
int GUS_init (ISABus *bus, qemu_irq *pic)
{
isa_create_simple ("gus");
isa_create_simple (bus, "gus");
return 0;
}
......
......@@ -525,7 +525,7 @@ static int pit_initfn(ISADevice *dev)
s = &pit->channels[0];
/* the timer 0 is connected to an IRQ */
s->irq_timer = qemu_new_timer_ns(vm_clock, pit_irq_timer, s);
s->irq = isa_get_irq(pit->irq);
s->irq = isa_get_irq(dev, pit->irq);
memory_region_init_io(&pit->ioports, &pit_ioport_ops, pit, "pit", 4);
isa_register_ioport(dev, &pit->ioports, pit->iobase);
......
......@@ -518,7 +518,7 @@ void irq_info(Monitor *mon)
#endif
}
qemu_irq *i8259_init(qemu_irq parent_irq)
qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
{
qemu_irq *irq_set;
ISADevice *dev;
......@@ -526,7 +526,7 @@ qemu_irq *i8259_init(qemu_irq parent_irq)
irq_set = g_malloc(ISA_NUM_IRQS * sizeof(qemu_irq));
dev = isa_create("isa-i8259");
dev = isa_create(bus, "isa-i8259");
qdev_prop_set_uint32(&dev->qdev, "iobase", 0x20);
qdev_prop_set_uint32(&dev->qdev, "elcr_addr", 0x4d0);
qdev_prop_set_uint8(&dev->qdev, "elcr_mask", 0xf8);
......@@ -540,7 +540,7 @@ qemu_irq *i8259_init(qemu_irq parent_irq)
isa_pic = DO_UPCAST(PicState, dev, dev);
dev = isa_create("isa-i8259");
dev = isa_create(bus, "isa-i8259");
qdev_prop_set_uint32(&dev->qdev, "iobase", 0xa0);
qdev_prop_set_uint32(&dev->qdev, "elcr_addr", 0x4d1);
qdev_prop_set_uint8(&dev->qdev, "elcr_mask", 0xde);
......
......@@ -8,7 +8,7 @@
#define MAX_IDE_DEVS 2
/* ide-isa.c */
ISADevice *isa_ide_init(int iobase, int iobase2, int isairq,
ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
DriveInfo *hd0, DriveInfo *hd1);
/* ide-pci.c */
......
......@@ -73,13 +73,13 @@ static int isa_ide_initfn(ISADevice *dev)
return 0;
};
ISADevice *isa_ide_init(int iobase, int iobase2, int isairq,
ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
DriveInfo *hd0, DriveInfo *hd1)
{
ISADevice *dev;
ISAIDEState *s;
dev = isa_create("isa-ide");
dev = isa_create(bus, "isa-ide");
qdev_prop_set_uint32(&dev->qdev, "iobase", iobase);
qdev_prop_set_uint32(&dev->qdev, "iobase2", iobase2);
qdev_prop_set_uint32(&dev->qdev, "irq", isairq);
......
......@@ -136,7 +136,7 @@ static void pci_piix_init_ports(PCIIDEState *d) {
ide_bus_new(&d->bus[i], &d->dev.qdev, i);
ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
port_info[i].iobase2);
ide_init2(&d->bus[i], isa_get_irq(port_info[i].isairq));
ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq));
bmdma_init(&d->bus[i], &d->bmdma[i], d);
d->bmdma[i].bus = &d->bus[i];
......
......@@ -160,7 +160,7 @@ static void vt82c686b_init_ports(PCIIDEState *d) {
ide_bus_new(&d->bus[i], &d->dev.qdev, i);
ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
port_info[i].iobase2);
ide_init2(&d->bus[i], isa_get_irq(port_info[i].isairq));
ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq));
bmdma_init(&d->bus[i], &d->bmdma[i], d);
d->bmdma[i].bus = &d->bus[i];
......
......@@ -56,8 +56,9 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io)
return isabus;
}
void isa_bus_irqs(qemu_irq *irqs)
void isa_bus_irqs(ISABus *bus, qemu_irq *irqs)
{
assert(!bus || bus == isabus);
isabus->irqs = irqs;
}
......@@ -67,8 +68,9 @@ void isa_bus_irqs(qemu_irq *irqs)
* This function is only for special cases such as the 'ferr', and
* temporary use for normal devices until they are converted to qdev.
*/
qemu_irq isa_get_irq(int isairq)
qemu_irq isa_get_irq(ISADevice *dev, int isairq)
{
assert(!dev || DO_UPCAST(ISABus, qbus, dev->qdev.parent_bus) == isabus);
if (isairq < 0 || isairq > 15) {
hw_error("isa irq %d invalid", isairq);
}
......@@ -79,7 +81,7 @@ void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)
{
assert(dev->nirqs < ARRAY_SIZE(dev->isairq));
dev->isairq[dev->nirqs] = isairq;
*p = isa_get_irq(isairq);
*p = isa_get_irq(dev, isairq);
dev->nirqs++;
}
......@@ -129,10 +131,11 @@ void isa_qdev_register(ISADeviceInfo *info)
qdev_register(&info->qdev);
}
ISADevice *isa_create(const char *name)
ISADevice *isa_create(ISABus *bus, const char *name)
{
DeviceState *dev;
assert(!bus || bus == isabus);
if (!isabus) {
hw_error("Tried to create isa device %s with no isa bus present.",
name);
......@@ -141,10 +144,11 @@ ISADevice *isa_create(const char *name)
return DO_UPCAST(ISADevice, qdev, dev);
}
ISADevice *isa_try_create(const char *name)
ISADevice *isa_try_create(ISABus *bus, const char *name)
{
DeviceState *dev;
assert(!bus || bus == isabus);
if (!isabus) {
hw_error("Tried to create isa device %s with no isa bus present.",
name);
......@@ -153,11 +157,11 @@ ISADevice *isa_try_create(const char *name)
return DO_UPCAST(ISADevice, qdev, dev);
}
ISADevice *isa_create_simple(const char *name)
ISADevice *isa_create_simple(ISABus *bus, const char *name)
{
ISADevice *dev;
dev = isa_create(name);
dev = isa_create(bus, name);
qdev_init_nofail(&dev->qdev);
return dev;
}
......
......@@ -9,7 +9,6 @@
#define ISA_NUM_IRQS 16
typedef struct ISABus ISABus;
typedef struct ISADevice ISADevice;
typedef struct ISADeviceInfo ISADeviceInfo;
......@@ -27,14 +26,14 @@ struct ISADeviceInfo {
};
ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io);
void isa_bus_irqs(qemu_irq *irqs);
qemu_irq isa_get_irq(int isairq);
void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
qemu_irq isa_get_irq(ISADevice *dev, int isairq);
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
void isa_qdev_register(ISADeviceInfo *info);
MemoryRegion *isa_address_space(ISADevice *dev);
ISADevice *isa_create(const char *name);
ISADevice *isa_try_create(const char *name);
ISADevice *isa_create_simple(const char *name);
ISADevice *isa_create(ISABus *bus, const char *name);
ISADevice *isa_try_create(ISABus *bus, const char *name);
ISADevice *isa_create_simple(ISABus *bus, const char *name);
/**
* isa_register_ioport: Install an I/O port region on the ISA bus.
......
......@@ -660,13 +660,14 @@ M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,
return state;
}
M48t59State *m48t59_init_isa(uint32_t io_base, uint16_t size, int type)
M48t59State *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
int type)
{
M48t59ISAState *d;
ISADevice *dev;
M48t59State *s;
dev = isa_create("m48t59_isa");
dev = isa_create(bus, "m48t59_isa");
qdev_prop_set_uint32(&dev->qdev, "type", type);
qdev_prop_set_uint32(&dev->qdev, "size", size);
qdev_prop_set_uint32(&dev->qdev, "io_base", io_base);
......
......@@ -677,12 +677,12 @@ static int rtc_initfn(ISADevice *dev)
return 0;
}
ISADevice *rtc_init(int base_year, qemu_irq intercept_irq)
ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
{
ISADevice *dev;
RTCState *s;
dev = isa_create("mc146818rtc");
dev = isa_create(bus, "mc146818rtc");
s = DO_UPCAST(RTCState, dev, dev);
qdev_prop_set_int32(&dev->qdev, "base_year", base_year);
qdev_init_nofail(&dev->qdev);
......
......@@ -5,7 +5,7 @@
#define RTC_ISA_IRQ 8
ISADevice *rtc_init(int base_year, qemu_irq intercept_irq);
ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
void rtc_set_memory(ISADevice *dev, int addr, int val);
void rtc_set_date(ISADevice *dev, const struct tm *tm);
......
......@@ -266,6 +266,7 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
qemu_irq *cpu_exit_irq;
int via_devfn;
PCIBus *pci_bus;
ISABus *isa_bus;
i2c_bus *smbus;
int i;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
......@@ -342,11 +343,12 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
fprintf(stderr, "vt82c686b_init error\n");
exit(1);
}
isa_bus = NULL;
/* Interrupt controller */
/* The 8259 -> IP5 */
i8259 = i8259_init(env->irq[5]);
isa_bus_irqs(i8259);
i8259 = i8259_init(isa_bus, env->irq[5]);
isa_bus_irqs(isa_bus, i8259);
vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(FULONG2E_VIA_SLOT, 1));
usb_uhci_vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 2));
......@@ -358,23 +360,23 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
smbus_eeprom_init(smbus, 1, eeprom_spd, sizeof(eeprom_spd));
/* init other devices */
pit = pit_init(0x40, 0);
pit = pit_init(isa_bus, 0x40, 0);
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
DMA_init(0, cpu_exit_irq);
/* Super I/O */
isa_create_simple("i8042");
isa_create_simple(isa_bus, "i8042");
rtc_init(2000, NULL);
rtc_init(isa_bus, 2000, NULL);
for(i = 0; i < MAX_SERIAL_PORTS; i++) {
if (serial_hds[i]) {
serial_isa_init(i, serial_hds[i]);
serial_isa_init(isa_bus, i, serial_hds[i]);
}
}
if (parallel_hds[0]) {
parallel_init(0, parallel_hds[0]);
parallel_init(isa_bus, 0, parallel_hds[0]);
}
/* Sound card */
......
......@@ -120,6 +120,7 @@ static void mips_jazz_init(MemoryRegion *address_space,
NICInfo *nd;
DeviceState *dev;
SysBusDevice *sysbus;
ISABus *isa_bus;
ISADevice *pit;
DriveInfo *fds[MAX_FD];
qemu_irq esp_reset, dma_enable;
......@@ -183,12 +184,12 @@ static void mips_jazz_init(MemoryRegion *address_space,
memory_region_add_subregion(address_space, 0x8000d000, dma_dummy);
/* ISA devices */
isa_bus_new(NULL, address_space_io);
i8259 = i8259_init(env->irq[4]);
isa_bus_irqs(i8259);
isa_bus = isa_bus_new(NULL, address_space_io);
i8259 = i8259_init(isa_bus, env->irq[4]);
isa_bus_irqs(isa_bus, i8259);
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
DMA_init(0, cpu_exit_irq);
pit = pit_init(0x40, 0);
pit = pit_init(isa_bus, 0x40, 0);
pcspk_init(pit);
/* ISA IO space at 0x90000000 */
......@@ -255,7 +256,7 @@ static void mips_jazz_init(MemoryRegion *address_space,
fdctrl_init_sysbus(rc4030[1], 0, 0x80003000, fds);
/* Real time clock */
rtc_init(1980, NULL);
rtc_init(isa_bus, 1980, NULL);
memory_region_init_io(rtc, &rtc_ops, NULL, "rtc", 0x1000);
memory_region_add_subregion(address_space, 0x80004000, rtc);
......@@ -280,7 +281,7 @@ static void mips_jazz_init(MemoryRegion *address_space,
/* Sound card */
/* FIXME: missing Jazz sound at 0x8000c000, rc4030[2] */
audio_init(i8259, NULL);
audio_init(isa_bus, i8259, NULL);
/* NVRAM */
dev = qdev_create(NULL, "ds1225y");
......
......@@ -774,6 +774,7 @@ void mips_malta_init (ram_addr_t ram_size,
target_long bios_size;
int64_t kernel_entry;
PCIBus *pci_bus;
ISABus *isa_bus;
CPUState *env;
qemu_irq *i8259 = NULL, *isa_irq;
qemu_irq *cpu_exit_irq;
......@@ -942,37 +943,38 @@ void mips_malta_init (ram_addr_t ram_size,
ide_drive_get(hd, MAX_IDE_BUS);
piix4_devfn = piix4_init(pci_bus, 80);
isa_bus = NULL;
/* Interrupt controller */
/* The 8259 is attached to the MIPS CPU INT0 pin, ie interrupt 2 */
i8259 = i8259_init(env->irq[2]);
i8259 = i8259_init(isa_bus, env->irq[2]);
isa_bus_irqs(i8259);
isa_bus_irqs(isa_bus, i8259);
pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1);
usb_uhci_piix4_init(pci_bus, piix4_devfn + 2);
smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(9),
NULL, NULL, 0);
smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100,
isa_get_irq(NULL, 9), NULL, NULL, 0);
/* TODO: Populate SPD eeprom data. */
smbus_eeprom_init(smbus, 8, NULL, 0);
pit = pit_init(0x40, 0);
pit = pit_init(isa_bus, 0x40, 0);
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
DMA_init(0, cpu_exit_irq);
/* Super I/O */
isa_create_simple("i8042");
isa_create_simple(isa_bus, "i8042");
rtc_init(2000, NULL);
serial_isa_init(0, serial_hds[0]);
serial_isa_init(1, serial_hds[1]);
rtc_init(isa_bus, 2000, NULL);
serial_isa_init(isa_bus, 0, serial_hds[0]);
serial_isa_init(isa_bus, 1, serial_hds[1]);
if (parallel_hds[0])
parallel_init(0, parallel_hds[0]);
parallel_init(isa_bus, 0, parallel_hds[0]);
for(i = 0; i < MAX_FD; i++) {
fd[i] = drive_get(IF_FLOPPY, 0, i);
}
fdctrl_init_isa(fd);
fdctrl_init_isa(isa_bus, fd);
/* Sound card */
audio_init(NULL, pci_bus);
audio_init(isa_bus, NULL, pci_bus);
/* Network card */
network_init();
......
......@@ -165,6 +165,7 @@ void mips_r4k_init (ram_addr_t ram_size,
ResetData *reset_info;
int i;
qemu_irq *i8259;
ISABus *isa_bus;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
DriveInfo *dinfo;
int be;
......@@ -256,36 +257,36 @@ void mips_r4k_init (ram_addr_t ram_size,
cpu_mips_clock_init(env);
/* The PIC is attached to the MIPS CPU INT0 pin */
isa_bus_new(NULL, get_system_io());
i8259 = i8259_init(env->irq[2]);
isa_bus_irqs(i8259);
isa_bus = isa_bus_new(NULL, get_system_io());
i8259 = i8259_init(isa_bus, env->irq[2]);
isa_bus_irqs(isa_bus, i8259);
rtc_init(2000, NULL);
rtc_init(isa_bus, 2000, NULL);
/* Register 64 KB of ISA IO space at 0x14000000 */
isa_mmio_init(0x14000000, 0x00010000);
isa_mem_base = 0x10000000;
pit = pit_init(0x40, 0);
pit = pit_init(isa_bus, 0x40, 0);
for(i = 0; i < MAX_SERIAL_PORTS; i++) {
if (serial_hds[i]) {
serial_isa_init(i, serial_hds[i]);
serial_isa_init(isa_bus, i, serial_hds[i]);
}
}
isa_vga_init();
isa_vga_init(isa_bus);
if (nd_table[0].vlan)
isa_ne2000_init(0x300, 9, &nd_table[0]);
isa_ne2000_init(isa_bus, 0x300, 9, &nd_table[0]);
ide_drive_get(hd, MAX_IDE_BUS);
for(i = 0; i < MAX_IDE_BUS; i++)
isa_ide_init(ide_iobase[i], ide_iobase2[i], ide_irq[i],
isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i], ide_irq[i],
hd[MAX_IDE_DEVS * i],
hd[MAX_IDE_DEVS * i + 1]);
isa_create_simple("i8042");
isa_create_simple(isa_bus, "i8042");
}
static QEMUMachine mips_machine = {
......
......@@ -34,7 +34,8 @@ typedef struct M48t59State M48t59State;
void m48t59_write (void *private, uint32_t addr, uint32_t val);
uint32_t m48t59_read (void *private, uint32_t addr);
void m48t59_toggle_lock (void *private, int lock);
M48t59State *m48t59_init_isa(uint32_t io_base, uint16_t size, int type);
M48t59State *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
int type);
</