warning and continuing is not good enough. Change the warning to
an error (and hence immediate exit) instead, that's all we can do.
Problem pointed out by tlaronde@polynum.com
XXX - pullup -10 (others?)
Not sure this is actually forbidden by the C standard. There may be
bugs lurking here, but OpenSSL uses this extensively, so let's just
get the build going again.
This is now distinct from pthread__smt_pause, which is for spin lock
backoff with no paired wakeup.
On Arm, there is a single-bit event register per CPU, and there are two
instructions to manage it:
- wfe, wait for event -- if event register is clear, enter low power
mode and wait until event register is set; then exit low power mode
and clear event register
- sev, signal event -- sets event register on all CPUs (other
circumstances like interrupts also set the event register and cause
wfe to wake)
These can be used to reduce the power consumption of spinning for a
lock, but only if they are actually paired -- if there's no sev, wfe
might hang indefinitely. Currently only pthread_spin(3) actually
pairs them; the other lock primitives (internal lock, mutex, rwlock)
do not -- they have spin lock backoff loops, but no corresponding
wakeup to cancel a wfe.
It may be worthwhile to teach the other lock primitives to pair
wfe/sev, but that requires some performance measurement to verify
it's actually worthwhile. So for now, we just make sure not to use
wfe when there's no sev, and keep everything else the same -- this
should fix severe performance degredation in libpthread on Arm
without hurting anything else.
No change in the generated code on amd64 and i386. No change in the
generated code for pthread_spin.c on arm and aarch64 -- changes only
the generated code for pthread_lock.c, pthread_mutex.c, and
pthread_rwlock.c, as intended.
PR port-arm/57437
XXX pullup-10
No functional change intended -- just safer to do it this way in case
the macros are used in if branches or comma expressions.
PR port-arm/57437 (pthread__smt_pause/wake issue)
XXX pullup-10
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.
So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.
May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.
Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.
autoconf relies upon GNU m4 emacs-style regexs, which
don't support intervals so don't escape these.
A fix to usr.bin/m4 -g (GNU m4 emulation) is incoming.
We've been instructed to lose confidence in existing entropy sources,
so let's make sure to re-gather enough entropy before the next
consolidation can happen, in case some of what would be counted in
consolidation is from those entropy sources.
XXX pullup-10
and then checks for an "arm,cortex-a9-twd-timer" compatible entry in the
fdt. If not present, create one so that a9ptmr will attach.
We need this entry as this is the only timer we support for this platform,
but the upstream imx6sx.dtsi is missing the entry for it (and all A9 CPUs
have it anyway).
Thanks to Jared McNeill for advices and review.
These were only used on PDP-11 for two programs we don't ship,
and have been obsolete since the VAX days.
xstr never worked in the build.sh cross-build environment (22 years), or
parallel make environment (nearly 28 years), didn't work in the orignal 386bsd
import, and has never been needed in NetBSD as we don't have the older BSD
programs (pascal, pre-nvi ex) that needed mkstr/xstr on PDP-11.
PR toolchain/35964
Hasn't worked for at least 20 years (and never in the cross-build environment,
nor did it work with parallel make), and has never been needed in NetBSD as we
don't have the older BSD programs (pascal, pre-nvi ex) that needed mkstr/xstr
on PDP-11.
PR toolchain/35964
Can't KASSERT(datasize <= databufsize) because the caller is allowed
to pass in a too-small size and get ERR_BUFFER_TOO_SMALL back, with
the actual size returned so it can resize its buffer. So just clamp
the size to the smaller of what the caller provided and what the
firwmare provided, instead of asserting anything.
PR kern/57076
XXX pullup-10
Add local fix to AC_FUNC_ALLOCA() to include <stdlib.h> on BSD:
# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
# include <stdlib.h>
This change avoids regen losing this change in tools/compat/configure
that was added in rev 1.75 on 2013-03-05 of tools/compat/configure,
and subsequent commits that keep re-adding these lines back
manually (e.g., rev 1.97 on 2019-06-22 of tools/compat/configure)
XXX: Arguably this could be fixed in a separate way to allow us to
use an unmodified modern autoconf in the future ?
Use dispatch_semaphore_create() if present instead of sem_init().
macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).
This was detected by the previous commit to ctfmerge
that added error handling.
Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).
Update tools/compat/configure.ac to find dispatch_semaphore_create().
Fixes ctfmerge on macOS hosts.
Inspired by https://stackoverflow.com/a/27847103.
terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).
Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:
ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented
The lexer's responsibility is to generate tokens, it's not supposed to
update the parser state. Centralize the state transitions that control
indentation of enum constants to keep the lexer code clean.
Skip comments, newlines and preprocessing lines when updating the parser
state for enum constants and for '*' in declarations.
The paragraphs separate the different processing steps: getting a token
from the lexer, processing the token, updating the parser state, sending
a finished line to the output.
like in config_attach_pseudo, this assertion almost certainly
indicates real bugs, but let's try to get the tests back and running
again before addressing those.