What's the use of this anyway, it doesn't affect QEMU in any way? Scratch space?
> +static int init_test_device(ISADevice *isa)
> +{
> + struct testdev *dev = DO_UPCAST(struct testdev, dev, isa);
> + int iomem;
> +
> + register_ioport_write(0xf1, 1, 1, test_device_serial_write, dev);
> + register_ioport_write(0xf4, 1, 4, test_device_exit, dev);
> + register_ioport_read(0xd1, 1, 4, test_device_memsize_read, dev);
> + register_ioport_read(0xe0, 1, 1, test_device_ioport_read, dev);
> + register_ioport_write(0xe0, 1, 1, test_device_ioport_write, dev);
> + register_ioport_read(0xe0, 1, 2, test_device_ioport_read, dev);
> + register_ioport_write(0xe0, 1, 2, test_device_ioport_write, dev);
> + register_ioport_read(0xe0, 1, 4, test_device_ioport_read, dev);
> + register_ioport_write(0xe0, 1, 4, test_device_ioport_write, dev);
> + register_ioport_write(0xe4, 1, 4, test_device_flush_page, dev);
> + register_ioport_write(0x2000, 24, 1, test_device_irq_line, NULL);
24? Doesn't ISA have only 16? Enums for all constants would be more readable.
> + iomem_buf = g_malloc0(0x10000);
> + iomem = cpu_register_io_memory(test_iomem_read, test_iomem_write, NULL,
> + DEVICE_NATIVE_ENDIAN);
> + cpu_register_physical_memory(0xff000000, 0x10000, iomem);
Devices may not map themselves, this should be done at board level.
Doesn't this address also conflict with PCI for PC?