tsearch.3: Clarify node vs. key and improve markup
Pull in clarifications from Apple's libc: describe the comparison
function's arguments as key pointers, refer to the nodes returned by
tfind() and tsearch() rather than to the "datum", explain how to get a
node's key, note that the action function is called only once for leaf
nodes, and note about how VISIT names don't map to the usual traversal
order nomenclature.
The paragraph about the first member of a node being a pointer to its
key was rewritten, as Apple's wording was not strictly accurate.
Apple's Libc also has a paragraph describing what each traversal order
does, but it is mostly redundant, so it is not included here.
While here, mark up NULL and the VISIT values with .Dv, move the VISIT
typedef into a literal block, and fix mandoc lint warnings.
MFC after: 3 days
[4 lines not shown]
tsearch.3: Fix tdestroy(3) entries in NAME and SYNOPSIS
Add tdestroy to the NAME section, remove a stray opening parenthesis
from its node_free argument in the SYNOPSIS, and small grammar fix in
STANDARDS.
Fixes: b0d4b059cf84 ("tdestroy(3) man page")
MFC after: 3 days
Sponsored by: Klara, Inc.
mpr(4)/mps(4): Fix build on 32-bit platforms
bus_addr_t is 32-bit on armv7, so >> 32 triggers -Wshift-count-overflow.
Widen it to uint64_t before shifting, as the other high-address writes
in the same files.
Fixes: 866760ff8338 ("mps(4): add support for hostboot")
Sponsored by: The FreeBSD Foundation
misc/py-claude-agent-sdk: Update to 0.2.184
A permission update that lacks a field now raises instead of being sent
half filled, and one bad update in a reply drops them all, which is what
Claude Code does with them anyway.
Changelog: https://github.com/anthropics/claude-agent-sdk-python/releases/tag/v0.2.184
Sponsored by: Netzkommune GmbH
databases/libdrizzle: drop the fused-madd flag on powerpc
The client library does not do floating point arithmetic, so there is
nothing for the compiler to contract and the flag changes nothing in
what gets built. Drop the branch instead of carrying a replacement for
an option clang does not know.
Sponsored by: Netzkommune GmbH
sound: Hold the topology lock across the remaining registration checks
sysctl_dev_pcm_bitperfect(), sysctl_dev_pcm_eq() and
sysctl_dev_pcm_eq_preamp() check PCM_REGISTERED() and then busy the
device with nothing held in between, so pcm_unregister() can run and
destroy the sx before PCM_ACQUIRE() takes it. These sysctls are
registered in the device's newbus context, so they outlive
pcm_unregister().
Hold the topology lock across the check and the busy, as the other
handlers do.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61224
sound: Fix a LOR between AIOGCAP and SNDCTL_DSP_SYNCGROUP
AIOGCAP locks a dsp_cdevpriv's record channel and then its play channel,
while dsp_oss_syncgroup() locked them the other way round. Verified the
LOR and deadlock by exercising both paths using a duplex FD
concurrently.
Lock the record channel first in dsp_oss_syncgroup() too, and document
the order in sound.h.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60519
sound: Busy the device in mixer_oss_mixerinfo()
Rather than hold the topology lock across the whole handler, which
blocks detach of every device in the system, busy the one being selected
and used, and drop the topology lock, as the other SNDCTL_*INFO handlers
do.
The mutex now covers only the mixer fields. mixer->cdev is set once in
mixer_init() and never cleared, so reading does not need the lock.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60518
sound: Retire PCM_LOCK in sound_oss_card_info()
The handler reads the device name, its description and the status
string. All three are set before pcm_register() makes the device
visible, and never change afterwards. The topology lock, which is held
across the whole function, makes sure the device is not freed.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60515
sound: Busy the device in SNDCTL_DSP_GETCAPS
The handler read the device flags under PCM_LOCK, but those flags are
written while holding the device busy, so busy it instead.
The CHN_F_VIRTUAL checks do not need a lock. The flag is set once in
vchan_init() when the channel is created and never cleared.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60514
sound: Protect channels.pcm.opened with the sx alone
This list is initialized in pcm_init() and only accessed by dsp_open()
and dsp_close(), and we are under sx already, so the PCM_LOCK does not
add anything.
PCM_LOCK is also held around playcount/reccount reads, which are also
under sx now.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60513
sound: Stop taking PCM_LOCK to create and destroy channels
chn_init() and chn_kill() took PCM_LOCK around the channel lists and the
per-direction counts, so that readers which cannot sleep could inspect
them. There are none left anymore, so drop it. The few remaining
unlocked readers never took the mutex in the first place.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60512
sound: Busy the device in sysctl_dev_pcm_mode()
PCM_LOCK does not keep the device alive, so it does not protect this
handler racing with pcm_unregister(). The sysctl is registered in the
device's newbus context which outlives pcm_unregister().
Busy the device instead, as the other handlers do, and hold the topology
lock across the registration check so that the device cannot start
detaching between the check and the busy.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60509