Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jul 2003 16:39:46 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        phk@phk.freebsd.dk
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/lnc if_lnc.c 
Message-ID:  <20030722.163946.94245610.imp@bsdimp.com>
In-Reply-To: <15673.1058910014@critter.freebsd.dk>
References:  <20030722.151828.83724752.imp@bsdimp.com> <15673.1058910014@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <15673.1058910014@critter.freebsd.dk>
            "Poul-Henning Kamp" <phk@phk.freebsd.dk> writes:
: In message <20030722.151828.83724752.imp@bsdimp.com>, "M. Warner Losh" writes:
: 
: >There's one other place that we use inlining.  We use it to make sure
: >that modules do not contain references to certain symbols.  For
: >example:
: >
: >/*
: > * make this inline so that we don't have to worry about dangling references
: > * to it in the modules or the code.
: > */
: >static __inline const struct pccard_product *
: >pccard_product_lookup(device_t dev, const struct pccard_product *tab,
: >    size_t ent_size, pccard_product_match_fn matchfn)
: >{
: >	return CARD_DO_PRODUCT_LOOKUP(device_get_parent(dev), dev,
: >	    tab, ent_size, matchfn);
: >}
: >
: >We do this to get the type safty of the function call and not have to
: >make that a macro.  We do *NOT* want references to
: >pccard_product_lookup, but the CARD_DO_.. kobj call allows the
: >indirection that makes it possible to use the same module in kernels
: >with and without pccard support.
: 
: I would argue that this should be solved by giving non-pccard kernels
: a stub function which returns whatever error is logical (NULL in this
: case ?) rather than abusing either of macros or inlines.

There's no convenient way to do that, to be honest.  Easy to say, hard
to do.  And you need it for pci, eisa, isa and other things.  And it
doesn't let you then load pccard after boot.  I don't think it is a
viable solution.

Warner



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