futex(2): Fix return value of FUTEX_CMP_REQUEUE.
The return value is the number of waiters woken _or requeued_, not
just the number of waiters woken:
FUTEX_CMP_REQUEUE
Returns the total number of waiters that were woken up or
requeued to the futex for the futex word at uaddr2. If
this value is greater than val, then the difference is the
number of waiters requeued to the futex for the futex word
at uaddr2.
https://man7.org/linux/man-pages/man2/futex.2.html
While here, clarify some of the arguments with comments so it's not
quite so cryptic with val/val2/val3 everywhere.
PR kern/56828: futex calls in Linux emulation sometimes hang
futex(2): Fix FUTEX_CMP_REQUEUE to always compare even if no waiters.
It must always compare the futex value and fail with EAGAIN on
mismatch, even if there are no waiters.
FUTEX_CMP_REQUEUE (since Linux 2.6.7)
This operation first checks whether the location uaddr
still contains the value val3. If not, the operation
fails with the error EAGAIN. Otherwise, the operation [...]
https://man7.org/linux/man-pages/man2/futex.2.html
PR kern/56828: futex calls in Linux emulation sometimes hang
tests/lib/libc/sys/t_futex_ops: Fix FUTEX_CMP_REQUEUE return values.
The return value is the number of waiters woken _or requeued_, not
just the number of waiters woken:
FUTEX_CMP_REQUEUE
Returns the total number of waiters that were woken up or
requeued to the futex for the futex word at uaddr2. If
this value is greater than val, then the difference is the
number of waiters requeued to the futex for the futex word
at uaddr2.
https://man7.org/linux/man-pages/man2/futex.2.html
PR kern/56828: futex calls in Linux emulation sometimes hang
tests/lib/libc/sys/t_futex_ops: Test FUTEX_CMP_REQUEUE edge case.
It must always compare the futex value and fail with EAGAIN on
mismatch, even if there are no waiters.
PR kern/56828: futex calls in Linux emulation sometimes hang
Pull up following revision(s) (requested by uwe in ticket #1040):
share/man/man5/services.5: revision 1.11
usr.sbin/services_mkdb/services_mkdb.8: revision 1.13
services(5): consistently refer to the cdb database
While here, fix a few markup nits.
sdmmc: Capture lan_nid and expose sdmmc_cisptr
LAN NID contains the MAC address for networking adapters.
Device drivers may want to processor vendor specific tuple codes, so
expose sdmmc_cisptr to help this.
risc-v: Don't attach the JH7110 ISP clock controller
Something isn't quite right with the ISP clock controller and it causes
problems with sysctl -A. As it's not currently used don't attach it.
partly prepare for more than 2-level CPU speed scheduler support
put the calls behind looking at SPCF_IDLE and SPCF_1STCLASS mostly
behind functions that can grow support for more than 2 CPU classes.
4 new functions, with 2 of them just simple aliases for the 1st:
bool cpu_is_type(struct cpu_info *ci, int wanted);
bool cpu_is_idle_1stclass(struct cpu_info *ci)
bool cpu_is_1stclass(struct cpu_info *ci)
bool cpu_is_better(struct cpu_info *ci1, struct cpu_info *ci2);
with this in place, we can retain the desire to run on 1st-class by
preference, while also expanding cpu_is_better() to handle multiple
non 1st-class CPUs. ultimately, i envision seeing a priority number
where we can mark the fastest turbo-speed cores ahead of others, for
the case we can detect this.
XXX: use struct schedstate_percpu instead of cpu_info?
NFCI.