Date: Mon, 24 Apr 1995 11:41:05 -0700 (PDT) From: Julian Elischer <julian@ref.tfs.com> To: matt@lkg.dec.com (Matt Thomas) Cc: bde@zeta.org.au, phk@ref.tfs.com, hackers@FreeBSD.org Subject: Re: [EISA] related matters Message-ID: <199504241841.LAA02129@ref.tfs.com> In-Reply-To: <199504241144.LAA02851@whydos.lkg.dec.com> from "Matt Thomas" at Apr 24, 95 11:44:20 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > > >It has always had me wondering why >I< had to tell config about spl-levels... > > > > >What we really should have is a TEXT_SET(device_probe...) and kill config... > > > > No linker magic is required or good. Drivers should register their > > interrupt masking requirements as late as possible, preferably not > > until open() completes. > > Not every device has an open routine (like network interfaces). > > There should be two steps: the first is registration (allow a driver to > indicate that it will use an IRQ) to detect conflicts, the second is the > actual enabling of the interrupt handler. > > BSD/OS actually has done this in a manner which is quite nice. There are > no interrupt handlers defined in the config file. Every driver must register > their interrupt handler in their attach routine. This is what MACH does. > > You can almost achieve the same thing in FreeBSD by setting id->id_intr in > the attach routine. The problem is that the irq class is not so easily set > in the driver (because of having isa_devtab_xxx in ioconf.c; it would be > nicer if the isa_device structure had a id_class field which would be used > to register the approriate interrupt handler). This is what I was pushing for in the first place. > > Right now, my new-improved DECPA driver needs the following config file line > on FreeBSD: > > device di0 at isa? net irq ? > > The "net irq ?" is required so it's put into the right device table. Under > BSD/OS, all I need is: > > di0 at isa? > > > I looked for other things that could be config'ed better in GENERIC: > > > > isa? config at attach time or later > > vector config when intr is attached > > iosiz config at attach time after probe decides it? > > > > These things can't always (never for isa) be config'ed later because > > probing likely addresses is too dangerous: > > > > port, iomem > > The routines to check for port and mem conflicts need to generalized so > they can be called from drivers probe routines. Note that BSD/OS contains > routine to do such checks: > > int isa_portcheck(isa_ioport_t start, size_t size); > int isa_memcheck(isa_physaddr_t start, size_t size); > > This allow driver to check over various port ranges without being > accidentally stomped. This is really important for loadable drivers. > > > These things can't always be config'ed later because probing is unreliable: > > > > irq, drq > > The IRQ services in FreeBSD are definitely inferior to BSD/OS. BSD/OS > supports shared interrupts for all interrupts (not specific to PCI as > in FreeBSD). Some routines that FreeBSD could use are: > > isa_irqmask_t isa_irqalloc(isa_irqmask_t irqs); > isa_irqmask_t isa_forceintr(int (*forceintr)(void *arg)); > > isa_irqalloc takes a set of irqs (IRQ%|IRQ9|...) and returns the highest > IRQ not currently in use. isa_forceintr will call a routine to force an > interrupt and then return which IRQ was signalled. > > I've never used DRQs so I can't say what's needed for them. > > Modifying my drivers to run under both FreeBSD and BSD/OS has been very > enlightening. Some things BSD/OS does better while FreeBSD does better at > other things. > > That's my two pence worth, I must say I like what BSD/OS has done.. it's even better than MACH and OSF/1-386 which does all that stuff except for the forceintr stuff. > julian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504241841.LAA02129>
