From: Matthew Mastracci <matt@aclaro.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Using ISA-PNP for resource management
Date: Sun, 09 May 2004 17:13:00 -0600 [thread overview]
Message-ID: <1084144380.6742.31.camel@matt> (raw)
I was looking at how much work it would take to switch to using ISA-PNP
for resource management. I believe that it might simplify some of the
QEMU internals, as well as make things like having multiple
network/other devices much easier. It may make moving to PCI (or having
an option to boot with either ISAPNP or PCI on the fly) much easier.
For anyone interested, the ISAPNP spec page is at:
http://osdev.neopages.net/docs/PNP-ISA-v1.0a.pdf?the_id=54
I believe the best way to implement ISA-PNP would be for each device to
register an ISA-PNP context, then add specific resource requirements to
the context as necessary. The ISAPNP manager would then interact with
the operating system and call the isapnp_configure method whenever the
OS changes the setup.
Perhaps something like this. I would imagine that the ISAPNP resource
manager would clear the IO port range back to the default IO port
manager before calling the *_isapnp_configure routine:
static void ne2000_isapnp_configure(void* opaque, ISAPNPContext *c)
{
/* Get the first IO port as the base IO address */
int base = isapnp_get_ioport(c, 0);
register_ioport_write(base, 16, 1, ne2000_ioport_write, s);
register_ioport_read(base, 16, 1, ne2000_ioport_read, s);
register_ioport_write(base + 0x10, 1, 1, ne2000_asic_ioport_write,
s);
register_ioport_read(base + 0x10, 1, 1, ne2000_asic_ioport_read, s);
register_ioport_write(base + 0x10, 2, 2, ne2000_asic_ioport_write,
s);
register_ioport_read(base + 0x10, 2, 2, ne2000_asic_ioport_read, s);
register_ioport_write(base + 0x1f, 1, 1, ne2000_reset_ioport_write,
s);
register_ioport_read(base + 0x1f, 1, 1, ne2000_reset_ioport_read,
s);
s->irq = isapnp_get_irq(c, 0);
/* Perhaps this would happen below... (?) */
ne2000_reset();
}
void ne2000_init(int base, int irq, NetDriverState *nd)
{
ISAPNPContext *c;
/* KTC2000 is an ISAPNP vendor ID for an NE2000 compatible card */
/* No serial number specified here, ISAPNP manager can autogenerate
it */
c = isapnp_create_context("KTC", 2000, ne2000_isapnp_configure, s);
/* Need an edge-triggered IRQ, default is irq */
isapnp_register_irq(IRQ_MODE_EDGE, irq);
/* Need a block of 32 IO ports, default is base */
isapnp_register_ioport(32, base);
}
--
Matthew Mastracci <matt@aclaro.com>
next reply other threads:[~2004-05-09 23:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-09 23:13 Matthew Mastracci [this message]
2004-05-10 18:34 ` [Qemu-devel] Using ISA-PNP for resource management Fabrice Bellard
2004-05-10 21:31 ` [Qemu-devel] " Matthew Mastracci
2004-05-10 18:57 ` Matthew Mastracci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1084144380.6742.31.camel@matt \
--to=matt@aclaro.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).