svn commit: r215138 - in head/sys: net sys

Dimitry Andric dim at FreeBSD.org
Thu Nov 11 19:37:27 UTC 2010


On 2010-11-11 20:29, Andriy Gapon wrote:
> Do I understand it correctly that set_pcpu section itself would not be produced if
> DPCPU_DEFINE() is not actually used?

Yes, although currently this does not occur in any kernel module (I
tested using make universe).  But indeed, if you would include e.g.
vnet.h or pcpu.h, but did not use any VNET_DEFINE or DPCPU_DEFINE
macros, you would get an error during linking.

The proper fix for this is to use the __GLOBL macros only when actually
invoking the VNET_DEFINE or DPCPU_DEFINE macros, just as with the
__MAKE_SET macro.  But this is made more difficult by the fact that many
invocations of VNET_DEFINE and DPCPU_DEFINE are either prefixed with
'static', or postfixed with '= literal_value'.

Maybe we could use separate VNET_DEFINE_STATIC and DPCPU_DEFINE_STATIC
macros for this, since it looks like some of the definitions actually
define public variables...


More information about the svn-src-head mailing list