kobj multiple inheritance

M. Warner Losh imp at bsdimp.com
Tue Sep 23 14:15:34 PDT 2003


In message: <1064305850.68463.67.camel at herring.nlsystems.com>
            Doug Rabson <dfr at nlsystems.com> writes:
: Hmm. Some kind of SYSINIT-driven ivar index allocator, perhaps?

I've logn thought this is an excellent idea.  Have a 32 bit name
space.  16 allocated to an interface and 16 that are private to that
interface.  That should be plenty of bits, and the read/write ivar
routines would still be simple.  Hide it behind a macro, and it
doesn't matter the sizes.

You'd change:

	switch (which) {
	case PCI_IVAR_ETHADDR:
	...
	}

to

	if (IVAR_SELECTOR(which) != pci_ivar)
		return (EIO);	 /* or pass it on? */
	switch (IVAR_PRIVATE(which))
	{
	case PCI_IVAR_ETHADDR:
	...
	}

Which isn't burdonsome at all.  If you have more than 65,000
interfaces in the system, then you have bigger issues :-)

Warner


More information about the freebsd-arch mailing list