isa: allow the ISA PnP isolation scan to be skipped
The scan probes several read-data ports, each running the full
isolation protocol with mandatory DELAY()s; with no PnP cards present
it finds nothing yet costs several seconds of boot time. Add a
hw.isa.pnp_disabled tunable (default 0) so systems known to have no
ISA PnP hardware - virtual machines in particular - can skip it.
NetBSD skips its isapnp probe automatically when SMBIOS slot tables
report no ISA slots, but that data is absent on typical VMs (and
NetBSD/OpenBSD do not compile ISA PnP into amd64 kernels at all), so
an explicit tunable serves the VM case better.
sys/kern: make the interrupt-config-hook settle delay tunable
After the interrupt-driven config hooks have finished, the kernel
lingers for a hardcoded 5 seconds before proceeding to the root mount,
to give USB a chance to enumerate (else a USB root device might not be
seen). On systems that cannot boot from USB - virtual machines in
particular - this is 5 seconds of pure boot-time waste.
Replace the hardcoded 5*hz with a kern.intr_config_hook_delay_ms
tunable (default 5000, preserving current behavior).
virtio_mmio(4): Add a manual page for the virtio-mmio transport driver
Document the legacy (v1) virtio-mmio transport and, in particular, the
hw.virtio.mmio.device[_N] kenv variables it uses for device discovery
and their <size>@<baseaddr>:<irq>[:<unit>] grammar.
virtual: virtio-mmio (legacy v1) transport driver
Import and x86-adapt FreeBSD's virtio-mmio transport driver.
The driver speaks the legacy (v1) virtio-mmio register layout and
discovers devices from the "hw.virtio.mmio.device" kenv
(<size>@<base>:<irq>[:<unit>]) rather than FDT/ACPI, attaching on
nexus.
Reviewed-by: @ivadasz
sys/kern: Replace vfs.root.wakedelay with millisecond-based wakedelay_ms
The seconds-based vfs.root.wakedelay tunable is too coarse for non-CAM
kern confs that only need a short settle delay before mounting root.
Replace it with vfs.root.wakedelay_ms, which specifies the delay in
milliseconds and defaults to 2000 (the previous 2 second default).
Update loader.8 and loader.conf accordingly.
apple_smc: add thermal governor and PROCHOT override
When the SMC asserts PROCHOT# due to disconnected sensors or absent
battery, the driver now detects this at attach, clears BD_PROCHOT in
MSR 0x1FC, and takes over fan control from the SMC failsafe. A kernel
thread implements a linear fan curve between configurable temperature
thresholds with hysteresis and rate-limited ramp-down.
New sysctls expose scheduled wake time (CLWK), S5 power-on timer
(G3AO/G3WD), AC wake delay (AUWT), display brightness (DPBR),
chassis state (ENV0), and software thermal throttle disable (STFD).
The raw key interface is no longer gated behind APPLE_SMC_DEBUG.
Temperature description table expanded to ~170 entries.
reboot(8): Fix openlog(3) calls
LOG_CONS was OR'd into the facility argument instead of logopt, leaving
logopt as 0. The correct call is openlog(ident, LOG_CONS, LOG_AUTH),
as shutdown(8) and init(8) already do.
Signed-off-by: Ricardo Branco <rbranco at suse.de>
GitHub-PR: #37
reboot(8): Fix openlog(3) calls
LOG_CONS was OR'd into the facility argument instead of logopt, leaving
logopt as 0. The correct call is openlog(ident, LOG_CONS, LOG_AUTH),
as shutdown(8) and init(8) already do.
Signed-off-by: Ricardo Branco <rbranco at suse.de>
GitHub-PR: #37
libthread_xu: Link with '-z nodelete'; unloading it is unsafe
Loading libthread_xu has irreversible process-wide effects:
* rtld lazily rebinds libc weak pthread stubs (e.g. _spinlock) to
the strong definitions in this library. There is no mechanism to
undo GOT bindings on dlclose(), so after an unload libc keeps
calling into the unmapped region.
* __isthreaded stays set -- the library cannot prove that no other
threads exist, so it cannot safely clear it -- which keeps the
libc malloc on the locked path through the dangling _spinlock
pointer.
* _thr_signal_init() installs signal handlers pointing into the
library, and _thr_signal_deinit() is empty, so signal delivery
after an unload also jumps into unmapped memory.
Consequently a program that dlopen()s a dependency chain pulling in
[42 lines not shown]
contrib/bmake: Adjust documentation of our custom variables
* Improve the markup styles a bit.
* Move the postition to the end of bmake builtin variables.
make(1): Refactor Makefile
* Include ${srcdir}/VERSION for _MAKE_VERSION instead of hardcoding it.
* Clean up CFLAGS; remove unused ones.
* Move a few variables from CFLAGS to COPTS.main.c where they're only
used.
* Remove other obsolete COPTS.*.
make(1): Undefine USE_EMALLOC to avoid libutil dependency
With USE_EMALLOC undefined, util.h becomes unused and thus remove it.
This improves the zrj's commit ee2cba8aae8c6b2ce0b6c6fc150e61c1736c64e8.
make(1): Directly install vendor's make.1
The vendor's bmake.1 man page intends for the portable bmake
distribution. So just install the vendor's make.1 instead of using
bmake.1.
contrib/bmake: Remove obsolete custom variable '.MAKE.BUILT.BY'
This custom variable was initially added in commit 673bdc16bff3eec8 to
help resolve a C++ ABI change between gcc47 and gcc50. Since the
removal of gcc47 (commit 0f44b32a8fb34e5f), this variable became
obsolete and unused.
vendor/bmake: Add back LICENSE and VERSION
* Keep LICENSE for vendor software, keeping consistent with other vendor
softwares.
* VERSION can be included in the Makefile to avoid hardcoding the
version there.
kernel/apple_ir: Add Apple IR receiver driver.
USB HID driver for Apple IR receivers found in Mac computers
(2006-2011 era). Uses the u4b USB stack with interrupt transfers
and delivers key events through evdev.
Supports Apple Remote (proprietary 5-byte protocol) and generic NEC
IR remotes. Synthetic key-up events are generated via a 125ms callout
since the hardware sends no release reports.
Add UQ_HID_IGNORE quirks for all Apple IR receiver product IDs so
uhid(4) does not claim the device first. DragonFly's newbus probe
short-circuits on a 0 return, so the quirk is necessary to prevent
uhid's class-wide HID match from winning.
kernel/apple_smc: Table-drive sysctl registration and collapse duplicate handlers.
Replace fanminspeed/fanmaxspeed/fantargetspeed with single fanrw handler
using key index packed in arg2 bits [15:8]. Collapse sms_x/y/z, light
left/right, and mssd/mssp wrappers into table-indexed handlers. Table-drive
per-fan and system-state sysctl registration loops.
hammer2: factor out directory mtime update in vnops
Add hammer2_update_dir_mtime() for the repeated mtime/ctime update
pattern used after directory-modifying operations. Easier to maintain
and document in one place.