svn commit: r328985 - head/sys/dev/usb/template

John Baldwin jhb at freebsd.org
Wed Feb 7 22:26:31 UTC 2018


On Wednesday, February 07, 2018 06:46:08 PM Hans Petter Selasky wrote:
> Author: hselasky
> Date: Wed Feb  7 18:46:08 2018
> New Revision: 328985
> URL: https://svnweb.freebsd.org/changeset/base/328985
> 
> Log:
>   Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision
>   when building stand/usb. Regression after r328194.

This seems like a bug in the USB bits in stand instead.  In the kernel
SYSINIT and SYSUNINIT use separate namespace by appending different suffixes
to the first parameter:

        DATA_SET(sysinit_set,uniquifier ## _sys_init)

vs.

        DATA_SET(sysuninit_set,uniquifier ## _sys_uninit)

The bug is in stand/kshim/bsd_kernel.h:

#define SYSINIT(uniq, subs, order, _func, _data)        \
const struct sysinit UNIQ_NAME(sysinit_##uniq) = {      \
        .func = (_func),                                \
        .data = __DECONST(void *, _data)                \
};                                                      \
SYSINIT_ENTRY(uniq##_entry, "sysinit", (subs),          \
    (order), "const struct sysinit",                    \
    UNIQ_NAME_STR(sysinit_##uniq), "SYSINIT")

#define SYSUNINIT(uniq, subs, order, _func, _data)      \
const struct sysinit UNIQ_NAME(sysuninit_##uniq) = {    \
        .func = (_func),                                \
        .data = __DECONST(void *, _data)                \
};                                                      \
SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs),        \
    (order), "const struct sysuninit",                  \
    UNIQ_NAME_STR(sysuninit_##uniq), "SYSUNINIT")

This should be using uniq##_uninit_entry or some such for the first argument
to SYSINIT_ENTRY().

-- 
John Baldwin


More information about the svn-src-head mailing list