Re: [RFC] An idea for general kernel post-processing automation in FreeBSD
Date: Sun, 21 May 2023 23:07:52 UTC
On May 21, 2023, at 15:18, Hans Petter Selasky <hps@selasky.org> wrote: > On 5/21/23 23:24, Mark Millard wrote: >> DEFINE_MUTEX is defined in: >> # grep -r "define.*DEFINE_MUTEX"/usr/main-src/sys/ | more >> /usr/main-src/sys/compat/linuxkpi/common/include/linux/mutex.h:#define DEFINE_MUTEX(lock) > > Hi Mark, > > The mutex structure declared is still "static" and local to the C-file. There is no issue. In the C language standard, the original had a status of "no linkage" and "static storage duration". ("a block scope identifier for an object declared without the storage-class specifier extern" leads to the "no linkage" status.) The change still has "static storage duration" but now has "internal linkage" status instead. I'm being cautious about the distinction. (I'm looking at ISO/IEC 9899:2011 (E).) I've had trouble identifying the match of your wordings to the language standard, leaving me unsure of the interpretation to give your wording. I've yet to figure out why internal linkage could end up being required, given how the language specifies things. > If we could have a SX_STATIC_INIT() macro in FreeBSD, this would be a better solution, and would also save the crunch associated by SYSINITs. The LinuxKPI does not use Witness on these locks, because Linux has a bad habit of not destroying them, so FreeBSD Witness objects would leak and cause other problems when modules are reloaded for example. If witness is not needed, there is little use from sx_init(). It almost does nothing. > === Mark Millard marklmi at yahoo.com