tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Inter-driver #if dependencies



On Mon, 18 May 2015, Masao Uebayashi wrote:

On Mon, May 18, 2015 at 7:40 AM, Paul Goyette <paul%vps1.whooppee.com@localhost> wrote:
My crusade for modularity has arrived at the pcppi(4) driver, and I've
discovered that there are a number of places in the code where a #if is used
to determine whether or not some _other_ driver is available to provide
certain routines.  For pcppi(4), these dependencies are for the attimer(4)
and pckbd(4) drivers.  (While I haven't yet gone searching, I'd be willing
to wager that there are other similar examples in other drivers.)

How about:

- making pcppi(4) provide the new pcppibus(4), and
- making attimer(4) and pckbd(4) attach at pcppibus(4)

A couple of issues with this approach:


	* pckbd already attaches at an unrelated parent, pckbc
	* attimer can attach currently at acpi, as well as at isa


The real problem here is that these other drivers, whether they're children of pcppi or of something else, are optional. And their very presence, whether or not any instance is actually configured, (and without regard to where they are attached) changes the behavior of pcppi.


Side note: I'm still trying to figure out how a usb keyboard can make use of the sysbeep device! It seems to be hooked up only to the pckbc, so unclear how (or even if) a system with usb keyboard can beep!


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index