Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 1995 22:33:02 +0100 (MET)
From:      hm@altona.hamburg.com (Hellmuth Michaelis)
To:        dennis@etinc.com (dennis)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: LKM: how to fiddle in interrupt routine ptrs ?
Message-ID:  <m0swyfW-000013C@ernie.altona.hamburg.com>
In-Reply-To: <199509241538.LAA27363@etinc.com> from "dennis" at Sep 24, 95 11:38:44 am

next in thread | previous in thread | raw e-mail | index | archive | help
>From the keyboard of dennis:

> >>Is there a generic or recommended way or example of installing a device's
> >>interrupt routine at mod-loading a device driver LKM time ?
> >
> >See pcibus.c:pcibus_ihandler_attach/detach.
> >
> >There are some minor problems with these routines:
[...]
> >- it isn't possible to give a correect device_id.  0 is for clkintr.
> >  The device_id is only used for counting interrupts.  To fix this
> >  you would have to expand the string table in vector.s and edit it.

It seems to be almost impossible to give it, NR_DEVICES is a constant
computed by config, it must be made a variable.

> >>What is the way to tell the driver at mod-load time it's IRQ and i/o addr ?
> >
> >There is no way.

There should be a way to make this usable.

> This method is not good and requires some thought. In the big picture, one of 
> the most useful purposes of modules is the ability to add devices without having
> to recompile the kernel. If I have to install dummy drivers I've lost my
> need to use modules.

Right, but someone has to implement it.

It seems that some work is necessary on the device driver lkm model to make
it fully work: there must be a way to specify a device driver interrupt
handler, the hardware interrupt to use and a i/o and memory address (range).

For me it looks like certain constants are computed at compile time rather
than runtime, and depending on this constants some kernel tables are sized.
This has to change, there should be a fixed size table (filled with dummies
for nonexistent devices) for all possible interrupts which will be filled
with the respective entries by mod-loading a driver.

Also, it is unclear what should happen with the probe and attach routines.

hellmuth
-- 
Hellmuth Michaelis           hm@altona.hamburg.com              Hamburg, Europe
                                              (A)bort, (R)etry, (I)nstall BSD ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0swyfW-000013C>