Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 May 2023 16:07:52 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        freebsd-arch <freebsd-arch@freebsd.org>
Subject:   Re: [RFC] An idea for general kernel post-processing automation in FreeBSD
Message-ID:  <B8217B6F-DA83-4F90-B87B-37E3397237B2@yahoo.com>
In-Reply-To: <6293f06b-927f-432a-3911-808b1d99441b@selasky.org>
References:  <2EDDC5DC-81C2-4EB8-B729-66F03A8854E4.ref@yahoo.com> <2EDDC5DC-81C2-4EB8-B729-66F03A8854E4@yahoo.com> <6293f06b-927f-432a-3911-808b1d99441b@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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)
>=20
> Hi Mark,
>=20
> 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.
>=20


=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B8217B6F-DA83-4F90-B87B-37E3397237B2>