sound: Start each channel individually
Unlock all members before starting any of them. Holding multiple channel
locks while calling chn_start() on a virtual channel can trigger the
parent, which acquires PCM_LOCK() while other virtual channels are still
locked -- a lock order reversal.
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D57399
kern_linker.c: re-apply some more bits from db887713de2bf5
The definition of the EXTERR_CATEGORY symbol in the .c file is needed
for the script to regenerate identical context of
gen/exterr_cat_filenames.h.
Sponsored by: The FreeBSD Foundation
acpi: Constify acpi_stype_to_sstate() and some users
Reviewed by: obiwac
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57413
acpi: Move supported states arrays into the softc
This is done in preparation of having some machine-dependent code access
these arrays through the softc.
Before this change, these arrays were static. We chose to make them
part of the softc, instead of just exporting them ('acpi_quirks' remains
a known offender; some better way forward is to declare the whole ACPI
softc as static).
Some sysctl handlers now need to be passed the softc to access the
arrays, and some already needed to be passed a pointer to a field in the
softc. As sysctl handlers are provided with a single pointer (arg1) and
a single integer (arg2), and now that the softc has to be passed into
the pointer argument (arg1), point indirectly to the wanted softc's
field by passing its offset in the integer argument (arg2).
To preserve the statically sized array in the signature of
power_pm_register(), and consequently avoid constructing such a dummy
[11 lines not shown]
acpi: Fix panic when reading 'hw.acpi.suspend_state' knob on S1/S2
The 'hw.acpi.suspend_state' sysctl knob was re-introduced with a bug.
Its handler, acpi_suspend_state_sysctl(), expects the ACPI softc in
'arg1', but the knob was registered with NULL there. This causes
a panic (NULL dereference) when reading the knob if the suspend state
has been set to S1 or S2 or equivalently the suspend sleep type to
STANDBY.
Fix it by passing the ACPI softc as 'arg1' when registering the knob.
Reviewed by: obiwac
Fixes: 9e1e29bd5ec6 ("acpi: Add back `hw.acpi.suspend_state` sysctl")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57412
sh: Improve function documentation
* Mention that the function body can be in parentheses. It is already
implied since the function body can be any valid statement, but it may
not be obvious to a reader who has only ever seen functions that used
curly brackets and assumes that they are part of the function syntax.
* Remove the incorrect claim that a local statement may only occur at
the top of a function.
* Show that a value may be assigned to a variable in a local statement.
* While here, replace unpaired double quotes with \(dq to avoid
confusing syntax highlighters.
PR: 296050
MFC after: 1 week
Reviewed by: ziaee, jilles
Differential Revision: https://reviews.freebsd.org/D57596
pfctl: pfctl_get_astats() doesn't set errno
After commit 08f54dfca197 pfctl_get_astats() doesn't set errno anymore,
except in one place. Fix up that one place and adjust callers
appropriately.
Reviewed by: kp
Fixes: 08f54dfca197 ("pf: convert DIOCRGETASTATS to netlink")
Differential Revision: https://reviews.freebsd.org/D57608
ping6: fix outpack overflow in pattern fill loop
The fill loop was bounded by packlen, which is sized for the receive
buffer (datalen + IP6LEN + ICMP6ECHOLEN + EXTRA), not for outpack.
With large datalen the loop wrote past outpack[MAXPACKETLEN].
Bound it to the actual data area in outpack instead.
Reported by: Oculytic
Reviewed by: des, markj
Differential Revision: https://reviews.freebsd.org/D57441
Merge commit 93a67259cf23 from llvm git (by ShengYi Hung):
[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)
When the linker is specified as ld, toolchain applies special handling
by invoking (triple)-ld instead of resolving ld via standard PATH
lookup. This causes GNU ld installed via the system package manager to
take the precedence (since (triple)-ld appears earlier in the search
path), effectively overriding ld.lld.
As a result, we set the default Linker on FreeBSD to ld.lld to indicate
we want to use lld by default.
PR: 292067
MFC after: 3 days
(cherry picked from commit 2b619b7c7b5300cbaf59e4e9d75bc8472df014e9)
Merge commit 93a67259cf23 from llvm git (by ShengYi Hung):
[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)
When the linker is specified as ld, toolchain applies special handling
by invoking (triple)-ld instead of resolving ld via standard PATH
lookup. This causes GNU ld installed via the system package manager to
take the precedence (since (triple)-ld appears earlier in the search
path), effectively overriding ld.lld.
As a result, we set the default Linker on FreeBSD to ld.lld to indicate
we want to use lld by default.
PR: 292067
MFC after: 3 days
(cherry picked from commit 2b619b7c7b5300cbaf59e4e9d75bc8472df014e9)