DragonFlyBSD/src 6cc80eeshare/man/man4 apple_ir.4, sys/bus/u4b usbdevs

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.
DeltaFile
+486-0sys/dev/apple/ir/appleir.c
+113-0share/man/man4/apple_ir.4
+7-0sys/dev/apple/ir/Makefile
+5-0sys/bus/u4b/usbdevs
+5-0sys/bus/u4b/quirk/usb_quirk.c
+3-0sys/config/LINT64
+619-03 files not shown
+622-19 files

DragonFlyBSD/src 1c14b2dshare/man/man4 apple_smc.4 apple_fw.4

kernel/apple_{fw,smc}: Add manual pages.
DeltaFile
+304-0share/man/man4/apple_smc.4
+70-0share/man/man4/apple_fw.4
+2-0share/man/man4/Makefile
+376-03 files

DragonFlyBSD/src e75e2fdsys/dev/apple/smc smc.c smc_sysctl.c

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.
DeltaFile
+125-108sys/dev/apple/smc/smc.c
+55-81sys/dev/apple/smc/smc_sysctl.c
+4-10sys/dev/apple/smc/smc.h
+184-1993 files

DragonFlyBSD/src 09c0ca0sys/vfs/hammer2 hammer2_vnops.c

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.
DeltaFile
+29-81sys/vfs/hammer2/hammer2_vnops.c
+29-811 files

DragonFlyBSD/src 077f781sys/vfs/hammer hammer_blockmap.c

hammer: factor out blockmap layer CRC verification

Add hammer_verify_layer1_crc() and hammer_verify_layer2_crc() helpers
for the double-check-under-lock CRC pattern used across all blockmap
functions. Easier to maintain and document in one place.
DeltaFile
+40-95sys/vfs/hammer/hammer_blockmap.c
+40-951 files

DragonFlyBSD/src 2e3a87cusr.bin/crunch/crunchgen crunched_main.c

crunchgen(1): Fix program sorting bug in cmpstringp()

I mistakenly introduced the bug in the previous commit
73dce941a522281d4f4fcbf07d038bc8b4be4031 where I tried to fix the
compilation warnings.
DeltaFile
+3-1usr.bin/crunch/crunchgen/crunched_main.c
+3-11 files

DragonFlyBSD/src acc3713sbin/fdisk fdisk.c

fdisk(1): Fix a style issue in print_s0()
DeltaFile
+4-2sbin/fdisk/fdisk.c
+4-21 files

DragonFlyBSD/src 669d88fcontrib/awk README.DRAGONFLY README.DELETED

contrib/awk: Update README.DRAGONFLY and README.DELETED
DeltaFile
+7-3contrib/awk/README.DRAGONFLY
+2-1contrib/awk/README.DELETED
+9-42 files

DragonFlyBSD/src cae19fdcontrib/awk FIXES.1e FIXES

Merge branch 'vendor/AWK'

Upgrade AWK from 20240122 to 20260426.
DeltaFile
+0-1,429contrib/awk/FIXES.1e
+0-108contrib/awk/FIXES
+60-35contrib/awk/b.c
+34-14contrib/awk/main.c
+24-16contrib/awk/run.c
+12-10contrib/awk/tran.c
+130-1,6125 files not shown
+138-1,63011 files

DragonFlyBSD/src b56f30cusr.bin/awk/awk Makefile, usr.bin/awk/maketab Makefile

awk(1): Clean up makefiles
DeltaFile
+0-5usr.bin/awk/maketab/Makefile
+1-1usr.bin/awk/awk/Makefile
+1-62 files

DragonFlyBSD/src b1be7b9contrib/awk FIXES.1e FIXES

vendor/awk: Upgrade from 20240122 to 20260426
DeltaFile
+0-1,429contrib/awk/FIXES.1e
+0-108contrib/awk/FIXES
+60-35contrib/awk/b.c
+34-14contrib/awk/main.c
+24-16contrib/awk/run.c
+12-10contrib/awk/tran.c
+130-1,6125 files not shown
+138-1,63011 files

DragonFlyBSD/src 1e057a0usr.bin/awk/awk Makefile

awk(1): Override FOPEN_MAX to handle 64 open files instead of 20

Awk uses a fixed array of size FOPEN_MAX to track the open files, so it
could only open max 20 files as the default FOPEN_MAX is defined to be
20 in <stdio.h>.  Override FOPEN_MAX to 64 to support more open files.

Obtained-from: FreeBSD (commit d97cdd33492f5afe2150e1fced657c9a31911c67)
DeltaFile
+1-1usr.bin/awk/awk/Makefile
+1-11 files

DragonFlyBSD/src 56f761dinitrd/rescue Makefile, initrd/rescue.libcrypto Makefile

bsd.crunchgen.mk: Include <bsd.init.mk>

This will include "../Makefile.inc" where CRUNCH_* are defined.
DeltaFile
+0-3initrd/rescue.libcrypto/Makefile
+0-3initrd/rescue/Makefile
+1-1share/mk/bsd.crunchgen.mk
+1-73 files

DragonFlyBSD/src b1c60d0initrd/rescue Makefile, initrd/rescue.libcrypto Makefile

bsd.crunchgen.mk: Pass CFLAGS to "make exe" to enable WARNS

The "make exe" phase builds the stub objects and the final crunched
executable.  Because the crunchgen(1) generated makefile does not
include any makefile from the system, the ${CFLAGS} was empty and the
${WARNS} tunable was ineffective.

By explicitly passing the ${CFLAGS} to the "make exe" phase, the ${WARNS}
is correctly accounted in the main Makefile (that includes
<bsd.crunchgen.mk>) and works as expected.

The "make objs" that builds the objects of each individual tool to be
crunched is not affected.  Those objects are already built with their
corresponding ${WARNS} and ${CFLAGS}.

As we're explicitly setting the ${CFLAGS}, filter the LTO flags in
<bsd.crunchgen.mk> and thus revert the previous commit
a3f29142615c9b60b7f2d6c4eecbf55e595d778b.


    [6 lines not shown]
DeltaFile
+0-5usr.bin/crunch/crunchgen/crunchgen.c
+4-0initrd/rescue/Makefile
+4-0initrd/rescue.libcrypto/Makefile
+1-0share/mk/bsd.crunchgen.mk
+9-54 files

DragonFlyBSD/src 9d10863usr.bin/crunch/crunchgen crunchgen.c

crunchgen(1): Remove the hardcoded 'strip' command

The binary will be stripped by install(1) during the installation phase.
DeltaFile
+0-1usr.bin/crunch/crunchgen/crunchgen.c
+0-11 files

DragonFlyBSD/src 73dce94usr.bin/crunch/crunchgen crunched_main.c

crunchgen(1): Fix compilation warnings (prepare for future update)

Fix the following compilation warnings when we enable WARNS for
initrd/{rescue,rescue.libcrypto} build in the future:

```
rescue.c: In function 'cmpstringp':
rescue.c:88:20: error: cast discards 'const' qualifier from pointer target type [-Werror=cast-qual]
  const char *s1 = *(const char **)p1;
                    ^
rescue.c:89:20: error: cast discards 'const' qualifier from pointer target type [-Werror=cast-qual]
  const char *s2 = *(const char **)p2;
                    ^
rescue.c: In function 'crunched_usage':
rescue.c:96:1: error: old-style function definition [-Werror=old-style-definition]
 crunched_usage()
 ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

    [2 lines not shown]
DeltaFile
+3-4usr.bin/crunch/crunchgen/crunched_main.c
+3-41 files

DragonFlyBSD/src b38721cusr.bin/uname uname.c uname.1

uname(1): Add '-b' flag to show the kernel's build-ID

The kernel's build-ID has been exposed via the "kern.build_id" sysctl
MIB.  Add a '-b' flag to uname(1) to report it.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D20511)
DeltaFile
+14-2usr.bin/uname/uname.c
+4-3usr.bin/uname/uname.1
+18-52 files

DragonFlyBSD/src f188159sys/conf kern.pre.mk

kern.pre.mk: Introduce ${ELDFLAGS} to help customize linker flags

Similar to the case in kmod.mk, introduce the ${ELDFLAGS} variable to
collect the linker flags and makes it easier to customize them.

While there, clean up a bit.
DeltaFile
+14-18sys/conf/kern.pre.mk
+14-181 files

DragonFlyBSD/src 1c40f14sys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Remove obsolete '.exception_ranges' from linker scripts

As the comment says, it was generate by the Sun/Oracle C++ compiler,
so does not apply to us.  Just remove it as FreeBSD did.

See also: FreeBSD
DeltaFile
+1-6sys/platform/pc64/conf/ldscript.x86_64
+1-6sys/platform/vkernel64/conf/ldscript.x86_64
+2-122 files

DragonFlyBSD/src 30fd908stand/boot/common load_elf.c

stand: Fix compilation error with ELF_VERBOSE in load_elf.c
DeltaFile
+1-1stand/boot/common/load_elf.c
+1-11 files

DragonFlyBSD/src 5b50f07usr.bin/uname uname.c

uname(1): Improve sysctl()/sysctlbyname() error report

Report the sysctl MIB name/path when it fails.

Meanwhile, clean up the style a bit.
DeltaFile
+28-31usr.bin/uname/uname.c
+28-311 files

DragonFlyBSD/src 4e67623sys/kern kern_mib.c, sys/platform/pc64/conf ldscript.x86_64

kernel: Expose the build-ID via "kern.build_id" sysctl

Update the linker scripts to expose the start and end of the
linker-generated build-ID, and add the "kern.build_id" sysctl handler to
fetch the information.

A subsequent commit will update uname(1) to report it as well.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D20326)
DeltaFile
+44-0sys/kern/kern_mib.c
+5-1sys/platform/pc64/conf/ldscript.x86_64
+5-1sys/platform/vkernel64/conf/ldscript.x86_64
+54-23 files

DragonFlyBSD/src 6597598stand/boot/common load_elf.c load_elf_obj.c

stand: Replace the cumbersome "x" __XSTRING() "y" with '__func__'
DeltaFile
+15-17stand/boot/common/load_elf.c
+9-17stand/boot/common/load_elf_obj.c
+24-342 files

DragonFlyBSD/src 8f67eb8sys/conf kmod.mk

kmod.mk: Style cleanups
DeltaFile
+21-23sys/conf/kmod.mk
+21-231 files

DragonFlyBSD/src e83617asys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Use INT3 instead of NOP for x86 binary padding

We should never end up executing the inter-function padding, so we
are better off faulting than silently carrying on to whatever function
happens to be next.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D10047)
DeltaFile
+3-3sys/platform/pc64/conf/ldscript.x86_64
+3-3sys/platform/vkernel64/conf/ldscript.x86_64
+6-62 files

DragonFlyBSD/src 11da405stand/boot/common reloc_elf.c load_elf.c

stand: Remove obsolete 'FREEBSD_ELF' define

The last use of it was removed from <link.h> back in 2002 in FreeBSD, so
it never affected DragonFly.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D42964)
DeltaFile
+0-3stand/boot/common/reloc_elf.c
+0-1stand/boot/common/load_elf.c
+0-1stand/boot/common/load_elf_obj.c
+0-53 files

DragonFlyBSD/src c487de2sys/conf kmod.mk kern.pre.mk

kernel: Enable --build-id=sha1 for kernel and module link

See also: FreeBSD (https://reviews.freebsd.org/D11314)
DeltaFile
+2-0sys/conf/kmod.mk
+2-0sys/conf/kern.pre.mk
+4-02 files

DragonFlyBSD/src ffa7f09sys/conf debuginfo.ldscript kern.pre.mk, sys/platform/pc64/conf ldscript.x86_64

platform: Move debug sections to a common linker script

In addition, sync the debug sections with FreeBSD's to add DWARF 4 and 5.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D44071)
DeltaFile
+41-0sys/conf/debuginfo.ldscript
+4-36sys/platform/vkernel64/conf/ldscript.x86_64
+4-36sys/platform/pc64/conf/ldscript.x86_64
+1-1sys/conf/kern.pre.mk
+50-734 files

DragonFlyBSD/src aec7479sys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Remove .ldata/.lrodata/.lbss sections from ldscript

The kernel is compiled with '-mcmodel=kernel', so the compiler never
emits the large model sections (e.g., .ldata/.lrodata/.lbss).  Therefore,
remove such sections from the kernel linker scripts.

This change has another major benefit: the '.bss' section now correctly
lies at the end, so the linker does not need to allocate real file space
to store the BSS section.  As a result, the kernel file size is reduced
by 14MB (e.g., stripped kernel reduces from 29MB to 15MB)!  Meanwhile,
the following gold linker warning is also fixed:
```
/usr/libexec/binutils234/elf/ld.gold: warning: script places BSS section in the middle of a LOAD segment; space will be allocated in the file
```

See also: FreeBSD (https://reviews.freebsd.org/D21859)
DeltaFile
+0-20sys/platform/pc64/conf/ldscript.x86_64
+0-20sys/platform/vkernel64/conf/ldscript.x86_64
+0-402 files

DragonFlyBSD/src 8a3c573sys/platform/pc64/conf ldscript.x86_64, sys/platform/vkernel64/conf ldscript.x86_64

platform: Remove wrong comment from ldscript

The comment 'default linker script' was copied from the GNU ld's default
linker script, and is obviously wrong for the kernel, so just remove it.
DeltaFile
+1-3sys/platform/vkernel64/conf/ldscript.x86_64
+1-3sys/platform/pc64/conf/ldscript.x86_64
+2-62 files