Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2018 23:51:33 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r328985 - head/sys/dev/usb/template
Message-ID:  <43ece2af-5259-554e-c5f1-6fd947b587eb@selasky.org>
In-Reply-To: <2147494.gDNdGGi869@ralph.baldwin.cx>
References:  <201802071846.w17Ik894055491@repo.freebsd.org> <2147494.gDNdGGi869@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02/07/18 23:25, John Baldwin wrote:
> 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().
> 

It can be fixed either way. Feel free to fix the SYSINIT KSHIM macros. 
You can test by running make in stand/usb/test .

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43ece2af-5259-554e-c5f1-6fd947b587eb>