Allocate state for the FPU emulator on the kernel stack rather than as
static globals. Normally we wouldn't want to allocate this much on the
stack, but the emulator is only for user-space code, so the kernel stack
will have been idle when the F-line trap occurred; the only things on
the stack at this point are the trap frame and the small number of call
frames required to get us here.
This prevents concurrent FPU emuations from colliding with each other.
This is something that could happen when e.g. two FP-using programs are
running concurrently on a system under memory pressure and one of them
blocks during an emulation to service a page fault.
The alternatives are less than ideal: we either have to dynamically
allocate memory or wrap the emulator in a mutex.
Similarly, change __fpu_logn() and __fpu_modrem() to place their
temporaries on the stack, as well.
Problem reported by Romain Dolbeau on port-m68k.
Don't proceed with undefined results in the face of memory access
errors in the FPU emulator:
- fpu_load_ea() / fpu_store_ea(): if copyin() / copyout() return non-zero,
return SIGSEGV.
Catch some callers of fpu_load_ea() and fpu_store_ea() that were ignoring
the return value:
- fpu_emul_arith() / fpu_emul_fscale(): Pay attention to the return value
of fpu_load_ea().
- fpu_emul_fstore(): Pay attention to the return value of fpu_store_ea().
Problem reported by Romain Dolbeau on port-m68k.
secmodel.9: update some details in code examples
Back in 2009, refactoring changed where certain functionality is
located, but the examples in this man page weren't updated to match.
Avoid filename trucation of paths > NAME_MAX, change it to PATH_MAX and
detect truncation and beep (completion) or print an error message (save)
(Kilian Feess)
Fix cpu_{get,set}mcontext() vis a vis FP state in the presence of
FPU_NONE+FPU_EMULATE. Previously, the emulated 68881 registers,
which are present in the PCB, were completely ignored becaue fputype
is FPU_NONE in that case.
This fix entails a few things:
- In fpu_emulate(), when we've reached the point where we know an
FPU instruction is going to be performed, set the PCB's copy of
the FP frame to indicate an "idle" state. This sets the stage
for normal FPU handling code to use the saved emulator state
just as it would with a real FPU.
- In fpu_init(), if we set FPU_NONE, also initialize m68k_cached_fpu_idle_frame
to mimic an idle 68881 idle frame so that the _UC_FPU+_UC_M68K_UC_USER
case in cpu_setmcontext() works correctly.
- In cpu_{get,set}mcontext(), always use the saved FP registers in the
PCB, and only interact with the FPU if fputype != FPU_NONE and curlwp.
While here, simplify the construction of the FPFRAME_IS_NULL() expression.
Problem reported by Romain Dolbeau on port-m68k.
powerpc: oea: downgrade "failed to allocate DEAD ZONE" log to debug
0xDEA[CDE]xxxx may not exist on the platform, so no need to map them away.
Downgrade the log message to a debug message since it's not fatal.
texinfo: build makedoc as a host tool in src/tools
makedoc is necessary to generate files for info(1) and infokey(1)
and it was built in src/external/gpl2/texinfo/makedoc with config.h
prepared for the target NetBSD hosts, but it's really confusing.
Additional install rules is based on tools/Makefile.host and
afterinstall ordering follows tools/groff/Makefile.
Tested 'build.sh -U -m amd64 release' on ubuntu 26.04 with GCC 15.
natto.debug isn't installed, just atto.debug
Remove natto.debug for now, until someone works out the correct
atto Makefile magic to install it as a link, but only when MKDEBUG is
set.
Pull up the following, requested by kre in ticket #1408:
external/public-domain/tz/dist/Makefile up to 1.8
external/public-domain/tz/dist/NEWS up to 1.11
external/public-domain/tz/dist/TZDATA_VERSION up to 1.49
external/public-domain/tz/dist/africa up to 1.5
external/public-domain/tz/dist/backzone up to 1.7
external/public-domain/tz/dist/europe up to 1.7
external/public-domain/tz/dist/leapseconds up to 1.13
external/public-domain/tz/dist/leapseconds.awk up to 1.1.1.16
external/public-domain/tz/dist/northamerica up to 1.10
external/public-domain/tz/dist/southamerica up to 1.7
external/public-domain/tz/dist/theory.html up to 1.9
external/public-domain/tz/dist/version up to 1.22
external/public-domain/tz/dist/zone.tab up to 1.8
external/public-domain/tz/dist/zone1970.tab up to 1.9
external/public-domain/tz/dist/zonenow.tab up to 1.10
doc/3RDPARTY (apply patch)
Updated tzdata to version 2026f (using 2026fgtz).