* DISTDIR_IS_UNIONFS is set every time BSDINSTALL_DISTDIR is mounted inside
BSDINSTALL_CHROOT. Use this flag to decide if it needs to be umounted
* BSDINSTALL_CHROOT/dev is mounted when 'bsdinstall mount' is called, there is
no need to mount it again when user goes to shell after installation
Reviewed by: allanjude
Obtained from: pfSense
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D8573
using the ACPI C1/mwait sleep method.
Previously, the mwait instruction would return when an interrupt was
pending; however, the idle loop did not actually enable interrupts when
this occurred. This led to a situation where the idle loop could quickly
spin through the C1/mwait sleep method a number of times when an interrupt
was pending. (Eventually, the situation corrected itself when something
other than an interrupt triggered the idle loop to either enable interrupts
or schedule another thread.)
Reviewed by: kib, imp (earlier version)
Input from: jhb
MFC after: 1 week
Sponsored by: Netflix
Fix bugs found by Coverity in efipart.c.
The Issue is that efi_devpath_last_node() can return NULL pointer, and
therefore we should check for it. In real life we really do not
expect to see it to happen, so we will just error out from the test.
CID: 1371004
Reported by: Coverity
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D9490
The primary end-goal of this drop is ease future merges with NetBSD and
collaborate further with the NetBSD project.
The goal was (largely, not completely as some items are still oustanding
in the NetBSD GNATS system) achieved by doing the following:
- Pushing as many changes required to port contrib/netbsd-tests
back to NetBSD as possible, then pull the upstream applied changes
back in to FreeBSD.
- Diff reduce with upstream where possible by:
-- Improving libnetbsd header, etc compat glue.
-- Using _SED variables to modify test scripts on the fly for items
that could not be upstreamed to NetBSD.
As a bonus for this work, this change also introduces testcases for
uniq(1).
Many thanks to Christos for working with me to get many of the changes
back into the NetBSD project.
In collaboration with: Christos Zoulas <christos@netbsd.org>
MFC after: 1 month
Sponsored by: Dell EMC Isilon
The 1s delay was added in the update to version 16 fw, where Family 8000
support was added.
Obtained from: DragonflyBSD commit bb480ca679a7ea530bdca6e41082d5755e9751dc
* Add the command groups enum, and the iwm_phy_ops_subcmd_ids enum
to if_iwmreg.h definitions.
* The IWM_DTS_MEASUREMENT_NOTIF_WIDE notification will be generated by
version 17 firmware.
Taken-From: Linux iwlwifi
Obtained from: DragonflyBSD commit 4d8d6f9def2ffb60aaf2d88f72f069a96c0b4e3f
* Adds IWM_DEBUG_TEMP debug message type, for printing messages related
to temperature sensors and thermal/TDP infos.
* The firmware regularly sends us DTS measurement notifications, so just
print the temperature value as a debugging message.
(Adrian's addition):
* Eventually this can be used by the driver to limit transmit rate / power to
try and do some thermal throttling.
Obtained from: DragonflyBSD commit efb7d4eb5c3140889a8880e12fd83c7bbfd0059d
* Add iwm_pcie_set_cmd_in_flight() and iwm_pcie_clear_cmd_in_flight()
helper methods.
* Use ring->queued tracking in the command queue to set/clear the
cmd_hold_nic_awake bit at the right points.
Taken-From: Linux iwlwifi
Obtained from: DragonflyBSD commit ce43f57f5308b579ea21e8a5a29969114ba2247d
* Add IWM_FLAG_SCAN_RUNNING to sc->sc_flags to track whether the firmware
is currently running a scan, in order to decide wheter iwm_scan_end
needs to abort a running scan.
* In iwm_scan_end, if the scan is still running, we now abort it, in order
to keep the firmware scanning state in sync.
* Try to make things a bit simpler, by reacting on the
IWM_SCAN_OFFLOAD_COMPLETE and IWM_SCAN_COMPLETE_UMAC notifications,
instead of IWM_SCAN_ITERATION_COMPLETE and
IWM_SCAN_ITERATION_COMPLETE_UMAC. This should be fine since we always
only tell the firmware to do a single scan iteration anyway.
Obtained from: DragonflyBSD commit 1f249c981c4e89e7cde1836a75b61cac36dc7ac5
* Uses the notification wait api to wait for the corresponding scan
complete notification after sending the abort command.
Taken-From: Linux iwlwifi
Obtained from: DragonflyBSD commit b484d09d54301740f036ddf02008117f563960c2
* This also fixes one of many small nic lock handling bugs, and matches
iwlwifi's code.
Obtained from: DragonflyBSD git 50787d03cd0a0366c9cc4a055bb6977e5f65c85d
FreeBSD uses the full target triple when generating embedded rootfs images
(MFS_IMAGE= make option). Without this change objcopy errors out with:
objcopy: elf64-poewrpc-freebsd: invalid target name
MFC after: 2 weeks
Don't start switcher kproc until the first GEOM is created.
Reviewed by: pjd
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8576
In the kernel, cache the machine and flags fields from ELF header to use in
the ELF header of a core dump. For gcore, the copy these fields over from
the ELF header in the binary.
This matters for platforms which encode ABI information in the flags field
(such as o32 vs n32 on MIPS).
Reviewed by: kib
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D9392
In the end, dealing with fparseln was more bikeshed worthy than I
anticipated, and polling stdio.h with libutil.h caused me more
grief than necessary. Keeping the compat header around for no
reason other than include_next'ing the stdio.h header in FreeBSD
makes no sense.
This change is being made to diff reduce/reduce duplication in
contrib/netbsd-tests and to facilitate further porting of software from
NetBSD
Add the following headers:
- sys/event.h:
-- sys/types.h is required for kqueue on FreeBSD, but not NetBSD.
- sys/types.h:
-- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD.
Pull in sys/param.h to have parity with NetBSD.
- sys/wait.h:
-- Define wrusage as __wrusage for parity with NetBSD typedef.
- glob.h
-- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef.
- pthread.h:
-- Pull in pthread_np.h for _np functions defined separately on FreeBSD.
Improve compatibility with NetBSD in the following headers:
- sha1.h:
-- define SHA1_CTX as SHA_CTX
-- define SHA1Final as SHA1_Final
- sha2.h:
-- #include sha384 to pick up all of the SHA 384 bit macros and definitions.
- util.h:
-- Add sys/types.h to util.h to pollute the header for types used in
flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them
for the functions.
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
If multiple threads emit a UDP log_in_vain message concurrently,
the IP addresses could be garbage due to concurrent usage of a
single string buffer inside inet_ntoa(). Use inet_ntoa_r() with
two stack buffers instead.
Reported by: Mark Martinec <Mark.Martinec+freebsd@ijs.si>
MFC after: 3 days
Relnotes: yes
Sponsored by: Dell EMC
There are some potential issues with the test (as brd@ has pointed out
elsewhere) with precision, etc not being set before the test, but as
always, more research is required.
YYINT on FreeBSD is int, not short
I'll work with the upstream maintainer or come up with a build
method of modifying their definitions on install instead of
having to modify tests to match our forked YYINT definition.
PR: 216891
Sponsored by: Dell EMC Isilon
The S_ISREG check was restored, such that the code will again fail with
in-place replacements on symlinks
MFC after: 12 days
X-MFC with: r313277
Sponsored by: Dell EMC Isilon
Previous implementation would use a random factor to spread readers and
reduce chances of starvation. This visibly reduces effectiveness of the
mechanism.
Switch to the more traditional exponential variant. Try to limit starvation
by imposing an upper limit of spins after which spinning is half of what
other threads get. Note the mechanism is turned off by default.
Reviewed by: kib (previous version)