aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc112
-rw-r--r--ObsoleteFiles.inc3
-rw-r--r--RELNOTES10
-rw-r--r--UPDATING12
-rw-r--r--contrib/wpa/src/drivers/driver_bsd.c24
-rw-r--r--crypto/openssh/session.c5
-rw-r--r--etc/mtree/BSD.tests.dist2
-rw-r--r--include/fts.h28
-rw-r--r--kerberos5/lib/libasn1/Makefile2
-rw-r--r--kerberos5/lib/libgssapi_krb5/Makefile2
-rw-r--r--kerberos5/lib/libgssapi_ntlm/Makefile2
-rw-r--r--kerberos5/lib/libgssapi_spnego/Makefile2
-rw-r--r--kerberos5/lib/libhdb/Makefile2
-rw-r--r--kerberos5/lib/libheimbase/Makefile2
-rw-r--r--kerberos5/lib/libheimntlm/Makefile2
-rw-r--r--kerberos5/lib/libhx509/Makefile2
-rw-r--r--kerberos5/lib/libkadm5clnt/Makefile2
-rw-r--r--kerberos5/lib/libkadm5srv/Makefile2
-rw-r--r--kerberos5/lib/libkafs5/Makefile2
-rw-r--r--kerberos5/lib/libkdc/Makefile2
-rw-r--r--kerberos5/lib/libkrb5/Makefile2
-rw-r--r--kerberos5/lib/libwind/Makefile2
-rw-r--r--kerberos5/libexec/digest-service/Makefile2
-rw-r--r--kerberos5/libexec/hprop/Makefile2
-rw-r--r--kerberos5/libexec/hpropd/Makefile2
-rw-r--r--kerberos5/libexec/ipropd-master/Makefile2
-rw-r--r--kerberos5/libexec/ipropd-slave/Makefile2
-rw-r--r--kerberos5/libexec/kadmind/Makefile2
-rw-r--r--kerberos5/libexec/kcm/Makefile2
-rw-r--r--kerberos5/libexec/kdc/Makefile2
-rw-r--r--kerberos5/libexec/kpasswdd/Makefile2
-rw-r--r--kerberos5/usr.bin/kadmin/Makefile2
-rw-r--r--kerberos5/usr.bin/kpasswd/Makefile2
-rw-r--r--kerberos5/usr.sbin/iprop-log/Makefile2
-rw-r--r--kerberos5/usr.sbin/kstash/Makefile2
-rw-r--r--lib/clang/llvm.build.mk1
-rw-r--r--lib/lib80211/regdomain.xml254
-rw-r--r--lib/libc/gen/alarm.32
-rw-r--r--lib/libc/gen/fnmatch.38
-rw-r--r--lib/libc/gen/fnmatch.c227
-rw-r--r--lib/libc/gen/ualarm.32
-rw-r--r--lib/libc/locale/collate.c259
-rw-r--r--lib/libc/locale/collate.h11
-rw-r--r--lib/libc/net/Makefile.inc12
-rw-r--r--lib/libc/stdlib/atexit.c61
-rw-r--r--lib/libc/tests/gen/fnmatch_test.c81
-rw-r--r--lib/libc/tests/net/getaddrinfo/Makefile38
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/basics_v4.exp (renamed from lib/libc/tests/net/getaddrinfo/basics_v4.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/basics_v4_only.exp50
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/basics_v4v6.exp (renamed from lib/libc/tests/net/getaddrinfo/basics_v4v6.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/basics_v4v6_prefer_v4.exp50
-rwxr-xr-xlib/libc/tests/net/getaddrinfo/data/generate_testdata.sh45
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_host_v4.exp (renamed from lib/libc/tests/net/getaddrinfo/no_host_v4.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_host_v4_only.exp (renamed from lib/libc/tests/net/getaddrinfo/no_host_v4v6.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_host_v4v6.exp68
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_host_v4v6_prefer_v4.exp68
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_serv_v4.exp (renamed from lib/libc/tests/net/getaddrinfo/no_serv_v4.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_serv_v4_only.exp20
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_serv_v4v6.exp (renamed from lib/libc/tests/net/getaddrinfo/no_serv_v4v6.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/no_serv_v4v6_prefer_v4.exp20
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/scoped.exp (renamed from lib/libc/tests/net/getaddrinfo/scoped.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/scoped_v4_only.exp5
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/scoped_v4v6_prefer_v4.exp5
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/sock_raw_v4.exp (renamed from lib/libc/tests/net/getaddrinfo/sock_raw_v4.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/sock_raw_v4_only.exp15
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/sock_raw_v4v6.exp (renamed from lib/libc/tests/net/getaddrinfo/sock_raw_v4v6.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/sock_raw_v4v6_prefer_v4.exp15
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/spec_fam_v4.exp (renamed from lib/libc/tests/net/getaddrinfo/spec_fam_v4.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/spec_fam_v4_only.exp (renamed from lib/libc/tests/net/getaddrinfo/spec_fam_v4v6.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6.exp10
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6_prefer_v4.exp10
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/unsup_fam.exp (renamed from lib/libc/tests/net/getaddrinfo/unsup_fam.exp)0
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4_only.exp2
-rw-r--r--lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4v6_prefer_v4.exp2
-rwxr-xr-xlib/libc/tests/net/getaddrinfo/getaddrinfo_test.sh443
-rw-r--r--lib/libc/tests/stdlib/Makefile4
-rw-r--r--lib/libc/tests/stdlib/cxa_atexit_test.c132
-rw-r--r--lib/libc/tests/stdlib/libatexit/Makefile11
-rw-r--r--lib/libc/tests/stdlib/libatexit/libatexit.cc67
-rw-r--r--lib/libclang_rt/Makefile.inc1
-rw-r--r--lib/libcom_err/Makefile2
-rw-r--r--lib/libcxxrt/Makefile1
-rw-r--r--lib/libexpat/expat_config.h6
-rw-r--r--lib/libexpat/libbsdxml.34
-rw-r--r--lib/libgcc_eh/Makefile.inc1
-rw-r--r--lib/libomp/Makefile1
-rw-r--r--lib/libsys/fhopen.219
-rw-r--r--lib/libsys/statfs.28
-rw-r--r--lib/libutil/kinfo_getfile.c4
-rw-r--r--lib/ofed/libibnetdisc/Makefile1
-rw-r--r--libexec/atf/atf-pytest-wrapper/Makefile1
-rw-r--r--release/Makefile.inc19
-rw-r--r--release/Makefile.vm9
-rw-r--r--sbin/dhclient/dhclient.c50
-rw-r--r--sbin/dhclient/dhcpd.h4
-rw-r--r--sbin/dhclient/dispatch.c14
-rw-r--r--sbin/ifconfig/ifieee80211.c8
-rw-r--r--sbin/pfctl/parse.y17
-rw-r--r--sbin/pfctl/tests/files/pf1065.in1
-rw-r--r--sbin/pfctl/tests/files/pf1065.ok1
-rw-r--r--sbin/pfctl/tests/files/pf1066.in1
-rw-r--r--sbin/pfctl/tests/files/pf1066.ok1
-rw-r--r--sbin/pfctl/tests/files/pf1067.fail1
-rw-r--r--sbin/pfctl/tests/files/pf1067.in1
-rw-r--r--sbin/pfctl/tests/pfctl_test_list.inc3
-rw-r--r--sbin/reboot/boot_i386.86
-rw-r--r--sbin/reboot/reboot.83
-rw-r--r--share/doc/legal/Makefile1
-rw-r--r--share/doc/legal/intel_iwlwififw/Makefile5
-rw-r--r--share/man/man4/gve.436
-rw-r--r--share/man/man5/pf.conf.58
-rw-r--r--share/man/man7/arch.724
-rw-r--r--share/mk/bsd.sys.mk2
-rw-r--r--share/mk/googletest.test.inc.mk2
-rw-r--r--share/vt/keymaps/INDEX.keymaps3
-rw-r--r--share/vt/keymaps/br.lenovo.kbd160
-rw-r--r--stand/efi/Makefile.inc15
-rw-r--r--stand/efi/include/amd64/efibind.h22
-rw-r--r--stand/efi/include/amd64/pe.h6
-rw-r--r--stand/efi/include/arm64/efibind.h18
-rw-r--r--stand/efi/include/efi_nii.h2
-rw-r--r--stand/efi/include/efidebug.h12
-rw-r--r--stand/efi/include/efidef.h10
-rw-r--r--stand/efi/include/efidevp.h14
-rw-r--r--stand/efi/include/efifs.h2
-rw-r--r--stand/efi/include/efinet.h52
-rw-r--r--stand/efi/include/efipart.h6
-rw-r--r--stand/efi/include/efipciio.h259
-rw-r--r--stand/efi/include/efiprot.h10
-rw-r--r--stand/efi/include/efipxebc.h6
-rw-r--r--stand/efi/include/efirng.h4
-rw-r--r--stand/efi/include/efiser.h6
-rw-r--r--stand/efi/include/efiuga.h34
-rw-r--r--stand/efi/include/i386/efibind.h22
-rw-r--r--stand/efi/include/i386/pe.h14
-rw-r--r--stand/efi/include/riscv/efibind.h18
-rw-r--r--stand/efi/libefi/devpath.c2
-rw-r--r--stand/efi/libefi/efi_console.c12
-rw-r--r--stand/efi/libefi/eficom.c6
-rw-r--r--stand/efi/libefi/efinet.c6
-rw-r--r--stand/efi/libefi/time.c2
-rw-r--r--stand/efi/loader/arch/amd64/multiboot2.h4
-rw-r--r--stand/efi/loader/bootinfo.c2
-rw-r--r--stand/efi/loader/main.c2
-rw-r--r--stand/kboot/include/efi.h17
-rw-r--r--stand/kboot/include/seg.h24
-rw-r--r--stand/kboot/include/util.h10
-rw-r--r--stand/kboot/kboot/Makefile2
-rw-r--r--stand/kboot/kboot/arch/aarch64/load_addr.c89
-rw-r--r--stand/kboot/kboot/kboot.h23
-rw-r--r--stand/kboot/libkboot/Makefile14
-rw-r--r--stand/kboot/libkboot/efi.c97
-rw-r--r--stand/kboot/libkboot/seg.c (renamed from stand/kboot/kboot/seg.c)3
-rw-r--r--stand/kboot/libkboot/termios.c2
-rw-r--r--stand/kboot/libkboot/util.c (renamed from stand/kboot/kboot/util.c)2
-rw-r--r--stand/libsa/smbios.c1
-rw-r--r--sys/amd64/amd64/trap.c11
-rw-r--r--sys/amd64/vmm/amd/amdvi_hw.c39
-rw-r--r--sys/amd64/vmm/intel/vtd.c28
-rw-r--r--sys/amd64/vmm/io/iommu.c123
-rw-r--r--sys/amd64/vmm/io/iommu.h26
-rw-r--r--sys/amd64/vmm/io/ppt.c33
-rw-r--r--sys/amd64/vmm/vmm.c23
-rw-r--r--sys/arm/arm/machdep.c30
-rw-r--r--sys/arm/conf/std.qca2
-rw-r--r--sys/arm/include/metadata.h11
-rw-r--r--sys/arm/mv/armadaxp/armadaxp.c95
-rw-r--r--sys/arm/mv/armadaxp/armadaxp_mp.c1
-rw-r--r--sys/arm/mv/mv_armv7_machdep.c36
-rw-r--r--sys/arm/mv/mv_common.c114
-rw-r--r--sys/arm/mv/mvvar.h4
-rw-r--r--sys/arm/qualcomm/std.ipq401822
-rw-r--r--sys/arm64/acpica/acpi_iort.c4
-rw-r--r--sys/arm64/arm64/machdep.c24
-rw-r--r--sys/arm64/conf/std.qcom3
-rw-r--r--sys/arm64/include/metadata.h11
-rw-r--r--sys/arm64/iommu/smmu.c4
-rw-r--r--sys/compat/lindebugfs/lindebugfs.c115
-rw-r--r--sys/compat/linuxkpi/common/include/linux/acpi_amd_wbrf.h97
-rw-r--r--sys/compat/linuxkpi/common/include/linux/debugfs.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/fs.h5
-rw-r--r--sys/compat/linuxkpi/common/include/linux/highmem.h30
-rw-r--r--sys/compat/linuxkpi/common/include/linux/pci.h15
-rw-r--r--sys/compat/linuxkpi/common/include/linux/printk.h54
-rw-r--r--sys/compat/linuxkpi/common/include/linux/ref_tracker.h93
-rw-r--r--sys/compat/linuxkpi/common/include/linux/seq_file.h14
-rw-r--r--sys/compat/linuxkpi/common/include/linux/slab.h156
-rw-r--r--sys/compat/linuxkpi/common/include/linux/spinlock.h8
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sysfs.h116
-rw-r--r--sys/compat/linuxkpi/common/include/linux/workqueue.h6
-rw-r--r--sys/compat/linuxkpi/common/include/net/mac80211.h20
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c418
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.h21
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211_macops.c17
-rw-r--r--sys/compat/linuxkpi/common/src/linux_compat.c92
-rw-r--r--sys/compat/linuxkpi/common/src/linux_slab.c66
-rw-r--r--sys/conf/files137
-rw-r--r--sys/contrib/dev/acpica/changes.txt16
-rw-r--r--sys/contrib/dev/acpica/common/acfileio.c2
-rw-r--r--sys/contrib/dev/acpica/common/acgetline.c2
-rw-r--r--sys/contrib/dev/acpica/common/adfile.c2
-rw-r--r--sys/contrib/dev/acpica/common/adisasm.c4
-rw-r--r--sys/contrib/dev/acpica/common/adwalk.c2
-rw-r--r--sys/contrib/dev/acpica/common/ahids.c2
-rw-r--r--sys/contrib/dev/acpica/common/ahpredef.c2
-rw-r--r--sys/contrib/dev/acpica/common/ahtable.c4
-rw-r--r--sys/contrib/dev/acpica/common/ahuuids.c2
-rw-r--r--sys/contrib/dev/acpica/common/cmfsize.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmextern.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmrestag.c4
-rw-r--r--sys/contrib/dev/acpica/common/dmswitch.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmtable.c55
-rw-r--r--sys/contrib/dev/acpica/common/dmtables.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmtbdump.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmtbdump1.c235
-rw-r--r--sys/contrib/dev/acpica/common/dmtbdump2.c182
-rw-r--r--sys/contrib/dev/acpica/common/dmtbdump3.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmtbinfo.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmtbinfo1.c290
-rw-r--r--sys/contrib/dev/acpica/common/dmtbinfo2.c126
-rw-r--r--sys/contrib/dev/acpica/common/dmtbinfo3.c2
-rw-r--r--sys/contrib/dev/acpica/common/getopt.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslallocate.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslanalyze.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslascii.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslbtypes.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcache.c5
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcodegen.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompile.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.h2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcstyle.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/asldebug.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asldefine.h2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslerror.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslexternal.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfileio.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfiles.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfold.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslglobal.h2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslhelp.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslhelpers.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslhex.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslkeywords.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/asllength.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asllisting.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asllistsup.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslload.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asllookup.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmain.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmap.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmapenter.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmapoutput.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmaputils.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.h2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmethod.c8
-rw-r--r--sys/contrib/dev/acpica/compiler/aslnamesp.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asloffset.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopcodes.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asloperands.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopt.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asloptions.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslparseop.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpld.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpredef.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprepkg.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprimaries.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprintf.c6
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprune.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslresource.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslresources.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype1.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype1i.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2d.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2e.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2q.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2s.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2w.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrules.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslstartup.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslstubs.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/asltokens.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/asltransform.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asltree.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.h2
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslutils.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asluuid.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslwalks.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslxref.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslxrefout.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/cvcompiler.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/cvdisasm.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/cvparser.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompile.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompiler.h17
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompilerparser.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompilerparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtexpress.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtfield.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtio.c8
-rw-r--r--sys/contrib/dev/acpica/compiler/dtparser.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtsubtable.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable1.c517
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable2.c53
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.h267
-rw-r--r--sys/contrib/dev/acpica/compiler/dtutils.c21
-rw-r--r--sys/contrib/dev/acpica/compiler/preprocess.h2
-rw-r--r--sys/contrib/dev/acpica/compiler/prexpress.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/prmacros.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/prparser.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/prparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/prscan.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/prutils.c4
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbcmds.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbconvert.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbdisply.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbexec.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbfileio.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbhistry.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbinput.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbmethod.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbnames.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbobject.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbstats.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbtest.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmbuffer.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmcstyle.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmdeferred.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmnames.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmopcode.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrc.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcs.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmwalk.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsargs.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dscontrol.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsdebug.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsfield.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsinit.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsmethod.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsobject.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsopcode.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dspkginit.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswexec.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload2.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswscope.c2
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswstate.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evevent.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evglock.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpe.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeblk.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeinit.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeutil.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evhandler.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evmisc.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evregion.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evrgnini.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evsci.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfevnt.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfgpe.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfregn.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exconcat.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exconfig.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exconvrt.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/excreate.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdebug.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdump.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exfield.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exfldio.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exmisc.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exmutex.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exnames.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg1.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg2.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg3.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg6.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exprep.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exregion.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresnte.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresolv.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresop.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exserial.c8
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstore.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstoren.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstorob.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exsystem.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/extrace.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwacpi.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwesleep.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwgpe.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwpci.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwregs.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwsleep.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwtimer.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwvalid.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxfsleep.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsaccess.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsalloc.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsarguments.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsconvert.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsdump.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsdumpdv.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nseval.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsinit.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsload.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsnames.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsobject.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsparse.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nspredef.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsprepkg.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsrepair.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsrepair2.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nssearch.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nswalk.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfeval.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfname.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfobj.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psargs.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psloop.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psobject.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopcode.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopinfo.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psparse.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psscope.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/pstree.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/pswalk.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsaddr.c16
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscalc.c17
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscreate.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdump.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdumpinfo.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsinfo.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsio.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsirq.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rslist.c11
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsmemory.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsmisc.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsserial.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbdata.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbfadt.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbfind.c6
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbinstal.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbprint.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxfload.c2
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxfroot.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utaddress.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utalloc.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utascii.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utbuffer.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utcache.c6
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utcksum.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utcopy.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdebug.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdecode.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdelete.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uterror.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uteval.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utexcep.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utglobal.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uthex.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utids.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utinit.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utlock.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmath.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmisc.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmutex.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utnonansi.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utobject.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utosi.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utownerid.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utpredef.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utresdecode.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utresrc.c13
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstate.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstring.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstrsuppt.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstrtoul64.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uttrack.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utuuid.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxferror.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxfinit.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxfmutex.c2
-rw-r--r--sys/contrib/dev/acpica/include/acapps.h4
-rw-r--r--sys/contrib/dev/acpica/include/acbuffer.h2
-rw-r--r--sys/contrib/dev/acpica/include/acclib.h2
-rw-r--r--sys/contrib/dev/acpica/include/accommon.h2
-rw-r--r--sys/contrib/dev/acpica/include/acconfig.h2
-rw-r--r--sys/contrib/dev/acpica/include/acconvert.h2
-rw-r--r--sys/contrib/dev/acpica/include/acdebug.h4
-rw-r--r--sys/contrib/dev/acpica/include/acdisasm.h48
-rw-r--r--sys/contrib/dev/acpica/include/acdispat.h2
-rw-r--r--sys/contrib/dev/acpica/include/acevents.h2
-rw-r--r--sys/contrib/dev/acpica/include/acexcep.h2
-rw-r--r--sys/contrib/dev/acpica/include/acglobal.h2
-rw-r--r--sys/contrib/dev/acpica/include/achware.h2
-rw-r--r--sys/contrib/dev/acpica/include/acinterp.h2
-rw-r--r--sys/contrib/dev/acpica/include/aclocal.h6
-rw-r--r--sys/contrib/dev/acpica/include/acmacros.h2
-rw-r--r--sys/contrib/dev/acpica/include/acnames.h2
-rw-r--r--sys/contrib/dev/acpica/include/acnamesp.h2
-rw-r--r--sys/contrib/dev/acpica/include/acobject.h2
-rw-r--r--sys/contrib/dev/acpica/include/acopcode.h2
-rw-r--r--sys/contrib/dev/acpica/include/acoutput.h2
-rw-r--r--sys/contrib/dev/acpica/include/acparser.h2
-rw-r--r--sys/contrib/dev/acpica/include/acpi.h2
-rw-r--r--sys/contrib/dev/acpica/include/acpiosxf.h2
-rw-r--r--sys/contrib/dev/acpica/include/acpixf.h4
-rw-r--r--sys/contrib/dev/acpica/include/acpredef.h2
-rw-r--r--sys/contrib/dev/acpica/include/acresrc.h2
-rw-r--r--sys/contrib/dev/acpica/include/acrestyp.h2
-rw-r--r--sys/contrib/dev/acpica/include/acstruct.h2
-rw-r--r--sys/contrib/dev/acpica/include/actables.h2
-rw-r--r--sys/contrib/dev/acpica/include/actbinfo.h28
-rw-r--r--sys/contrib/dev/acpica/include/actbl.h20
-rw-r--r--sys/contrib/dev/acpica/include/actbl1.h35
-rw-r--r--sys/contrib/dev/acpica/include/actbl2.h385
-rw-r--r--sys/contrib/dev/acpica/include/actbl3.h4
-rw-r--r--sys/contrib/dev/acpica/include/actypes.h10
-rw-r--r--sys/contrib/dev/acpica/include/acutils.h2
-rw-r--r--sys/contrib/dev/acpica/include/acuuid.h2
-rw-r--r--sys/contrib/dev/acpica/include/amlcode.h2
-rw-r--r--sys/contrib/dev/acpica/include/amlresrc.h9
-rw-r--r--sys/contrib/dev/acpica/include/platform/acenv.h2
-rw-r--r--sys/contrib/dev/acpica/include/platform/acenvex.h2
-rw-r--r--sys/contrib/dev/acpica/include/platform/acfreebsd.h2
-rw-r--r--sys/contrib/dev/acpica/include/platform/acgcc.h10
-rw-r--r--sys/contrib/dev/acpica/include/platform/acgccex.h2
-rw-r--r--sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c2
-rw-r--r--sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c2
-rw-r--r--sys/contrib/dev/iwlwifi/fw/uefi.h4
-rw-r--r--sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware39
-rw-r--r--sys/contrib/dev/iwlwififw/WHENCE483
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-3160-17.ucodebin918268 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-3168-29.ucodebin1036288 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-7260-17.ucodebin1049340 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-7265-17.ucodebin1180412 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-7265D-29.ucodebin1036772 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-8000C-36.ucodebin2428004 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-8265-36.ucodebin2436632 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-46.ucodebin1518772 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-9260-th-b0-jf-b0-46.ucodebin1489652 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-hr-b0-77.ucodebin1404704 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-jf-b0-77.ucodebin1322436 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-hr-b0-77.ucodebin1404720 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-jf-b0-77.ucodebin1322452 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-hr-b0-77.ucodebin1404840 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-jf-b0-77.ucodebin1321956 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-cc-a0-77.ucodebin1366144 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucodebin1799504 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvmbin226668 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0-83.ucodebin1739988 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0.pnvmbin55580 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0-83.ucodebin1703968 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0.pnvmbin28064 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-so-a0-hr-b0-81.ucodebin1539288 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-so-a0-jf-b0-77.ucodebin1446036 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0-83.ucodebin1683076 -> 0 bytes
-rw-r--r--sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0.pnvmbin55484 -> 0 bytes
-rw-r--r--sys/dev/acpica/acpivar.h7
-rw-r--r--sys/dev/fdt/fdt_common.c157
-rw-r--r--sys/dev/fdt/fdt_common.h18
-rw-r--r--sys/dev/fdt/fdt_slicer.c8
-rw-r--r--sys/dev/gve/gve.h26
-rw-r--r--sys/dev/gve/gve_adminq.c53
-rw-r--r--sys/dev/gve/gve_adminq.h14
-rw-r--r--sys/dev/gve/gve_main.c148
-rw-r--r--sys/dev/gve/gve_qpl.c174
-rw-r--r--sys/dev/gve/gve_rx.c35
-rw-r--r--sys/dev/gve/gve_rx_dqo.c15
-rw-r--r--sys/dev/gve/gve_sysctl.c170
-rw-r--r--sys/dev/gve/gve_tx.c33
-rw-r--r--sys/dev/gve/gve_tx_dqo.c16
-rw-r--r--sys/dev/gve/gve_utils.c6
-rw-r--r--sys/dev/iicbus/controller/qcom/geni_iic.c608
-rw-r--r--sys/dev/iicbus/controller/qcom/geni_iic_acpi.c189
-rw-r--r--sys/dev/iicbus/controller/qcom/geni_iic_var.h80
-rw-r--r--sys/dev/iwx/if_iwx.c19
-rw-r--r--sys/dev/iwx/if_iwx_debug.c301
-rw-r--r--sys/dev/iwx/if_iwx_debug.h208
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_main.c98
-rw-r--r--sys/dev/mlx5/port.h13
-rw-r--r--sys/dev/mmc/bridge.h5
-rw-r--r--sys/dev/mmc/mmc.c8
-rw-r--r--sys/dev/mmc/mmc_subr.c2
-rw-r--r--sys/dev/mmc/mmcbrvar.h12
-rw-r--r--sys/dev/mmc/mmcreg.h1
-rw-r--r--sys/dev/mmc/mmcspi.c2378
-rw-r--r--sys/dev/pci/pci_host_generic_acpi.c3
-rw-r--r--sys/dev/pci/pci_host_generic_fdt.c2
-rw-r--r--sys/dev/pci/pcivar.h2
-rw-r--r--sys/dev/qcom_dwc3/qcom_dwc3.c10
-rw-r--r--sys/dev/qcom_gcc/qcom_gcc_clock.c98
-rw-r--r--sys/dev/qcom_gcc/qcom_gcc_ipq4018.h41
-rw-r--r--sys/dev/qcom_gcc/qcom_gcc_ipq4018_clock.c84
-rw-r--r--sys/dev/qcom_gcc/qcom_gcc_ipq4018_reset.c20
-rw-r--r--sys/dev/qcom_gcc/qcom_gcc_main.c (renamed from sys/dev/qcom_gcc/qcom_gcc_ipq4018.c)124
-rw-r--r--sys/dev/qcom_gcc/qcom_gcc_reset.c64
-rw-r--r--sys/dev/qcom_gcc/qcom_gcc_var.h (renamed from sys/dev/qcom_gcc/qcom_gcc_ipq4018_var.h)41
-rw-r--r--sys/dev/virtio/p9fs/virtio_p9fs.c2
-rw-r--r--sys/dts/arm/qcom-ipq4018-rt-ac58u.dts4
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c2
-rw-r--r--sys/kern/kern_jail.c5
-rw-r--r--sys/kern/kern_ktr.c9
-rw-r--r--sys/kern/kern_malloc.c3
-rw-r--r--sys/kern/kern_sysctl.c2
-rw-r--r--sys/kern/uipc_shm.c17
-rw-r--r--sys/kern/vfs_syscalls.c137
-rw-r--r--sys/kern/vfs_vnops.c3
-rw-r--r--sys/modules/Makefile4
-rw-r--r--sys/modules/dtb/qcom/Makefile4
-rw-r--r--sys/modules/i2c/controllers/Makefile3
-rw-r--r--sys/modules/i2c/controllers/geni_iic/Makefile10
-rw-r--r--sys/modules/iwlwififw/Makefile30
-rw-r--r--sys/modules/iwlwififw/Makefile.inc18
-rw-r--r--sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile6
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile6
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile6
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile4
-rw-r--r--sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile6
-rw-r--r--sys/modules/lindebugfs/Makefile2
-rw-r--r--sys/net/bpf.c16
-rw-r--r--sys/net/bridgestp.c4
-rw-r--r--sys/net/if_bridge.c134
-rw-r--r--sys/net/if_bridgevar.h7
-rw-r--r--sys/net/if_ethersubr.c2
-rw-r--r--sys/net/pfvar.h4
-rw-r--r--sys/net80211/ieee80211_crypto.c112
-rw-r--r--sys/net80211/ieee80211_crypto.h5
-rw-r--r--sys/net80211/ieee80211_crypto_ccmp.c279
-rw-r--r--sys/net80211/ieee80211_crypto_gcmp.c88
-rw-r--r--sys/net80211/ieee80211_ioctl.h1
-rw-r--r--sys/net80211/ieee80211_node.h2
-rw-r--r--sys/net80211/ieee80211_var.h2
-rw-r--r--sys/netinet/if_ether.c7
-rw-r--r--sys/netinet/ip.h3
-rw-r--r--sys/netinet/tcp_hpts.c2
-rw-r--r--sys/netinet/tcp_input.c2
-rw-r--r--sys/netinet/tcp_log_buf.c55
-rw-r--r--sys/netinet/tcp_log_buf.h10
-rw-r--r--sys/netinet/tcp_stacks/rack.c66
-rw-r--r--sys/netinet/tcp_stacks/rack_pcm.c2
-rw-r--r--sys/netinet/tcp_subr.c4
-rw-r--r--sys/netinet6/in6.c2
-rw-r--r--sys/netlink/netlink_snl.h5
-rw-r--r--sys/netlink/netlink_snl_generic.h4
-rw-r--r--sys/netlink/netlink_snl_route_parsers.h7
-rw-r--r--sys/netpfil/pf/if_pfsync.c4
-rw-r--r--sys/netpfil/pf/pf.c106
-rw-r--r--sys/netpfil/pf/pf_if.c16
-rw-r--r--sys/netpfil/pf/pf_ioctl.c30
-rw-r--r--sys/netpfil/pf/pf_lb.c10
-rw-r--r--sys/netpfil/pf/pf_norm.c27
-rw-r--r--sys/netpfil/pf/pf_table.c54
-rw-r--r--sys/riscv/include/metadata.h11
-rw-r--r--sys/riscv/riscv/machdep.c63
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/sys/random.h10
-rw-r--r--sys/sys/select.h2
-rw-r--r--sys/sys/socket.h4
-rw-r--r--sys/vm/phys_pager.c6
-rw-r--r--sys/vm/swap_pager.c5
-rw-r--r--sys/vm/vm_fault.c49
-rw-r--r--sys/vm/vm_glue.c43
-rw-r--r--sys/vm/vm_kern.c6
-rw-r--r--sys/vm/vm_object.c35
-rw-r--r--sys/vm/vm_page.c242
-rw-r--r--sys/vm/vm_page.h9
-rw-r--r--sys/vm/vm_pagequeue.h5
-rw-r--r--sys/vm/vm_radix.h13
-rw-r--r--sys/x86/include/bus.h2
-rw-r--r--sys/x86/include/metadata.h11
-rw-r--r--tests/sys/fs/fusefs/Makefile1
-rw-r--r--tests/sys/fs/fusefs/xattr.cc2
-rw-r--r--tests/sys/net/Makefile1
-rw-r--r--tests/sys/net/bpf/Makefile15
-rw-r--r--tests/sys/net/bpf/bpf.sh67
-rw-r--r--tests/sys/net/bpf/bpf_multi_read.c76
-rwxr-xr-xtests/sys/net/if_lagg_test.sh4
-rw-r--r--tests/sys/netinet6/Makefile5
-rwxr-xr-xtests/sys/netinet6/addr6.sh45
-rw-r--r--tests/sys/netinet6/redirect.sh6
-rw-r--r--tests/sys/netlink/test_snl.c12
-rw-r--r--tests/sys/netlink/test_snl_generic.c4
-rw-r--r--tests/sys/netpfil/pf/frag6.py54
-rw-r--r--tools/boot/full-test.sh24
-rw-r--r--tools/build/test-includes/Makefile3
-rw-r--r--tools/build/test-includes/badfiles.inc17
-rw-r--r--tools/regression/tls/ttls3/Makefile2
-rw-r--r--tools/tools/nanobsd/rescue/common34
-rw-r--r--tools/tools/net80211/w00t/Makefile.inc2
-rw-r--r--usr.bin/Makefile4
-rw-r--r--usr.bin/dtc/Makefile2
-rw-r--r--usr.bin/elfcopy/Makefile (renamed from usr.bin/objcopy/Makefile)0
-rw-r--r--usr.bin/elfcopy/Makefile.depend (renamed from usr.bin/objcopy/Makefile.depend)0
-rw-r--r--usr.sbin/ctld/Makefile1
-rw-r--r--usr.sbin/ctld/conf.cc33
-rw-r--r--usr.sbin/ctld/ctld.cc213
-rw-r--r--usr.sbin/ctld/ctld.h4
-rw-r--r--usr.sbin/ctld/kernel.cc7
-rw-r--r--usr.sbin/ctld/login.cc8
-rw-r--r--usr.sbin/ctld/uclparse.cc11
-rw-r--r--usr.sbin/pmc/Makefile1
750 files changed, 12841 insertions, 4252 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index af9e4736a65a..a18d10e80f17 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2910,14 +2910,14 @@ _dtrace_tools= cddl/lib/libctf cddl/lib/libspl cddl/usr.bin/ctfconvert \
.endif
.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
-# Some bespoke tools from or based on ELF Tool Chain. objcopy (elfcopy) is
-# included because llvm-objcopy is currently not capable of translating ELF to
-# PE32+, which is required for EFI boot programs.
+# Some bespoke tools from or based on ELF Tool Chain. elfcopy is included
+# because llvm-objcopy is currently not capable of translating ELF to PE32+,
+# which is required for EFI boot programs.
_elftctools= lib/libelftc \
lib/libpe \
+ usr.bin/elfcopy \
usr.bin/elfctl \
- usr.bin/elfdump \
- usr.bin/objcopy
+ usr.bin/elfdump
# If we're given an XNM we don't need to build standard binary utilities.
.if ${XNM:M/*} == ""
_elftctools+= usr.bin/nm \
@@ -3011,7 +3011,7 @@ NXBDIRS+= \
usr.bin/cmp \
usr.bin/diff \
usr.bin/dirname \
- usr.bin/objcopy \
+ usr.bin/elfcopy \
usr.bin/env \
usr.bin/fetch \
usr.bin/find \
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 14f54d75bc1d..24455bb86141 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -51,6 +51,9 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20250409: removal of iwlwifi firmware files
+OLD_FILES+=usr/share/doc/legal/intel_iwlwifi_firmware.LICENCE
+
# 20250331: removal of TCPPCAP
OLD_FILES+=usr/include/netinet/tcp_pcap.h
diff --git a/RELNOTES b/RELNOTES
index 7b5eac0d8730..70b59cdb621e 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -10,6 +10,16 @@ newline. Entries should be separated by a newline.
Changes to this file should not be MFCed.
+f0600c41e754-de701f9bdbe0, bc201841d139:
+ mac_do(4) is now considered production-ready and its functionality has
+ been considerably extended at the price of breaking credentials
+ transition rules' backwards compatibility. All that could be specified
+ with old rules can also be with new rules. Migrating old rules is just
+ a matter of adding "uid=" in front of the target part, substituting
+ commas (",") with semi-colons (";") and colons (":") with greater-than
+ signs (">"). Please consult the mac_do(4) manual page for the new rules
+ grammar.
+
02d4eeabfd73:
hw.snd.maxautovchans has been retired. The commit introduced a
hw.snd.vchans_enable sysctl, which along with
diff --git a/UPDATING b/UPDATING
index 56b5e2dc16b7..15db36e0b44f 100644
--- a/UPDATING
+++ b/UPDATING
@@ -27,6 +27,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW:
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20250412:
+ LinuxKPI alloc routines were changed to return physically contiguous
+ memory where expected. These changes may require out-of-tree drivers
+ to be recompiled.
+ Bump __FreeBSD_version to 1500037 to be able to detect this change.
+
+20250409:
+ Intel iwlwifi firmware has been removed from the src repository.
+ Before updating their system, users of iwlwifi(4) or iwx(4) must
+ install the appropriate firmware for their chipset using fwget(8) or
+ building it from ports.
+
20250314:
We now use LLVM's binary utilities (nm, objcopy, etc.) by default.
The WITHOUT_LLVM_BINUTILS src.conf(5) knob can be used to revert to
diff --git a/contrib/wpa/src/drivers/driver_bsd.c b/contrib/wpa/src/drivers/driver_bsd.c
index fc9a44743d7d..6efaa9c27ff2 100644
--- a/contrib/wpa/src/drivers/driver_bsd.c
+++ b/contrib/wpa/src/drivers/driver_bsd.c
@@ -378,9 +378,15 @@ bsd_set_key(void *priv, struct wpa_driver_set_key_params *params)
case WPA_ALG_CCMP:
wk.ik_type = IEEE80211_CIPHER_AES_CCM;
break;
+ case WPA_ALG_CCMP_256:
+ wk.ik_type = IEEE80211_CIPHER_AES_CCM_256;
+ break;
case WPA_ALG_GCMP:
wk.ik_type = IEEE80211_CIPHER_AES_GCM_128;
break;
+ case WPA_ALG_GCMP_256:
+ wk.ik_type = IEEE80211_CIPHER_AES_GCM_256;
+ break;
case WPA_ALG_BIP_CMAC_128:
wk.ik_type = IEEE80211_CIPHER_BIP_CMAC_128;
break;
@@ -448,16 +454,24 @@ bsd_configure_wpa(void *priv, struct wpa_bss_params *params)
{
#ifndef IEEE80211_IOC_APPIE
static const char *ciphernames[] =
- { "WEP", "TKIP", "AES-OCB", "AES-CCM", "CKIP", "NONE" };
+ { "WEP", "TKIP", "AES-OCB", "AES-CCM", "CKIP", "NONE",
+ "AES-CCM-256", "BIP-CMAC-128", "BIP-CMAC-256", "BIP-GMAC-128",
+ "BIP-GMAC-256", "AES-GCM-128", "AES-GCM-256" };
int v;
switch (params->wpa_group) {
case WPA_CIPHER_CCMP:
v = IEEE80211_CIPHER_AES_CCM;
break;
+ case WPA_CIPHER_CCMP_256:
+ v = IEEE80211_CIPHER_AES_CCM_256;
+ break;
case WPA_CIPHER_GCMP:
v = IEEE80211_CIPHER_AES_GCM_128;
break;
+ case WPA_CIPHER_GCMP_256:
+ v = IEEE80211_CIPHER_AES_GCM_256;
+ break;
case WPA_CIPHER_BIP_CMAC_128:
v = IEEE80211_CIPHER_BIP_CMAC_128;
break;
@@ -501,8 +515,12 @@ bsd_configure_wpa(void *priv, struct wpa_bss_params *params)
v |= 1<<IEEE80211_CIPHER_BIP_CMAC_128;
if (params->wpa_pairwise & WPA_CIPHER_GCMP)
v |= 1<<IEEE80211_CIPHER_AES_GCM_128;
+ if (params->wpa_pairwise & WPA_CIPHER_GCMP_256)
+ v |= 1<<IEEE80211_CIPHER_AES_GCM_256;
if (params->wpa_pairwise & WPA_CIPHER_CCMP)
v |= 1<<IEEE80211_CIPHER_AES_CCM;
+ if (params->wpa_pairwise & WPA_CIPHER_CCMP_256)
+ v |= 1<<IEEE80211_CIPHER_AES_CCM_256;
if (params->wpa_pairwise & WPA_CIPHER_TKIP)
v |= 1<<IEEE80211_CIPHER_TKIP;
if (params->wpa_pairwise & WPA_CIPHER_NONE)
@@ -1584,8 +1602,12 @@ static int wpa_driver_bsd_capa(struct bsd_driver_data *drv)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP;
if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP;
+ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM_256)
+ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP_256;
if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_GCM_128)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_GCMP;
+ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_GCM_256)
+ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_GCMP_256;
if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_BIP_CMAC_128)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_BIP;
diff --git a/crypto/openssh/session.c b/crypto/openssh/session.c
index 591f1e329a8d..03a20f9d9648 100644
--- a/crypto/openssh/session.c
+++ b/crypto/openssh/session.c
@@ -2194,7 +2194,8 @@ session_auth_agent_req(struct ssh *ssh, Session *s)
if ((r = sshpkt_get_end(ssh)) != 0)
sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
if (!auth_opts->permit_agent_forwarding_flag ||
- !options.allow_agent_forwarding) {
+ !options.allow_agent_forwarding ||
+ options.disable_forwarding) {
debug_f("agent forwarding disabled");
return 0;
}
@@ -2589,7 +2590,7 @@ session_setup_x11fwd(struct ssh *ssh, Session *s)
ssh_packet_send_debug(ssh, "X11 forwarding disabled by key options.");
return 0;
}
- if (!options.x11_forwarding) {
+ if (!options.x11_forwarding || options.disable_forwarding) {
debug("X11 forwarding disabled in server configuration file.");
return 0;
}
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index e0c16bd5e570..f197021bd4e9 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -876,6 +876,8 @@
mqueue
..
net
+ bpf
+ ..
if_ovpn
ccd
..
diff --git a/include/fts.h b/include/fts.h
index dae1df80ddd7..1e35727ad3e1 100644
--- a/include/fts.h
+++ b/include/fts.h
@@ -46,18 +46,22 @@ typedef struct {
int (*fts_compar) /* compare function */
(const struct _ftsent * const *, const struct _ftsent * const *);
-#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
-#define FTS_LOGICAL 0x002 /* logical walk */
-#define FTS_NOCHDIR 0x004 /* don't change directories */
-#define FTS_NOSTAT 0x008 /* don't get stat info */
-#define FTS_PHYSICAL 0x010 /* physical walk */
-#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
-#define FTS_XDEV 0x040 /* don't cross devices */
-#define FTS_WHITEOUT 0x080 /* return whiteout information */
-#define FTS_OPTIONMASK 0x0ff /* valid user option mask */
-
-#define FTS_NAMEONLY 0x100 /* (private) child names only */
-#define FTS_STOP 0x200 /* (private) unrecoverable error */
+/* valid for fts_open() */
+#define FTS_COMFOLLOW 0x000001 /* follow command line symlinks */
+#define FTS_LOGICAL 0x000002 /* logical walk */
+#define FTS_NOCHDIR 0x000004 /* don't change directories */
+#define FTS_NOSTAT 0x000008 /* don't get stat info */
+#define FTS_PHYSICAL 0x000010 /* physical walk */
+#define FTS_SEEDOT 0x000020 /* return dot and dot-dot */
+#define FTS_XDEV 0x000040 /* don't cross devices */
+#define FTS_WHITEOUT 0x000080 /* return whiteout information */
+#define FTS_OPTIONMASK 0x0000ff /* valid user option mask */
+
+/* valid only for fts_children() */
+#define FTS_NAMEONLY 0x000100 /* child names only */
+
+/* internal use only */
+#define FTS_STOP 0x010000 /* unrecoverable error */
int fts_options; /* fts_open options, global flags */
void *fts_clientptr; /* thunk for sort function */
} FTS;
diff --git a/kerberos5/lib/libasn1/Makefile b/kerberos5/lib/libasn1/Makefile
index 58fde4ded382..0398ed185481 100644
--- a/kerberos5/lib/libasn1/Makefile
+++ b/kerberos5/lib/libasn1/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= asn1
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
INCS= asn1_err.h asn1-common.h heim_asn1.h der.h der-protos.h der-private.h
LIBADD= com_err roken
VERSION_MAP= ${.CURDIR}/version.map
diff --git a/kerberos5/lib/libgssapi_krb5/Makefile b/kerberos5/lib/libgssapi_krb5/Makefile
index 630cb11ad6ca..6f74f6516c4e 100644
--- a/kerberos5/lib/libgssapi_krb5/Makefile
+++ b/kerberos5/lib/libgssapi_krb5/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= gssapi_krb5
-LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined
+LDFLAGS+= -Wl,-Bsymbolic -Wl,--no-undefined
LIBADD= gssapi krb5 crypto roken asn1 com_err
SHLIB_MAJOR= 10
diff --git a/kerberos5/lib/libgssapi_ntlm/Makefile b/kerberos5/lib/libgssapi_ntlm/Makefile
index 8698c5c2e3e1..51da17339620 100644
--- a/kerberos5/lib/libgssapi_ntlm/Makefile
+++ b/kerberos5/lib/libgssapi_ntlm/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= gssapi_ntlm
-LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined
+LDFLAGS+= -Wl,-Bsymbolic -Wl,--no-undefined
LIBADD= crypto gssapi krb5 heimntlm roken
SHLIB_MAJOR= 10
diff --git a/kerberos5/lib/libgssapi_spnego/Makefile b/kerberos5/lib/libgssapi_spnego/Makefile
index 421c3fecce7c..2cf73285cd37 100644
--- a/kerberos5/lib/libgssapi_spnego/Makefile
+++ b/kerberos5/lib/libgssapi_spnego/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= gssapi_spnego
-LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined
+LDFLAGS+= -Wl,-Bsymbolic -Wl,--no-undefined
LIBADD= gssapi heimbase asn1 roken
SHLIB_MAJOR= 10
diff --git a/kerberos5/lib/libhdb/Makefile b/kerberos5/lib/libhdb/Makefile
index be18779a047e..04e3a4739ef9 100644
--- a/kerberos5/lib/libhdb/Makefile
+++ b/kerberos5/lib/libhdb/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= hdb
-LDFLAGS= -Wl,--no-undefined ${LDAPLDFLAGS}
+LDFLAGS+= -Wl,--no-undefined ${LDAPLDFLAGS}
VERSION_MAP= ${KRB5DIR}/lib/hdb/version-script.map
LIBADD= asn1 com_err krb5 roken sqlite3
LDADD= ${LDAPLDADD}
diff --git a/kerberos5/lib/libheimbase/Makefile b/kerberos5/lib/libheimbase/Makefile
index e3cb2fc6c770..9870fe1d6204 100644
--- a/kerberos5/lib/libheimbase/Makefile
+++ b/kerberos5/lib/libheimbase/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= heimbase
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
LIBADD= pthread
VERSION_MAP= ${KRB5DIR}/base/version-script.map
diff --git a/kerberos5/lib/libheimntlm/Makefile b/kerberos5/lib/libheimntlm/Makefile
index f68a3d498d20..cc32e4c5e509 100644
--- a/kerberos5/lib/libheimntlm/Makefile
+++ b/kerberos5/lib/libheimntlm/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= heimntlm
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
LIBADD= crypto com_err krb5 roken
SRCS= ntlm.c ntlm_err.c ntlm_err.h
INCS= heimntlm.h heimntlm-protos.h ntlm_err.h
diff --git a/kerberos5/lib/libhx509/Makefile b/kerberos5/lib/libhx509/Makefile
index 0e82a79d9a8a..7713b4897170 100644
--- a/kerberos5/lib/libhx509/Makefile
+++ b/kerberos5/lib/libhx509/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= hx509
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
VERSION_MAP= ${KRB5DIR}/lib/hx509/version-script.map
LIBADD= asn1 com_err crypto roken wind
diff --git a/kerberos5/lib/libkadm5clnt/Makefile b/kerberos5/lib/libkadm5clnt/Makefile
index dee95b0c8b4b..182d60c9843c 100644
--- a/kerberos5/lib/libkadm5clnt/Makefile
+++ b/kerberos5/lib/libkadm5clnt/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= kadm5clnt
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
LIBADD= com_err krb5 roken
INCS= admin.h \
diff --git a/kerberos5/lib/libkadm5srv/Makefile b/kerberos5/lib/libkadm5srv/Makefile
index 9905668c529a..05006288220c 100644
--- a/kerberos5/lib/libkadm5srv/Makefile
+++ b/kerberos5/lib/libkadm5srv/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= kadm5srv
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
LIBADD= com_err hdb krb5 roken
VERSION_MAP= ${KRB5DIR}/lib/kadm5/version-script.map
MAN= kadm5_pwcheck.3
diff --git a/kerberos5/lib/libkafs5/Makefile b/kerberos5/lib/libkafs5/Makefile
index ba83533bd84e..91e06d5d777a 100644
--- a/kerberos5/lib/libkafs5/Makefile
+++ b/kerberos5/lib/libkafs5/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= kafs5
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
LIBADD= asn1 krb5 roken
INCS= kafs.h
MAN= kafs5.3
diff --git a/kerberos5/lib/libkdc/Makefile b/kerberos5/lib/libkdc/Makefile
index 58355fd6d810..72bd7d183a29 100644
--- a/kerberos5/lib/libkdc/Makefile
+++ b/kerberos5/lib/libkdc/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= kdc
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
VERSION_MAP= ${KRB5DIR}/kdc/version-script.map
LIBADD= roken hdb hx509 krb5 heimntlm asn1 crypto
diff --git a/kerberos5/lib/libkrb5/Makefile b/kerberos5/lib/libkrb5/Makefile
index edc14556dc59..d377446cd437 100644
--- a/kerberos5/lib/libkrb5/Makefile
+++ b/kerberos5/lib/libkrb5/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= krb5
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
VERSION_MAP= ${KRB5DIR}/lib/krb5/version-script.map
LIBADD= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc
diff --git a/kerberos5/lib/libwind/Makefile b/kerberos5/lib/libwind/Makefile
index 2ce6947dce7d..b57d62dc830f 100644
--- a/kerberos5/lib/libwind/Makefile
+++ b/kerberos5/lib/libwind/Makefile
@@ -1,7 +1,7 @@
PACKAGE= kerberos-lib
LIB= wind
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
VERSION_MAP= ${KRB5DIR}/lib/wind/version-script.map
LIBADD= com_err roken
diff --git a/kerberos5/libexec/digest-service/Makefile b/kerberos5/libexec/digest-service/Makefile
index 521e3b294709..0996f8704d16 100644
--- a/kerberos5/libexec/digest-service/Makefile
+++ b/kerberos5/libexec/digest-service/Makefile
@@ -10,7 +10,7 @@ CFLAGS+= -I${KRB5DIR}/kdc \
-I${KRB5DIR}/lib/roken \
-I${SRCTOP}/contrib/com_err
LIBADD= hdb kdc heimipcs krb5 roken asn1 crypto vers heimntlm
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/hprop/Makefile b/kerberos5/libexec/hprop/Makefile
index 96ac9205d040..b52ccc89e1ce 100644
--- a/kerberos5/libexec/hprop/Makefile
+++ b/kerberos5/libexec/hprop/Makefile
@@ -14,7 +14,7 @@ CFLAGS+=-I${.OBJDIR:H:H}/lib/libkrb5
LIBADD= hdb krb5 roken vers
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/hpropd/Makefile b/kerberos5/libexec/hpropd/Makefile
index 20619c070aa8..9e2039c67a63 100644
--- a/kerberos5/libexec/hpropd/Makefile
+++ b/kerberos5/libexec/hpropd/Makefile
@@ -7,7 +7,7 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 \
LIBADD= hdb krb5 roken vers
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/ipropd-master/Makefile b/kerberos5/libexec/ipropd-master/Makefile
index 640de69120a1..ee8e2146a716 100644
--- a/kerberos5/libexec/ipropd-master/Makefile
+++ b/kerberos5/libexec/ipropd-master/Makefile
@@ -8,7 +8,7 @@ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \
LIBADD= kadm5srv hdb krb5 roken vers
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/ipropd-slave/Makefile b/kerberos5/libexec/ipropd-slave/Makefile
index 748183eb09b9..6738181a6455 100644
--- a/kerberos5/libexec/ipropd-slave/Makefile
+++ b/kerberos5/libexec/ipropd-slave/Makefile
@@ -8,7 +8,7 @@ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \
LIBADD= kadm5srv hdb krb5 roken vers
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/kadmind/Makefile b/kerberos5/libexec/kadmind/Makefile
index b228b653b021..6ffe59d6e2cf 100644
--- a/kerberos5/libexec/kadmind/Makefile
+++ b/kerberos5/libexec/kadmind/Makefile
@@ -12,7 +12,7 @@ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \
LIBADD= kadm5srv gssapi hdb krb5 roken vers
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/kcm/Makefile b/kerberos5/libexec/kcm/Makefile
index f62e39a920f4..fda4b8e367b0 100644
--- a/kerberos5/libexec/kcm/Makefile
+++ b/kerberos5/libexec/kcm/Makefile
@@ -24,7 +24,7 @@ CFLAGS+="-DKRB5_DEPRECATED_FUNCTION(X)="
LIBADD= krb5 roken heimntlm heimipcs crypto
DPADD= ${LDAPDPADD}
LDADD= ${LIBVERS} ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/kdc/Makefile b/kerberos5/libexec/kdc/Makefile
index 587f850d5953..6c8f91af2631 100644
--- a/kerberos5/libexec/kdc/Makefile
+++ b/kerberos5/libexec/kdc/Makefile
@@ -11,7 +11,7 @@ SRCS= config.c \
CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \
-I${KRB5DIR}/kdc -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS}
LIBADD= kdc hdb krb5 roken crypt vers
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/libexec/kpasswdd/Makefile b/kerberos5/libexec/kpasswdd/Makefile
index 8b09c0eea5cc..8fb8a7eb0a50 100644
--- a/kerberos5/libexec/kpasswdd/Makefile
+++ b/kerberos5/libexec/kpasswdd/Makefile
@@ -6,7 +6,7 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5DIR}/lib/libhdb ${LDAPCFLAGS}
LIBADD= kadm5srv hdb krb5 roken vers asn1
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/usr.bin/kadmin/Makefile b/kerberos5/usr.bin/kadmin/Makefile
index 3ff90ff1e1d9..62aca1b81a83 100644
--- a/kerberos5/usr.bin/kadmin/Makefile
+++ b/kerberos5/usr.bin/kadmin/Makefile
@@ -29,7 +29,7 @@ CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \
LIBADD= kadm5clnt kadm5srv hdb krb5 roken vers sl asn1 crypto edit
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
CLEANFILES= kadmin-commands.h kadmin-commands.c
diff --git a/kerberos5/usr.bin/kpasswd/Makefile b/kerberos5/usr.bin/kpasswd/Makefile
index d8da1baadf39..659067f7ad12 100644
--- a/kerberos5/usr.bin/kpasswd/Makefile
+++ b/kerberos5/usr.bin/kpasswd/Makefile
@@ -3,7 +3,7 @@ PACKAGE= kerberos
PROG= kpasswd
CFLAGS+=-I${KRB5DIR}/lib/roken
LIBADD= hdb krb5 roken vers crypto
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/kerberos5/usr.sbin/iprop-log/Makefile b/kerberos5/usr.sbin/iprop-log/Makefile
index e4e7964cd009..511b46a48b8c 100644
--- a/kerberos5/usr.sbin/iprop-log/Makefile
+++ b/kerberos5/usr.sbin/iprop-log/Makefile
@@ -9,7 +9,7 @@ CFLAGS+= -I${KRB5DIR}/lib/kadm5 \
-I${KRB5DIR}/lib/sl \
-I.
LIBADD= kadm5srv hdb krb5 roken edit sl vers
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
CLEANFILES= iprop-commands.h iprop-commands.c
diff --git a/kerberos5/usr.sbin/kstash/Makefile b/kerberos5/usr.sbin/kstash/Makefile
index f2e2ce691cac..62ff9c70b05f 100644
--- a/kerberos5/usr.sbin/kstash/Makefile
+++ b/kerberos5/usr.sbin/kstash/Makefile
@@ -7,7 +7,7 @@ CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \
LIBADD= hdb krb5 crypto vers
DPADD= ${LDAPDPADD}
LDADD= ${LDAPLDADD}
-LDFLAGS=${LDAPLDFLAGS}
+LDFLAGS+=${LDAPLDFLAGS}
.include <bsd.prog.mk>
diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk
index 2520637e2d06..c731deba8976 100644
--- a/lib/clang/llvm.build.mk
+++ b/lib/clang/llvm.build.mk
@@ -119,7 +119,6 @@ LDFLAGS+= -Wl,-m,elf64lriscv_fbsd
.endif
.endif
-CXXSTD?= c++17
CXXFLAGS+= -fno-exceptions
CXXFLAGS+= -fno-rtti
.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
diff --git a/lib/lib80211/regdomain.xml b/lib/lib80211/regdomain.xml
index 557af0349cb0..9116e54c31cf 100644
--- a/lib/lib80211/regdomain.xml
+++ b/lib/lib80211/regdomain.xml
@@ -1187,6 +1187,202 @@
</netband>
</rd>
+<rd id="taiwan">
+ <name>TAIWAN</name>
+ <netband mode="11b">
+ <band>
+ <freqband ref="F1_2412_2472"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_B</flags>
+ </band>
+ </netband>
+
+ <netband mode="11g">
+ <band>
+ <freqband ref="F1_2412_2472"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_G</flags>
+ </band>
+ </netband>
+
+ <netband mode="11ng">
+ <band>
+ <freqband ref="F1_2412_2472"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_G</flags>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ </band>
+ <band>
+ <freqband ref="H4_2412_2472"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_G</flags>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ </band>
+ </netband>
+
+ <netband mode="11a">
+ <band>
+ <freqband ref="F1_5160_5240"/>
+ <maxpower>23</maxpower>
+ </band>
+ <band>
+ <freqband ref="F1_5260_5340"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="F1_5480_5720"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="F1_5745_5845"/>
+ <maxpower>30</maxpower>
+ </band>
+ </netband>
+
+ <netband mode="11na">
+ <band>
+ <freqband ref="F1_5160_5240"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ </band>
+ <band>
+ <freqband ref="H4_5180_5240"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ </band>
+
+ <band>
+ <freqband ref="F1_5260_5340"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="H4_5260_5320"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+
+ <band>
+ <freqband ref="F1_5480_5720"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="H4_5500_5720"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+
+ <band>
+ <freqband ref="F1_5745_5845"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ </band>
+ <band>
+ <freqband ref="H4_5745_5845"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ </band>
+ </netband>
+
+ <netband mode="11ac">
+ <band>
+ <freqband ref="AC2_5160_5240_20"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ <flags>IEEE80211_CHAN_VHT20</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5180_5240_40"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT40</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5180_5240_80"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT80</flags>
+ </band>
+
+ <band>
+ <freqband ref="AC2_5260_5340_20"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ <flags>IEEE80211_CHAN_VHT20</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5260_5320_40"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT40</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5260_5320_80"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT80</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+
+ <band>
+ <freqband ref="AC2_5480_5700_20"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ <flags>IEEE80211_CHAN_VHT20</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5500_5720_40"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT40</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5500_5720_80"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT80</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5500_5640_160"/>
+ <maxpower>23</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT160</flags>
+ <flags>IEEE80211_CHAN_DFS</flags>
+ </band>
+
+ <band>
+ <freqband ref="AC2_5745_5845_20"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_HT20</flags>
+ <flags>IEEE80211_CHAN_VHT20</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5745_5845_40"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT40</flags>
+ </band>
+ <band>
+ <freqband ref="AC2_5745_5805_80"/>
+ <maxpower>30</maxpower>
+ <flags>IEEE80211_CHAN_HT40</flags>
+ <flags>IEEE80211_CHAN_VHT80</flags>
+ </band>
+ </netband>
+</rd>
+
<!-- Rest Of World -->
<rd id="row">
@@ -1781,7 +1977,7 @@
<isocc>760</isocc> <name>Syria</name> <rd ref="none"/>
</country>
<country id="TW">
- <isocc>158</isocc> <name>Taiwan</name> <rd ref="row"/>
+ <isocc>158</isocc> <name>Taiwan</name> <rd ref="taiwan"/>
</country>
<country id="TH">
<isocc>764</isocc> <name>Thailand</name> <rd ref="none"/>
@@ -1904,6 +2100,11 @@
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<!-- 5150-5250/80 -->
+<freqband id="F1_5160_5240">
+ <freqstart>5120</freqstart> <freqend>5240</freqend>
+ <chanwidth>20</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
<freqband id="AC2_5160_5240_20">
<freqstart>5160</freqstart> <freqend>5240</freqend>
<chanwidth>20</chanwidth> <chansep>20</chansep>
@@ -1925,6 +2126,11 @@
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<!-- 5250-5350/80 -->
+<freqband id="F1_5260_5340">
+ <freqstart>5260</freqstart> <freqend>5340</freqend>
+ <chanwidth>20</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
<freqband id="AC2_5260_5340_20">
<freqstart>5260</freqstart> <freqend>5340</freqend>
<chanwidth>20</chanwidth> <chansep>20</chansep>
@@ -1941,6 +2147,11 @@
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<!-- 5470-5725/160 -->
+<freqband id="F1_5480_5720">
+ <freqstart>5480</freqstart> <freqend>5720</freqend>
+ <chanwidth>20</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
<freqband id="AC2_5480_5700_20">
<freqstart>5480</freqstart> <freqend>5700</freqend>
<chanwidth>20</chanwidth> <chansep>20</chansep>
@@ -1961,7 +2172,38 @@
<chanwidth>160</chanwidth> <chansep>20</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
+<!-- 5500-5720/80 -->
+<freqband id="AC2_5500_5720_40">
+ <freqstart>5500</freqstart> <freqend>5720</freqend>
+ <chanwidth>40</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="AC2_5500_5720_80">
+ <freqstart>5500</freqstart> <freqend>5720</freqend>
+ <chanwidth>80</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
<!-- 5725-5875/80 short range -->
+<freqband id="F1_5745_5825">
+ <freqstart>5745</freqstart> <freqend>5825</freqend>
+ <chanwidth>20</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="F1_5745_5845">
+ <freqstart>5745</freqstart> <freqend>5845</freqend>
+ <chanwidth>20</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="H4_5745_5845">
+ <freqstart>5745</freqstart> <freqend>5845</freqend>
+ <chanwidth>40</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="AC2_5745_5845_20">
+ <freqstart>5745</freqstart> <freqend>5845</freqend>
+ <chanwidth>20</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
<freqband id="AC2_5745_5865_20">
<freqstart>5745</freqstart> <freqend>5865</freqend>
<chanwidth>20</chanwidth> <chansep>20</chansep>
@@ -1972,6 +2214,11 @@
<chanwidth>40</chanwidth> <chansep>20</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
+<freqband id="AC2_5745_5845_40">
+ <freqstart>5745</freqstart> <freqend>5845</freqend>
+ <chanwidth>40</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
<freqband id="AC2_5745_5805_80">
<freqstart>5745</freqstart> <freqend>5805</freqend>
<chanwidth>80</chanwidth> <chansep>20</chansep>
@@ -2027,6 +2274,11 @@
<chanwidth>20</chanwidth> <chansep>20</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
+<freqband id="H4_5500_5720">
+ <freqstart>5500</freqstart> <freqend>5720</freqend>
+ <chanwidth>40</chanwidth> <chansep>20</chansep>
+ <flags>IEEE80211_CHAN_A</flags>
+</freqband>
<freqband id="H4_5500_5580">
<freqstart>5500</freqstart> <freqend>5580</freqend>
<chanwidth>40</chanwidth> <chansep>20</chansep>
diff --git a/lib/libc/gen/alarm.3 b/lib/libc/gen/alarm.3
index 8aeda29481eb..4a24cc6d7216 100644
--- a/lib/libc/gen/alarm.3
+++ b/lib/libc/gen/alarm.3
@@ -63,7 +63,7 @@ Due to
.Xr setitimer 2
restriction the maximum number of
.Fa seconds
-allowed is 100000000.
+allowed is 100,000,000.
.Sh RETURN VALUES
The return value of
.Fn alarm
diff --git a/lib/libc/gen/fnmatch.3 b/lib/libc/gen/fnmatch.3
index 804bc968c1ce..7f020fec58e3 100644
--- a/lib/libc/gen/fnmatch.3
+++ b/lib/libc/gen/fnmatch.3
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 2, 2022
+.Dd April 7, 2025
.Dt FNMATCH 3
.Os
.Sh NAME
@@ -129,12 +129,8 @@ otherwise, it returns the value
.Sh STANDARDS
The current implementation of the
.Fn fnmatch
-function
-.Em does not
-conform to
+function is expected to conform to
.St -p1003.2 .
-Collating symbol expressions, equivalence class expressions and
-character class expressions are not supported.
.Sh HISTORY
A predecessor to
.Fn fnmatch ,
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index fb1829e69502..1c583a9d23e2 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -67,7 +67,8 @@
#define RANGE_NOMATCH 0
#define RANGE_ERROR (-1)
-static int rangematch(const char *, wchar_t, int, char **, mbstate_t *);
+static int rangematch(const char *, wchar_t, const char *, int, char **,
+ char **, mbstate_t *, mbstate_t *);
static int fnmatch1(const char *, const char *, const char *, int, mbstate_t,
mbstate_t);
@@ -85,7 +86,7 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart,
{
const char *bt_pattern, *bt_string;
mbstate_t bt_patmbs, bt_strmbs;
- char *newp;
+ char *newp, *news;
char c;
wchar_t pc, sc;
size_t pclen, sclen;
@@ -151,8 +152,10 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart,
* there is no way having it match more characters
* can help us, given that we are already here.
*/
- bt_pattern = pattern, bt_patmbs = patmbs;
- bt_string = string, bt_strmbs = strmbs;
+ bt_pattern = pattern;
+ bt_patmbs = patmbs;
+ bt_string = string;
+ bt_strmbs = strmbs;
break;
case '[':
if (sc == EOS)
@@ -164,17 +167,17 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart,
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
goto backtrack;
- switch (rangematch(pattern, sc, flags, &newp,
- &patmbs)) {
+ switch (rangematch(pattern, sc, string + sclen, flags,
+ &newp, &news, &patmbs, &strmbs)) {
case RANGE_ERROR:
goto norm;
case RANGE_MATCH:
pattern = newp;
+ string = news;
break;
case RANGE_NOMATCH:
goto backtrack;
}
- string += sclen;
break;
case '\\':
if (!(flags & FNM_NOESCAPE)) {
@@ -218,8 +221,10 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart,
if (sc == '/' && flags & FNM_PATHNAME)
return (FNM_NOMATCH);
bt_string += sclen;
- pattern = bt_pattern, patmbs = bt_patmbs;
- string = bt_string, strmbs = bt_strmbs;
+ pattern = bt_pattern;
+ patmbs = bt_patmbs;
+ string = bt_string;
+ strmbs = bt_strmbs;
}
break;
}
@@ -228,15 +233,20 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart,
}
static int
-rangematch(const char *pattern, wchar_t test, int flags, char **newp,
- mbstate_t *patmbs)
+rangematch(const char *pattern, wchar_t test, const char *string, int flags,
+ char **newp, char **news, mbstate_t *patmbs, mbstate_t *strmbs)
{
int negate, ok;
wchar_t c, c2;
size_t pclen;
const char *origpat;
struct xlocale_collate *table =
- (struct xlocale_collate*)__get_locale()->components[XLC_COLLATE];
+ (struct xlocale_collate *)__get_locale()->components[XLC_COLLATE];
+ wchar_t buf[COLLATE_STR_LEN]; /* STR_LEN defined in collate.h */
+ const char *cp, *savestring;
+ int special;
+ mbstate_t save;
+ size_t sclen, len;
/*
* A bracket expression starting with an unquoted circumflex
@@ -259,20 +269,132 @@ rangematch(const char *pattern, wchar_t test, int flags, char **newp,
ok = 0;
origpat = pattern;
for (;;) {
+ c = 0;
if (*pattern == ']' && pattern > origpat) {
- pattern++;
break;
} else if (*pattern == '\0') {
return (RANGE_ERROR);
} else if (*pattern == '/' && (flags & FNM_PATHNAME)) {
return (RANGE_NOMATCH);
- } else if (*pattern == '\\' && !(flags & FNM_NOESCAPE))
+ } else if (*pattern == '\\' && !(flags & FNM_NOESCAPE)) {
pattern++;
- pclen = mbrtowc(&c, pattern, MB_LEN_MAX, patmbs);
- if (pclen == (size_t)-1 || pclen == (size_t)-2)
- return (RANGE_NOMATCH);
- pattern += pclen;
+ } else if (*pattern == '[' &&
+ ((special = *(pattern + 1)) == '.' ||
+ special == '=' || special == ':')) {
+ cp = (pattern += 2);
+ while ((cp = strchr(cp, special))) {
+ if (*(cp + 1) == ']')
+ break;
+ cp++;
+ }
+ if (!cp)
+ return (RANGE_ERROR);
+ if (special == '.') {
+treat_like_collating_symbol:
+ len = __collate_collating_symbol(buf,
+ COLLATE_STR_LEN, pattern,
+ cp - pattern, patmbs);
+ if (len == (size_t)-1 || len == 0)
+ return (RANGE_ERROR);
+ pattern = cp + 2;
+ if (len > 1) {
+ wchar_t *wp, sc;
+ /*
+ * No multi-character collation
+ * symbols as start of range.
+ */
+ if (*(cp + 2) == '-' &&
+ *(cp + 3) != EOS &&
+ *(cp + 3) != ']')
+ return (RANGE_ERROR);
+ wp = buf;
+ if (test != *wp++)
+ continue;
+ if (len == 1) {
+ ok = 1;
+ break;
+ }
+ memcpy(&save, strmbs, sizeof(save));
+ savestring = string;
+ while (--len > 0) {
+ sclen = mbrtowc(&sc, string,
+ MB_LEN_MAX, strmbs);
+ if (sclen == (size_t)-1 ||
+ sclen == (size_t)-2) {
+ sc = (unsigned char)*string;
+ sclen = 1;
+ memset(&strmbs, 0,
+ sizeof(strmbs));
+ }
+ if (sc != *wp++) {
+ memcpy(strmbs, &save,
+ sizeof(save));
+ string = savestring;
+ break;
+ }
+ string += sclen;
+ }
+ if (len == 0) {
+ ok = 1;
+ break;
+ }
+ continue; /* no match */
+ }
+ c = *buf;
+ } else if (special == '=') {
+ int ec;
+ memcpy(&save, patmbs, sizeof(save));
+ ec = __collate_equiv_class(pattern,
+ cp - pattern, patmbs);
+ if (ec < 0)
+ return (RANGE_ERROR);
+ if (ec == 0) {
+ memcpy(patmbs, &save, sizeof(save));
+ goto treat_like_collating_symbol;
+ }
+ pattern = cp + 2;
+ /* no equivalence classes as start of range */
+ if (*(cp + 2) == '-' && *(cp + 3) != EOS &&
+ *(cp + 3) != ']')
+ return (RANGE_ERROR);
+ len = __collate_equiv_match(ec, NULL, 0, test,
+ string, strlen(string), strmbs, &sclen);
+ if (len < 0)
+ return (RANGE_ERROR);
+ if (len > 0) {
+ ok = 1;
+ string += sclen;
+ break;
+ }
+ continue;
+ } else { /* special == ':' */
+ wctype_t charclass;
+ char name[CHARCLASS_NAME_MAX + 1];
+ /* no character classes as start of range */
+ if (*(cp + 2) == '-' && *(cp + 3) != EOS &&
+ *(cp + 3) != ']')
+ return (RANGE_ERROR);
+ /* assume character class names are ascii */
+ if (cp - pattern > CHARCLASS_NAME_MAX)
+ return (RANGE_ERROR);
+ strlcpy(name, pattern, cp - pattern + 1);
+ pattern = cp + 2;
+ if ((charclass = wctype(name)) == 0)
+ return (RANGE_ERROR);
+ if (iswctype(test, charclass)) {
+ ok = 1;
+ break;
+ }
+ continue;
+ }
+ }
+ if (!c) {
+ pclen = mbrtowc(&c, pattern, MB_LEN_MAX, patmbs);
+ if (pclen == (size_t)-1 || pclen == (size_t)-2)
+ return (RANGE_NOMATCH);
+ pattern += pclen;
+ }
if (flags & FNM_CASEFOLD)
c = towlower(c);
@@ -288,6 +410,37 @@ rangematch(const char *pattern, wchar_t test, int flags, char **newp,
if (c2 == EOS)
return (RANGE_ERROR);
+ if ((c2 == '[' && (special = *pattern) == '.') ||
+ special == '=' || special == ':') {
+
+ /*
+ * No equivalence classes or character
+ * classes as end of range.
+ */
+ if (special == '=' || special == ':')
+ return (RANGE_ERROR);
+ cp = ++pattern;
+ while ((cp = strchr(cp, special))) {
+ if (*(cp + 1) == ']')
+ break;
+ cp++;
+ }
+ if (!cp)
+ return (RANGE_ERROR);
+ len = __collate_collating_symbol(buf,
+ COLLATE_STR_LEN, pattern,
+ cp - pattern, patmbs);
+
+ /*
+ * No multi-character collation symbols
+ * as end of range.
+ */
+ if (len != 1)
+ return (RANGE_ERROR);
+ pattern = cp + 2;
+ c2 = *buf;
+ }
+
if (flags & FNM_CASEFOLD)
c2 = towlower(c2);
@@ -295,12 +448,44 @@ rangematch(const char *pattern, wchar_t test, int flags, char **newp,
c <= test && test <= c2 :
__wcollate_range_cmp(c, test) <= 0
&& __wcollate_range_cmp(test, c2) <= 0
- )
+ ) {
ok = 1;
- } else if (c == test)
+ break;
+ }
+ } else if (c == test) {
ok = 1;
+ break;
+ }
}
- *newp = (char *)pattern;
+ /* go to end of bracket expression */
+ special = 0;
+ while (*pattern != ']') {
+ if (*pattern == 0)
+ return (RANGE_ERROR);
+ if (*pattern == special) {
+ if (*++pattern == ']') {
+ special = 0;
+ pattern++;
+ }
+ continue;
+ }
+ if (!special && *pattern == '[') {
+ special = *++pattern;
+ if (special != '.' && special != '=' && special != ':')
+ special = 0;
+ else
+ pattern++;
+ continue;
+ }
+ pclen = mbrtowc(&c, pattern, MB_LEN_MAX, patmbs);
+ if (pclen == (size_t)-1 || pclen == (size_t)-2)
+ return (RANGE_NOMATCH);
+ pattern += pclen;
+ }
+
+ *newp = (char *)++pattern;
+ *news = (char *)string;
+
return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH);
}
diff --git a/lib/libc/gen/ualarm.3 b/lib/libc/gen/ualarm.3
index f4e0973b133a..dfd9ddd5f434 100644
--- a/lib/libc/gen/ualarm.3
+++ b/lib/libc/gen/ualarm.3
@@ -70,7 +70,7 @@ restriction the maximum number of
.Fa microseconds
and
.Fa interval
-is limited to 100000000000000
+is limited to 100,000,000,000,000
(in case this value fits in the unsigned integer).
.Sh RETURN VALUES
When the signal has successfully been caught,
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index 8e3635485f10..c0fc4c91481d 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -43,6 +43,7 @@
#include <sys/mman.h>
#include <assert.h>
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -732,3 +733,261 @@ __collate_equiv_value(locale_t locale, const wchar_t *str, size_t len)
}
return (0);
}
+
+/*
+ * __collate_collating_symbol takes the multibyte string specified by
+ * src and slen, and using ps, converts that to a wide character. Then
+ * it is checked to verify it is a collating symbol, and then copies
+ * it to the wide character string specified by dst and dlen (the
+ * results are not null terminated). The length of the wide characters
+ * copied to dst is returned if successful. Zero is returned if no such
+ * collating symbol exists. (size_t)-1 is returned if there are wide-character
+ * conversion errors, if the length of the converted string is greater that
+ * COLLATE_STR_LEN or if dlen is too small. It is up to the calling routine to
+ * preserve the mbstate_t structure as needed.
+ */
+size_t
+__collate_collating_symbol(wchar_t *dst, size_t dlen, const char *src,
+ size_t slen, mbstate_t *ps)
+{
+ wchar_t wname[COLLATE_STR_LEN];
+ wchar_t w, *wp;
+ struct xlocale_collate *table;
+ size_t len, l;
+
+ table =
+ (struct xlocale_collate *)__get_locale()->components[XLC_COLLATE];
+ /* POSIX locale */
+ if (table->__collate_load_error) {
+ if (dlen < 1)
+ return ((size_t)-1);
+ if (slen != 1 || !isascii(*src))
+ return (0);
+ *dst = *src;
+ return (1);
+ }
+ for (wp = wname, len = 0; slen > 0; len++) {
+ l = mbrtowc(&w, src, slen, ps);
+ if (l == (size_t)-1 || l == (size_t)-2)
+ return ((size_t)-1);
+ if (l == 0)
+ break;
+ if (len >= COLLATE_STR_LEN)
+ return ((size_t)-1);
+ *wp++ = w;
+ src += l;
+ slen -= l;
+ }
+ if (len == 0 || len > dlen)
+ return ((size_t)-1);
+ if (len == 1) {
+ if (*wname <= UCHAR_MAX) {
+ if (table->char_pri_table[*wname].pri[0] >= 0) {
+ if (dlen > 0)
+ *dst = *wname;
+ return (1);
+ }
+ return (0);
+ } else if (table->info->large_count > 0) {
+ collate_large_t *match;
+ match = largesearch(table, *wname);
+ if (match && match->pri.pri[0] >= 0) {
+ if (dlen > 0)
+ *dst = *wname;
+ return (1);
+ }
+ }
+ return (0);
+ }
+ *wp = 0;
+ if (table->info->chain_count > 0) {
+ collate_chain_t *match;
+ int ll;
+ match = chainsearch(table, wname, &ll);
+ if (match) {
+ if (ll < dlen)
+ dlen = ll;
+ wcsncpy(dst, wname, dlen);
+ return (dlen);
+ }
+ }
+ return (0);
+}
+
+/*
+ * __collate_equiv_class returns the equivalence class number for the symbol
+ * specified by src and slen, using ps to convert from multi-byte to wide
+ * character. Zero is returned if the symbol is not in an equivalence
+ * class. -1 is returned if there are wide character conversion errors,
+ * if there are any greater-than-8-bit characters or if a multi-byte symbol
+ * is greater or equal to COLLATE_STR_LEN in length. It is up to the calling
+ * routine to preserve the mbstate_t structure as needed.
+ */
+int
+__collate_equiv_class(const char *src, size_t slen, mbstate_t *ps)
+{
+ wchar_t wname[COLLATE_STR_LEN];
+ wchar_t w, *wp;
+ struct xlocale_collate *table;
+ size_t len, l;
+ int e;
+
+ table =
+ (struct xlocale_collate *)__get_locale()->components[XLC_COLLATE];
+ /* POSIX locale */
+ if (table->__collate_load_error)
+ return (0);
+ for (wp = wname, len = 0; slen > 0; len++) {
+ l = mbrtowc(&w, src, slen, ps);
+ if (l == (size_t)-1 || l == (size_t)-2)
+ return (-1);
+ if (l == 0)
+ break;
+ if (len >= COLLATE_STR_LEN)
+ return (-1);
+ *wp++ = w;
+ src += l;
+ slen -= l;
+ }
+ if (len == 0)
+ return (-1);
+ if (len == 1) {
+ e = -1;
+ if (*wname <= UCHAR_MAX)
+ e = table->char_pri_table[*wname].pri[0];
+ else if (table->info->large_count > 0) {
+ collate_large_t *match;
+ match = largesearch(table, *wname);
+ if (match)
+ e = match->pri.pri[0];
+ }
+ if (e == 0)
+ return (IGNORE_EQUIV_CLASS);
+ return (e > 0 ? e : 0);
+ }
+ *wp = 0;
+ if (table->info->chain_count > 0) {
+ collate_chain_t *match;
+ int ll;
+ match = chainsearch(table, wname, &ll);
+ if (match) {
+ e = match->pri[0];
+ if (e == 0)
+ return (IGNORE_EQUIV_CLASS);
+ return (e < 0 ? -e : e);
+ }
+ }
+ return (0);
+}
+
+
+/*
+ * __collate_equiv_match tries to match any single or multi-character symbol
+ * in equivalence class equiv_class in the multi-byte string specified by src
+ * and slen. If start is non-zero, it is taken to be the first (pre-converted)
+ * wide character. Subsequence wide characters, if needed, will use ps in
+ * the conversion. On a successful match, the length of the matched string
+ * is returned (including the start character). If dst is non-NULL, the
+ * matched wide-character string is copied to dst, a wide character array of
+ * length dlen (the results are not zero-terminated). If rlen is non-NULL,
+ * the number of character in src actually used is returned. Zero is
+ * returned by __collate_equiv_match if there is no match. (size_t)-1 is
+ * returned on error: if there were conversion errors or if dlen is too small
+ * to accept the results. On no match or error, ps is restored to its incoming
+ * state.
+ */
+size_t
+__collate_equiv_match(int equiv_class, wchar_t *dst, size_t dlen, wchar_t start,
+ const char *src, size_t slen, mbstate_t *ps, size_t *rlen)
+{
+ wchar_t w;
+ size_t len, l, clen;
+ int i;
+ wchar_t buf[COLLATE_STR_LEN], *wp;
+ mbstate_t save;
+ const char *s = src;
+ struct xlocale_collate *table;
+ size_t sl = slen;
+ collate_chain_t *ch = NULL;
+
+ table =
+ (struct xlocale_collate *)__get_locale()->components[XLC_COLLATE];
+ /* POSIX locale */
+ if (table->__collate_load_error)
+ return ((size_t)-1);
+ if (equiv_class == IGNORE_EQUIV_CLASS)
+ equiv_class = 0;
+ if (ps)
+ save = *ps;
+ wp = buf;
+ len = clen = 0;
+ if (start) {
+ *wp++ = start;
+ len = 1;
+ }
+ /* convert up to the max chain length */
+ while (sl > 0 && len < table->info->chain_max_len) {
+ l = mbrtowc(&w, s, sl, ps);
+ if (l == (size_t)-1 || l == (size_t)-2 || l == 0)
+ break;
+ *wp++ = w;
+ s += l;
+ clen += l;
+ sl -= l;
+ len++;
+ }
+ *wp = 0;
+ if (len > 1 && (ch = chainsearch(table, buf, &i)) != NULL) {
+ int e = ch->pri[0];
+ if (e < 0)
+ e = -e;
+ if (e == equiv_class)
+ goto found;
+ }
+ /* try single character */
+ i = 1;
+ if (*buf <= UCHAR_MAX) {
+ if (equiv_class == table->char_pri_table[*buf].pri[0])
+ goto found;
+ } else if (table->info->large_count > 0) {
+ collate_large_t *match;
+ match = largesearch(table, *buf);
+ if (match && equiv_class == match->pri.pri[0])
+ goto found;
+ }
+ /* no match */
+ if (ps)
+ *ps = save;
+ return (0);
+found:
+ /*
+ * If we converted more than we used, restore to initial
+ * and reconvert up to what did match.
+ */
+ if (i < len) {
+ len = i;
+ if (ps)
+ *ps = save;
+ if (start)
+ i--;
+ clen = 0;
+ while (i-- > 0) {
+ l = mbrtowc(&w, src, slen, ps);
+ src += l;
+ clen += l;
+ slen -= l;
+ }
+ }
+ if (dst) {
+ if (dlen < len) {
+ if (ps)
+ *ps = save;
+ return ((size_t)-1);
+ }
+ for (wp = buf; len > 0; len--)
+ *dst++ = *wp++;
+ }
+ if (rlen)
+ *rlen = clen;
+ return (len);
+}
diff --git a/lib/libc/locale/collate.h b/lib/libc/locale/collate.h
index f157d8651899..64e0e6f2337d 100644
--- a/lib/libc/locale/collate.h
+++ b/lib/libc/locale/collate.h
@@ -38,6 +38,7 @@
#include <sys/types.h>
#include <limits.h>
+#include <wchar.h>
#include "xlocale_private.h"
/*
@@ -65,6 +66,8 @@
#define DIRECTIVE_DIRECTION_MASK (DIRECTIVE_FORWARD | DIRECTIVE_BACKWARD)
+#define IGNORE_EQUIV_CLASS 1
+
/*
* The collate file format is as follows:
*
@@ -85,6 +88,7 @@
typedef struct collate_info {
uint8_t directive_count;
uint8_t directive[COLL_WEIGHTS_MAX];
+ uint8_t chain_max_len; /* In padding */
int32_t pri_count[COLL_WEIGHTS_MAX];
int32_t flags;
int32_t chain_count;
@@ -126,8 +130,13 @@ struct xlocale_collate {
};
__BEGIN_DECLS
-int __collate_load_tables(const char *);
+size_t __collate_collating_symbol(wchar_t *, size_t, const char *, size_t,
+ mbstate_t *);
+int __collate_equiv_class(const char *, size_t, mbstate_t *);
int __collate_equiv_value(locale_t, const wchar_t *, size_t);
+size_t __collate_equiv_match(int, wchar_t *, size_t, wchar_t, const char *,
+ size_t, mbstate_t *, size_t *);
+int __collate_load_tables(const char *);
void _collate_lookup(struct xlocale_collate *,const wchar_t *, int *, int *,
int, const int **);
int __collate_range_cmp(char, char);
diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc
index 558cf7be5771..58c650b207cf 100644
--- a/lib/libc/net/Makefile.inc
+++ b/lib/libc/net/Makefile.inc
@@ -1,7 +1,7 @@
# machine-independent net sources
.PATH: ${LIBC_SRCTOP}/net
-CONFS+= net/hosts net/hosts.equiv net/networks net/nsswitch.conf net/protocols
+CONFS+= net/hosts net/hosts.equiv net/networks ${.OBJDIR}/nsswitch.conf net/protocols
SRCS+= base64.c ether_addr.c eui64.c \
gai_strerror.c getaddrinfo.c \
gethostbydns.c gethostbyht.c gethostbynis.c gethostnamadr.c \
@@ -176,9 +176,13 @@ MLINKS+=hesiod.3 hesiod_init.3 \
hesiod.3 hesiod_end.3
.endif
-afterinstallconfig: modify-nsswitch-conf
-modify-nsswitch-conf: .PHONY
+all: ${.OBJDIR}/nsswitch.conf
+
+# Manually stage nsswitch.conf in the object directory so that we can edit it
+# before installing.
+${.OBJDIR}/nsswitch.conf: ${LIBC_SRCTOP}/net/nsswitch.conf
+ cp -f ${LIBC_SRCTOP}/net/nsswitch.conf ${.TARGET}
.if ${MK_NIS} == "no"
sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
- ${DESTDIR}/etc/nsswitch.conf
+ ${.TARGET}
.endif
diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c
index e5aa66c51f38..6e4a12f9e530 100644
--- a/lib/libc/stdlib/atexit.c
+++ b/lib/libc/stdlib/atexit.c
@@ -35,6 +35,7 @@
#include "namespace.h"
#include <errno.h>
#include <link.h>
+#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
@@ -56,6 +57,8 @@ _Block_copy(void*);
#define ATEXIT_FN_CXA 2
static pthread_mutex_t atexit_mutex = PTHREAD_MUTEX_INITIALIZER;
+static void *current_finalize_dso = NULL;
+static bool call_finalize_again = false;
#define _MUTEX_LOCK(x) if (__isthreaded) _pthread_mutex_lock(x)
#define _MUTEX_UNLOCK(x) if (__isthreaded) _pthread_mutex_unlock(x)
@@ -115,6 +118,9 @@ atexit_register(struct atexit_fn *fptr)
__atexit = p;
}
p->fns[p->ind++] = *fptr;
+ if (current_finalize_dso != NULL &&
+ current_finalize_dso == fptr->fn_dso)
+ call_finalize_again = true;
_MUTEX_UNLOCK(&atexit_mutex);
return 0;
}
@@ -208,33 +214,38 @@ __cxa_finalize(void *dso)
}
_MUTEX_LOCK(&atexit_mutex);
- for (p = __atexit; p; p = p->next) {
- for (n = p->ind; --n >= 0;) {
- if (p->fns[n].fn_type == ATEXIT_FN_EMPTY)
- continue; /* already been called */
- fn = p->fns[n];
- if (dso != NULL && dso != fn.fn_dso) {
- /* wrong DSO ? */
- if (!has_phdr || global_exit ||
- !__elf_phdr_match_addr(&phdr_info,
- fn.fn_ptr.cxa_func))
- continue;
+ current_finalize_dso = dso;
+ do {
+ call_finalize_again = false;
+ for (p = __atexit; p; p = p->next) {
+ for (n = p->ind; --n >= 0;) {
+ if (p->fns[n].fn_type == ATEXIT_FN_EMPTY)
+ continue; /* already been called */
+ fn = p->fns[n];
+ if (dso != NULL && dso != fn.fn_dso) {
+ /* wrong DSO ? */
+ if (!has_phdr || global_exit ||
+ !__elf_phdr_match_addr(&phdr_info,
+ fn.fn_ptr.cxa_func))
+ continue;
+ }
+ /*
+ Mark entry to indicate that this particular
+ handler has already been called.
+ */
+ p->fns[n].fn_type = ATEXIT_FN_EMPTY;
+ _MUTEX_UNLOCK(&atexit_mutex);
+
+ /* Call the function of correct type. */
+ if (fn.fn_type == ATEXIT_FN_CXA)
+ fn.fn_ptr.cxa_func(fn.fn_arg);
+ else if (fn.fn_type == ATEXIT_FN_STD)
+ fn.fn_ptr.std_func();
+ _MUTEX_LOCK(&atexit_mutex);
}
- /*
- Mark entry to indicate that this particular handler
- has already been called.
- */
- p->fns[n].fn_type = ATEXIT_FN_EMPTY;
- _MUTEX_UNLOCK(&atexit_mutex);
-
- /* Call the function of correct type. */
- if (fn.fn_type == ATEXIT_FN_CXA)
- fn.fn_ptr.cxa_func(fn.fn_arg);
- else if (fn.fn_type == ATEXIT_FN_STD)
- fn.fn_ptr.std_func();
- _MUTEX_LOCK(&atexit_mutex);
}
- }
+ } while (call_finalize_again);
+ current_finalize_dso = NULL;
_MUTEX_UNLOCK(&atexit_mutex);
if (dso == NULL)
_MUTEX_DESTROY(&atexit_mutex);
diff --git a/lib/libc/tests/gen/fnmatch_test.c b/lib/libc/tests/gen/fnmatch_test.c
index 6cdf5f2a05fa..0ff7400a4a4f 100644
--- a/lib/libc/tests/gen/fnmatch_test.c
+++ b/lib/libc/tests/gen/fnmatch_test.c
@@ -26,6 +26,7 @@
#include <sys/param.h>
#include <errno.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -176,10 +177,90 @@ ATF_TC_BODY(fnmatch_test, tc)
}
+ATF_TC(fnmatch_characterclass);
+ATF_TC_HEAD(fnmatch_characterclass, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test fnmatch with character classes");
+}
+
+ATF_TC_BODY(fnmatch_characterclass, tc)
+{
+ ATF_CHECK(fnmatch("[[:alnum:]]", "a", 0) == 0);
+ ATF_CHECK(fnmatch("[[:cntrl:]]", "\a", 0) == 0);
+ ATF_CHECK(fnmatch("[[:lower:]]", "a", 0) == 0);
+ ATF_CHECK(fnmatch("[[:space:]]", " ", 0) == 0);
+ ATF_CHECK(fnmatch("[[:alpha:]]", "a", 0) == 0);
+ ATF_CHECK(fnmatch("[[:digit:]]", "0", 0) == 0);
+ ATF_CHECK(fnmatch("[[:print:]]", "a", 0) == 0);
+ ATF_CHECK(fnmatch("[[:upper:]]", "A", 0) == 0);
+ ATF_CHECK(fnmatch("[[:blank:]]", " ", 0) == 0);
+ ATF_CHECK(fnmatch("[[:graph:]]", "a", 0) == 0);
+ ATF_CHECK(fnmatch("[[:punct:]]", ".", 0) == 0);
+ ATF_CHECK(fnmatch("[[:xdigit:]]", "f", 0) == 0);
+
+ /*
+ * POSIX.1, section 9.3.5. states that '[:' and ':]'
+ * should be interpreted as character classes symbol only
+ * when part of a bracket expression.
+ */
+ ATF_CHECK(fnmatch("[:alnum:]", "a", 0) == 0);
+ ATF_CHECK(fnmatch("[:alnum:]", ":", 0) == 0);
+ ATF_CHECK(fnmatch("[:alnum:]", "1", 0) != 0);
+}
+
+ATF_TC(fnmatch_collsym);
+ATF_TC_HEAD(fnmatch_collsym, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test fnmatch with collating symbols");
+}
+
+ATF_TC_BODY(fnmatch_collsym, tc)
+{
+ setlocale(LC_ALL, "cs_CZ.UTF-8");
+ ATF_CHECK(fnmatch("[ch]", "ch", 0) != 0);
+ ATF_CHECK(fnmatch("[[.ch.]]", "ch", 0) == 0);
+ ATF_CHECK(fnmatch("[[.ch.]]h", "chh", 0) == 0);
+
+ /*
+ * POSIX.1, section 9.3.5. states that '[.' and '.]'
+ * should be interpreted as a collating symbol only
+ * when part of a bracket expression.
+ */
+ ATF_CHECK(fnmatch("[.ch.]", "c", 0) == 0);
+ ATF_CHECK(fnmatch("[.ch.]", "h", 0) == 0);
+ ATF_CHECK(fnmatch("[.ch.]", ".", 0) == 0);
+}
+
+ATF_TC(fnmatch_equivclass);
+ATF_TC_HEAD(fnmatch_equivclass, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test fnmatch with equivalence classes");
+}
+
+ATF_TC_BODY(fnmatch_equivclass, tc)
+{
+ setlocale(LC_ALL, "en_US.UTF-8");
+ ATF_CHECK(fnmatch("[[=a=]]b", "ab", 0) == 0);
+ ATF_CHECK(fnmatch("[[=a=]]b", "Ab", 0) == 0);
+ ATF_CHECK(fnmatch("[[=à=]]b", "ab", 0) == 0);
+ ATF_CHECK(fnmatch("[[=a=]]b", "àb", 0) == 0);
+
+ /*
+ * POSIX.1, section 9.3.5. states that '[=' and '=]'
+ * should be interpreted as an equivalence class only
+ * when part of a bracket expression.
+ */
+ ATF_CHECK(fnmatch("[=a=]b", "=b", 0) == 0);
+ ATF_CHECK(fnmatch("[=a=]b", "ab", 0) == 0);
+}
+
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, fnmatch_test);
+ ATF_TP_ADD_TC(tp, fnmatch_collsym);
+ ATF_TP_ADD_TC(tp, fnmatch_characterclass);
+ ATF_TP_ADD_TC(tp, fnmatch_equivclass);
return (atf_no_error());
}
diff --git a/lib/libc/tests/net/getaddrinfo/Makefile b/lib/libc/tests/net/getaddrinfo/Makefile
index 1c8d68d8cc25..1299e91615b7 100644
--- a/lib/libc/tests/net/getaddrinfo/Makefile
+++ b/lib/libc/tests/net/getaddrinfo/Makefile
@@ -1,12 +1,10 @@
PACKAGE= tests
-TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/net/${.CURDIR:T}
-
.include <bsd.own.mk>
BINDIR= ${TESTSDIR}
-NETBSD_ATF_TESTS_SH= getaddrinfo_test
+ATF_TESTS_SH= getaddrinfo_test
ATF_TESTS_C= getaddrinfo
PROGS= h_gai
@@ -16,13 +14,33 @@ ${PACKAGE}DATA_FILESPACKAGE= tests
${PACKAGE}DATA_FILESDIR= ${TESTSDIR}/data
-${PACKAGE}DATA_FILES+= basics_v4.exp basics_v4v6.exp
-${PACKAGE}DATA_FILES+= no_host_v4.exp no_host_v4v6.exp
-${PACKAGE}DATA_FILES+= no_serv_v4.exp no_serv_v4v6.exp
-${PACKAGE}DATA_FILES+= sock_raw_v4.exp sock_raw_v4v6.exp
-${PACKAGE}DATA_FILES+= spec_fam_v4.exp spec_fam_v4v6.exp
-${PACKAGE}DATA_FILES+= scoped.exp
-${PACKAGE}DATA_FILES+= unsup_fam.exp
+${PACKAGE}DATA_FILES+= data/basics_v4.exp
+${PACKAGE}DATA_FILES+= data/basics_v4_only.exp
+${PACKAGE}DATA_FILES+= data/basics_v4v6.exp
+${PACKAGE}DATA_FILES+= data/basics_v4v6_prefer_v4.exp
+${PACKAGE}DATA_FILES+= data/no_host_v4.exp
+${PACKAGE}DATA_FILES+= data/no_host_v4_only.exp
+${PACKAGE}DATA_FILES+= data/no_host_v4v6.exp
+${PACKAGE}DATA_FILES+= data/no_host_v4v6_prefer_v4.exp
+${PACKAGE}DATA_FILES+= data/no_serv_v4.exp
+${PACKAGE}DATA_FILES+= data/no_serv_v4_only.exp
+${PACKAGE}DATA_FILES+= data/no_serv_v4v6.exp
+${PACKAGE}DATA_FILES+= data/no_serv_v4v6_prefer_v4.exp
+${PACKAGE}DATA_FILES+= data/scoped.exp
+${PACKAGE}DATA_FILES+= data/scoped_v4_only.exp
+${PACKAGE}DATA_FILES+= data/scoped_v4v6_prefer_v4.exp
+${PACKAGE}DATA_FILES+= data/sock_raw_v4.exp
+${PACKAGE}DATA_FILES+= data/sock_raw_v4_only.exp
+${PACKAGE}DATA_FILES+= data/sock_raw_v4v6.exp
+${PACKAGE}DATA_FILES+= data/sock_raw_v4v6_prefer_v4.exp
+${PACKAGE}DATA_FILES+= data/spec_fam_v4.exp
+${PACKAGE}DATA_FILES+= data/spec_fam_v4_only.exp
+${PACKAGE}DATA_FILES+= data/spec_fam_v4v6.exp
+${PACKAGE}DATA_FILES+= data/spec_fam_v4v6_prefer_v4.exp
+${PACKAGE}DATA_FILES+= data/unsup_fam.exp
+${PACKAGE}DATA_FILES+= data/unsup_fam_v4_only.exp
+${PACKAGE}DATA_FILES+= data/unsup_fam_v4v6_prefer_v4.exp
+
.include "../../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/net/getaddrinfo/basics_v4.exp b/lib/libc/tests/net/getaddrinfo/data/basics_v4.exp
index 4f1ee3517211..4f1ee3517211 100644
--- a/lib/libc/tests/net/getaddrinfo/basics_v4.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/basics_v4.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/basics_v4_only.exp b/lib/libc/tests/net/getaddrinfo/data/basics_v4_only.exp
new file mode 100644
index 000000000000..0a37d3212649
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/basics_v4_only.exp
@@ -0,0 +1,50 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+ai4: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai5: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai6: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv tftp
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+ai3: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai4: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv echo
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv echo
+ai4: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai5: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai6: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv echo
+
diff --git a/lib/libc/tests/net/getaddrinfo/basics_v4v6.exp b/lib/libc/tests/net/getaddrinfo/data/basics_v4v6.exp
index b74758e93e2e..b74758e93e2e 100644
--- a/lib/libc/tests/net/getaddrinfo/basics_v4v6.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/basics_v4v6.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/basics_v4v6_prefer_v4.exp b/lib/libc/tests/net/getaddrinfo/data/basics_v4v6_prefer_v4.exp
new file mode 100644
index 000000000000..0a37d3212649
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/basics_v4v6_prefer_v4.exp
@@ -0,0 +1,50 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+ai4: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai5: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai6: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv tftp
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv tftp
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+ai3: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai4: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv echo
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv echo
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv echo
+ai4: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai5: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai6: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv echo
+
diff --git a/lib/libc/tests/net/getaddrinfo/data/generate_testdata.sh b/lib/libc/tests/net/getaddrinfo/data/generate_testdata.sh
new file mode 100755
index 000000000000..f0425a3b0283
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/generate_testdata.sh
@@ -0,0 +1,45 @@
+#service ip6addrctl prefer_ipv4
+TEST=./h_gai
+family=v4_only
+
+( $TEST ::1 http
+ $TEST 127.0.0.1 http
+ $TEST localhost http
+ $TEST ::1 tftp
+ $TEST 127.0.0.1 tftp
+ $TEST localhost tftp
+ $TEST ::1 echo
+ $TEST 127.0.0.1 echo
+ $TEST localhost echo ) > basics_${family}.exp
+
+( $TEST -4 localhost http
+ $TEST -6 localhost http ) > spec_fam_${family}.exp
+
+( $TEST '' http
+ $TEST '' echo
+ $TEST '' tftp
+ $TEST '' 80
+ $TEST -P '' http
+ $TEST -P '' echo
+ $TEST -P '' tftp
+ $TEST -P '' 80
+ $TEST -S '' 80
+ $TEST -D '' 80 ) > no_host_${family}.exp
+
+( $TEST ::1 ''
+ $TEST 127.0.0.1 ''
+ $TEST localhost ''
+ $TEST '' '' ) > no_serv_${family}.exp
+
+( $TEST -R -p 0 localhost ''
+ $TEST -R -p 59 localhost ''
+ $TEST -R -p 59 localhost 80
+ $TEST -R -p 59 localhost www
+ $TEST -R -p 59 ::1 '' ) > sock_raw_${family}.exp
+
+( $TEST -f 99 localhost '' ) > unsup_fam_${family}.exp
+
+( $TEST fe80::1%lo0 http
+# IF=`ifconfig -a | grep -v '^ ' | sed -e 's/:.*//' | head -1 | awk '{print $1}'`
+# $TEST fe80::1%$IF http
+) > scoped_${family}.exp
diff --git a/lib/libc/tests/net/getaddrinfo/no_host_v4.exp b/lib/libc/tests/net/getaddrinfo/data/no_host_v4.exp
index 7ed41cd9d88a..7ed41cd9d88a 100644
--- a/lib/libc/tests/net/getaddrinfo/no_host_v4.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/no_host_v4.exp
diff --git a/lib/libc/tests/net/getaddrinfo/no_host_v4v6.exp b/lib/libc/tests/net/getaddrinfo/data/no_host_v4_only.exp
index 596799305117..596799305117 100644
--- a/lib/libc/tests/net/getaddrinfo/no_host_v4v6.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/no_host_v4_only.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/no_host_v4v6.exp b/lib/libc/tests/net/getaddrinfo/data/no_host_v4v6.exp
new file mode 100644
index 000000000000..596799305117
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/no_host_v4v6.exp
@@ -0,0 +1,68 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+ai4: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai5: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai6: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv echo
+ai4: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai5: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+ai6: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+ai3: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+ai4: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai5: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai6: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv http
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv http
+ai3: flags 0x3 family 28 socktype 5 protocol 132 addrlen 28 host :: serv http
+ai4: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai5: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+ai6: flags 0x3 family 2 socktype 5 protocol 132 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv echo
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv echo
+ai3: flags 0x3 family 28 socktype 5 protocol 132 addrlen 28 host :: serv echo
+ai4: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv echo
+ai5: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv echo
+ai6: flags 0x3 family 2 socktype 5 protocol 132 addrlen 16 host 0.0.0.0 serv echo
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv tftp
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv tftp
+ai3: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv tftp
+ai4: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv tftp
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv http
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv http
+ai3: flags 0x3 family 28 socktype 5 protocol 132 addrlen 28 host :: serv http
+ai4: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai5: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+ai6: flags 0x3 family 2 socktype 5 protocol 132 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x2 family 0 socktype 1 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 2 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+
diff --git a/lib/libc/tests/net/getaddrinfo/data/no_host_v4v6_prefer_v4.exp b/lib/libc/tests/net/getaddrinfo/data/no_host_v4v6_prefer_v4.exp
new file mode 100644
index 000000000000..596799305117
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/no_host_v4v6_prefer_v4.exp
@@ -0,0 +1,68 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+ai4: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai5: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai6: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv echo
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv echo
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv echo
+ai4: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv echo
+ai5: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv echo
+ai6: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv echo
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv tftp
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv tftp
+ai3: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv tftp
+ai4: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv tftp
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+ai4: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai5: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai6: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv http
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv http
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv http
+ai3: flags 0x3 family 28 socktype 5 protocol 132 addrlen 28 host :: serv http
+ai4: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai5: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+ai6: flags 0x3 family 2 socktype 5 protocol 132 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv echo
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv echo
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv echo
+ai3: flags 0x3 family 28 socktype 5 protocol 132 addrlen 28 host :: serv echo
+ai4: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv echo
+ai5: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv echo
+ai6: flags 0x3 family 2 socktype 5 protocol 132 addrlen 16 host 0.0.0.0 serv echo
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv tftp
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv tftp
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv tftp
+ai3: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv tftp
+ai4: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv tftp
+
+arg: flags 0x3 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x3 family 28 socktype 2 protocol 17 addrlen 28 host :: serv http
+ai2: flags 0x3 family 28 socktype 1 protocol 6 addrlen 28 host :: serv http
+ai3: flags 0x3 family 28 socktype 5 protocol 132 addrlen 28 host :: serv http
+ai4: flags 0x3 family 2 socktype 2 protocol 17 addrlen 16 host 0.0.0.0 serv http
+ai5: flags 0x3 family 2 socktype 1 protocol 6 addrlen 16 host 0.0.0.0 serv http
+ai6: flags 0x3 family 2 socktype 5 protocol 132 addrlen 16 host 0.0.0.0 serv http
+
+arg: flags 0x2 family 0 socktype 1 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 0 socktype 2 protocol 0 addrlen 0 host (empty) serv 80
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+
diff --git a/lib/libc/tests/net/getaddrinfo/no_serv_v4.exp b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4.exp
index 667234d2161f..667234d2161f 100644
--- a/lib/libc/tests/net/getaddrinfo/no_serv_v4.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/no_serv_v4_only.exp b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4_only.exp
new file mode 100644
index 000000000000..0d28490c8d81
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4_only.exp
@@ -0,0 +1,20 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv 0
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv 0
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv (empty)
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv 0
+ai4: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv 0
+ai5: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv 0
+ai6: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv (empty)
+Name does not resolve
diff --git a/lib/libc/tests/net/getaddrinfo/no_serv_v4v6.exp b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4v6.exp
index 53502547c40e..53502547c40e 100644
--- a/lib/libc/tests/net/getaddrinfo/no_serv_v4v6.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4v6.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/no_serv_v4v6_prefer_v4.exp b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4v6_prefer_v4.exp
new file mode 100644
index 000000000000..0d28490c8d81
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/no_serv_v4v6_prefer_v4.exp
@@ -0,0 +1,20 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv 0
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv 0
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host 127.0.0.1 serv (empty)
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv 0
+ai4: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv 0
+ai5: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv 0
+ai6: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv (empty)
+Name does not resolve
diff --git a/lib/libc/tests/net/getaddrinfo/scoped.exp b/lib/libc/tests/net/getaddrinfo/data/scoped.exp
index f5ddb4bf6feb..f5ddb4bf6feb 100644
--- a/lib/libc/tests/net/getaddrinfo/scoped.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/scoped.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/scoped_v4_only.exp b/lib/libc/tests/net/getaddrinfo/data/scoped_v4_only.exp
new file mode 100644
index 000000000000..f5ddb4bf6feb
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/scoped_v4_only.exp
@@ -0,0 +1,5 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host fe80::1%lo0 serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host fe80::1%lo0 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host fe80::1%lo0 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host fe80::1%lo0 serv http
+
diff --git a/lib/libc/tests/net/getaddrinfo/data/scoped_v4v6_prefer_v4.exp b/lib/libc/tests/net/getaddrinfo/data/scoped_v4v6_prefer_v4.exp
new file mode 100644
index 000000000000..f5ddb4bf6feb
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/scoped_v4v6_prefer_v4.exp
@@ -0,0 +1,5 @@
+arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host fe80::1%lo0 serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host fe80::1%lo0 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host fe80::1%lo0 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host fe80::1%lo0 serv http
+
diff --git a/lib/libc/tests/net/getaddrinfo/sock_raw_v4.exp b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4.exp
index 021038b81dcc..021038b81dcc 100644
--- a/lib/libc/tests/net/getaddrinfo/sock_raw_v4.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4_only.exp b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4_only.exp
new file mode 100644
index 000000000000..932c1faab0d3
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4_only.exp
@@ -0,0 +1,15 @@
+arg: flags 0x2 family 0 socktype 3 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 3 protocol 0 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 28 socktype 3 protocol 0 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 3 protocol 59 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 28 socktype 3 protocol 59 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv 80
+Service was not recognized for socket type
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv www
+Service was not recognized for socket type
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 28 socktype 3 protocol 59 addrlen 28 host ::1 serv 0
+
diff --git a/lib/libc/tests/net/getaddrinfo/sock_raw_v4v6.exp b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4v6.exp
index e494271a3d35..e494271a3d35 100644
--- a/lib/libc/tests/net/getaddrinfo/sock_raw_v4v6.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4v6.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4v6_prefer_v4.exp b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4v6_prefer_v4.exp
new file mode 100644
index 000000000000..932c1faab0d3
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/sock_raw_v4v6_prefer_v4.exp
@@ -0,0 +1,15 @@
+arg: flags 0x2 family 0 socktype 3 protocol 0 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 3 protocol 0 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 28 socktype 3 protocol 0 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv (empty)
+ai1: flags 0x2 family 2 socktype 3 protocol 59 addrlen 16 host 127.0.0.1 serv 0
+ai2: flags 0x2 family 28 socktype 3 protocol 59 addrlen 28 host ::1 serv 0
+
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv 80
+Service was not recognized for socket type
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host localhost serv www
+Service was not recognized for socket type
+arg: flags 0x2 family 0 socktype 3 protocol 59 addrlen 0 host ::1 serv (empty)
+ai1: flags 0x2 family 28 socktype 3 protocol 59 addrlen 28 host ::1 serv 0
+
diff --git a/lib/libc/tests/net/getaddrinfo/spec_fam_v4.exp b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4.exp
index 924d2a16f47c..924d2a16f47c 100644
--- a/lib/libc/tests/net/getaddrinfo/spec_fam_v4.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4.exp
diff --git a/lib/libc/tests/net/getaddrinfo/spec_fam_v4v6.exp b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4_only.exp
index af3506938503..af3506938503 100644
--- a/lib/libc/tests/net/getaddrinfo/spec_fam_v4v6.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4_only.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6.exp b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6.exp
new file mode 100644
index 000000000000..af3506938503
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6.exp
@@ -0,0 +1,10 @@
+arg: flags 0x2 family 2 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 28 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+
diff --git a/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6_prefer_v4.exp b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6_prefer_v4.exp
new file mode 100644
index 000000000000..af3506938503
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/spec_fam_v4v6_prefer_v4.exp
@@ -0,0 +1,10 @@
+arg: flags 0x2 family 2 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 2 socktype 2 protocol 17 addrlen 16 host 127.0.0.1 serv http
+ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv http
+ai3: flags 0x2 family 2 socktype 5 protocol 132 addrlen 16 host 127.0.0.1 serv http
+
+arg: flags 0x2 family 28 socktype 0 protocol 0 addrlen 0 host localhost serv http
+ai1: flags 0x2 family 28 socktype 2 protocol 17 addrlen 28 host ::1 serv http
+ai2: flags 0x2 family 28 socktype 1 protocol 6 addrlen 28 host ::1 serv http
+ai3: flags 0x2 family 28 socktype 5 protocol 132 addrlen 28 host ::1 serv http
+
diff --git a/lib/libc/tests/net/getaddrinfo/unsup_fam.exp b/lib/libc/tests/net/getaddrinfo/data/unsup_fam.exp
index 69e6b48a854b..69e6b48a854b 100644
--- a/lib/libc/tests/net/getaddrinfo/unsup_fam.exp
+++ b/lib/libc/tests/net/getaddrinfo/data/unsup_fam.exp
diff --git a/lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4_only.exp b/lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4_only.exp
new file mode 100644
index 000000000000..69e6b48a854b
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4_only.exp
@@ -0,0 +1,2 @@
+arg: flags 0x2 family 99 socktype 0 protocol 0 addrlen 0 host localhost serv (empty)
+Address family not recognized
diff --git a/lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4v6_prefer_v4.exp b/lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4v6_prefer_v4.exp
new file mode 100644
index 000000000000..69e6b48a854b
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/data/unsup_fam_v4v6_prefer_v4.exp
@@ -0,0 +1,2 @@
+arg: flags 0x2 family 99 socktype 0 protocol 0 addrlen 0 host localhost serv (empty)
+Address family not recognized
diff --git a/lib/libc/tests/net/getaddrinfo/getaddrinfo_test.sh b/lib/libc/tests/net/getaddrinfo/getaddrinfo_test.sh
new file mode 100755
index 000000000000..dd17ab2e3f4a
--- /dev/null
+++ b/lib/libc/tests/net/getaddrinfo/getaddrinfo_test.sh
@@ -0,0 +1,443 @@
+# $NetBSD: t_getaddrinfo.sh,v 1.2 2011/06/15 07:54:32 jmmv Exp $
+
+#
+# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, and 2002 WIDE Project.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+if [ "$(sysctl -i -n kern.features.vimage)" != 1 ]; then
+ atf_skip "This test requires VIMAGE"
+fi
+
+vnet_mkjail()
+{
+ jailname=getaddrinfo_test_$1
+ jail -c name=${jailname} persist vnet
+ ifconfig -j ${jailname} lo0 inet 127.0.0.1/8
+ # For those machines not support IPv6
+ ifconfig -j ${jailname} lo0 inet6 ::1/64 || true
+ service -j ${jailname} ip6addrctl $2 || true
+}
+
+vnet_cleanup()
+{
+ jailname=getaddrinfo_test_$1
+ jail -r ${jailname}
+}
+
+check_output()
+{
+ if [ "$2" = "none" ]; then
+ if [ "$3" = "prefer_v6" ]; then
+ exp="${1}.exp"
+ else
+ exp="${1}_v4_only.exp"
+ fi
+ elif [ "$2" = "hosts" ]; then
+ lcl=$(cat /etc/hosts | sed -e 's/#.*$//' -e 's/[ ][ ]*/ /g' | awk '/ localhost($| )/ {printf "%s ", $1}')
+ if [ "${lcl%*::*}" = "${lcl}" ]; then
+ exp="${1}_v4_only.exp"
+ else
+ if [ "$3" = "prefer_v6" ]; then
+ exp="${1}_v4v6.exp"
+ else
+ exp="${1}_v4v6_prefer_v4.exp"
+ fi
+ fi
+ elif [ "$2" = "ifconfig" ]; then
+ lcl=$(ifconfig lo0 | grep inet6)
+ if [ -n "${lcl}" ]; then
+ if [ "$3" = "prefer_v6" ]; then
+ exp="${1}_v4v6.exp"
+ else
+ exp="${1}_v4v6_prefer_v4.exp"
+ fi
+ else
+ exp="${1}_v4_only.exp"
+ fi
+ else
+ atf_fail "Invalid family_match_type $2 requested."
+ fi
+
+ cmp -s "$(atf_get_srcdir)/data/${exp}" out && return
+ diff -u "$(atf_get_srcdir)/data/${exp}" out || atf_fail "Actual output does not match expected output"
+}
+
+atf_test_case basic_prefer_v4 cleanup
+basic_prefer_v4_head()
+{
+ atf_set "descr" "Testing basic ones with prefer_v4"
+ atf_set "require.user" "root"
+}
+basic_prefer_v4_body()
+{
+ vnet_mkjail basic_prefer_v4 prefer_ipv4
+ TEST="jexec getaddrinfo_test_basic_prefer_v4 $(atf_get_srcdir)/h_gai"
+
+ ( $TEST ::1 http
+ $TEST 127.0.0.1 http
+ $TEST localhost http
+ $TEST ::1 tftp
+ $TEST 127.0.0.1 tftp
+ $TEST localhost tftp
+ $TEST ::1 echo
+ $TEST 127.0.0.1 echo
+ $TEST localhost echo ) > out 2>&1
+
+ check_output basics hosts prefer_v4
+}
+basic_prefer_v4_cleanup()
+{
+ vnet_cleanup basic_prefer_v4
+}
+
+atf_test_case basic cleanup
+basic_head()
+{
+ atf_set "descr" "Testing basic ones with prefer_v6"
+ atf_set "require.user" "root"
+}
+basic_body()
+{
+ vnet_mkjail basic prefer_ipv6
+ TEST="jexec getaddrinfo_test_basic $(atf_get_srcdir)/h_gai"
+
+ ( $TEST ::1 http
+ $TEST 127.0.0.1 http
+ $TEST localhost http
+ $TEST ::1 tftp
+ $TEST 127.0.0.1 tftp
+ $TEST localhost tftp
+ $TEST ::1 echo
+ $TEST 127.0.0.1 echo
+ $TEST localhost echo ) > out 2>&1
+
+ check_output basics ifconfig prefer_v6
+}
+basic_cleanup()
+{
+ vnet_cleanup basic
+}
+
+atf_test_case specific_prefer_v4 cleanup
+specific_prefer_v4_head()
+{
+ atf_set "descr" "Testing specific address family with prefer_v4"
+ atf_set "require.user" "root"
+}
+specific_prefer_v4_body()
+{
+ vnet_mkjail specific_prefer_v4 prefer_ipv4
+ TEST="jexec getaddrinfo_test_specific_prefer_v4 $(atf_get_srcdir)/h_gai"
+
+ ( $TEST -4 localhost http
+ $TEST -6 localhost http ) > out 2>&1
+
+ check_output spec_fam hosts prefer_v4
+}
+specific_prefer_v4_cleanup()
+{
+ vnet_cleanup specific_prefer_v4
+}
+
+atf_test_case specific cleanup
+specific_head()
+{
+ atf_set "descr" "Testing specific address family with prefer_v6"
+ atf_set "require.user" "root"
+}
+specific_body()
+{
+ vnet_mkjail specific prefer_ipv6
+ TEST="jexec getaddrinfo_test_specific $(atf_get_srcdir)/h_gai"
+
+ ( $TEST -4 localhost http
+ $TEST -6 localhost http ) > out 2>&1
+
+ check_output spec_fam hosts prefer_v6
+}
+specific_cleanup()
+{
+ vnet_cleanup specific
+}
+
+atf_test_case empty_hostname_prefer_v4 cleanup
+empty_hostname_prefer_v4_head()
+{
+ atf_set "descr" "Testing empty hostname with prefer_v4"
+ atf_set "require.user" "root"
+}
+empty_hostname_prefer_v4_body()
+{
+ vnet_mkjail empty_hostname_prefer_v4 prefer_ipv4
+ TEST="jexec getaddrinfo_test_empty_hostname_prefer_v4 $(atf_get_srcdir)/h_gai"
+
+ ( $TEST '' http
+ $TEST '' echo
+ $TEST '' tftp
+ $TEST '' 80
+ $TEST -P '' http
+ $TEST -P '' echo
+ $TEST -P '' tftp
+ $TEST -P '' 80
+ $TEST -S '' 80
+ $TEST -D '' 80 ) > out 2>&1
+
+ check_output no_host ifconfig prefer_v4
+}
+empty_hostname_prefer_v4_cleanup()
+{
+ vnet_cleanup empty_hostname_prefer_v4
+}
+
+atf_test_case empty_hostname cleanup
+empty_hostname_head()
+{
+ atf_set "descr" "Testing empty hostname with prefer_v6"
+ atf_set "require.user" "root"
+}
+empty_hostname_body()
+{
+ vnet_mkjail empty_hostname prefer_ipv6
+ TEST="jexec getaddrinfo_test_empty_hostname $(atf_get_srcdir)/h_gai"
+
+ ( $TEST '' http
+ $TEST '' echo
+ $TEST '' tftp
+ $TEST '' 80
+ $TEST -P '' http
+ $TEST -P '' echo
+ $TEST -P '' tftp
+ $TEST -P '' 80
+ $TEST -S '' 80
+ $TEST -D '' 80 ) > out 2>&1
+
+ check_output no_host ifconfig prefer_v6
+}
+empty_hostname_cleanup()
+{
+ vnet_cleanup empty_hostname
+}
+
+atf_test_case empty_servname_prefer_v4 cleanup
+empty_servname_prefer_v4_head()
+{
+ atf_set "descr" "Testing empty service name with prefer_v4"
+ atf_set "require.user" "root"
+}
+empty_servname_prefer_v4_body()
+{
+ vnet_mkjail empty_servname_prefer_v4 prefer_ipv4
+ TEST="jexec getaddrinfo_test_empty_servname_prefer_v4 $(atf_get_srcdir)/h_gai"
+
+ ( $TEST ::1 ''
+ $TEST 127.0.0.1 ''
+ $TEST localhost ''
+ $TEST '' '' ) > out 2>&1
+
+ check_output no_serv hosts prefer_v4
+}
+empty_servname_prefer_v4_cleanup()
+{
+ vnet_cleanup empty_servname_prefer_v4
+}
+
+atf_test_case empty_servname cleanup
+empty_servname_head()
+{
+ atf_set "descr" "Testing empty service name with prefer_v6"
+ atf_set "require.user" "root"
+}
+empty_servname_body()
+{
+ vnet_mkjail empty_servname prefer_ipv6
+ TEST="jexec getaddrinfo_test_empty_servname $(atf_get_srcdir)/h_gai"
+
+ ( $TEST ::1 ''
+ $TEST 127.0.0.1 ''
+ $TEST localhost ''
+ $TEST '' '' ) > out 2>&1
+
+ check_output no_serv ifconfig prefer_v6
+}
+empty_servname_cleanup()
+{
+ vnet_cleanup empty_servname
+}
+
+atf_test_case sock_raw_prefer_v4 cleanup
+sock_raw_prefer_v4_head()
+{
+ atf_set "descr" "Testing raw socket with prefer_v4"
+ atf_set "require.user" "root"
+}
+sock_raw_prefer_v4_body()
+{
+ vnet_mkjail sock_raw_prefer_v4 prefer_ipv4
+ TEST="jexec getaddrinfo_test_sock_raw_prefer_v4 $(atf_get_srcdir)/h_gai"
+
+ ( $TEST -R -p 0 localhost ''
+ $TEST -R -p 59 localhost ''
+ $TEST -R -p 59 localhost 80
+ $TEST -R -p 59 localhost www
+ $TEST -R -p 59 ::1 '' ) > out 2>&1
+
+ check_output sock_raw hosts prefer_v4
+}
+sock_raw_prefer_v4_cleanup()
+{
+ vnet_cleanup sock_raw_prefer_v4
+}
+
+atf_test_case sock_raw cleanup
+sock_raw_head()
+{
+ atf_set "descr" "Testing raw socket with prefer_v6"
+ atf_set "require.user" "root"
+}
+sock_raw_body()
+{
+ vnet_mkjail sock_raw prefer_ipv6
+ TEST="jexec getaddrinfo_test_sock_raw $(atf_get_srcdir)/h_gai"
+
+ ( $TEST -R -p 0 localhost ''
+ $TEST -R -p 59 localhost ''
+ $TEST -R -p 59 localhost 80
+ $TEST -R -p 59 localhost www
+ $TEST -R -p 59 ::1 '' ) > out 2>&1
+
+ check_output sock_raw ifconfig prefer_v6
+}
+sock_raw_cleanup()
+{
+ vnet_cleanup sock_raw
+}
+
+atf_test_case unsupported_family_prefer_v4 cleanup
+unsupported_family_prefer_v4_head()
+{
+ atf_set "descr" "Testing unsupported family with prefer_v4"
+ atf_set "require.user" "root"
+}
+unsupported_family_prefer_v4_body()
+{
+ vnet_mkjail unsupported_family_prefer_v4 prefer_ipv4
+ TEST="jexec getaddrinfo_test_unsupported_family_prefer_v4 $(atf_get_srcdir)/h_gai"
+
+ ( $TEST -f 99 localhost '' ) > out 2>&1
+
+ check_output unsup_fam ifconfig prefer_v4
+}
+unsupported_family_prefer_v4_cleanup()
+{
+ vnet_cleanup unsupported_family_prefer_v4
+}
+
+atf_test_case unsupported_family cleanup
+unsupported_family_head()
+{
+ atf_set "descr" "Testing unsupported family with prefer_v6"
+ atf_set "require.user" "root"
+}
+unsupported_family_body()
+{
+ vnet_mkjail unsupported_family prefer_ipv6
+ TEST="jexec getaddrinfo_test_unsupported_family $(atf_get_srcdir)/h_gai"
+
+ ( $TEST -f 99 localhost '' ) > out 2>&1
+
+ check_output unsup_fam none prefer_v6
+}
+unsupported_family_cleanup()
+{
+ vnet_cleanup unsupported_family
+}
+
+atf_test_case scopeaddr_prefer_v4 cleanup
+scopeaddr_prefer_v4_head()
+{
+ atf_set "descr" "Testing scoped address format with prefer_v4"
+ atf_set "require.user" "root"
+}
+scopeaddr_prefer_v4_body()
+{
+ vnet_mkjail scopeaddr_prefer_v4 prefer_ipv4
+ TEST="jexec getaddrinfo_test_scopeaddr_prefer_v4 $(atf_get_srcdir)/h_gai"
+
+ ( $TEST fe80::1%lo0 http
+# IF=ifconfig -a | grep -v '^ ' | sed -e 's/:.*//' | head -1 | awk '{print $1}'
+# $TEST fe80::1%$IF http
+ ) > out 2>&1
+
+ check_output scoped ifconfig prefer_v4
+}
+scopeaddr_prefer_v4_cleanup()
+{
+ vnet_cleanup scopeaddr_prefer_v4
+}
+
+atf_test_case scopeaddr cleanup
+scopeaddr_head()
+{
+ atf_set "descr" "Testing scoped address format with prefer_v6"
+ atf_set "require.user" "root"
+}
+scopeaddr_body()
+{
+ vnet_mkjail scopeaddr prefer_ipv6
+ TEST="jexec getaddrinfo_test_scopeaddr $(atf_get_srcdir)/h_gai"
+
+ ( $TEST fe80::1%lo0 http
+# IF=ifconfig -a | grep -v '^ ' | sed -e 's/:.*//' | head -1 | awk '{print $1}'
+# $TEST fe80::1%$IF http
+ ) > out 2>&1
+
+ check_output scoped none prefer_v6
+}
+scopeaddr_cleanup()
+{
+ vnet_cleanup scopeaddr
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case basic_prefer_v4
+ atf_add_test_case specific_prefer_v4
+ atf_add_test_case empty_hostname_prefer_v4
+ atf_add_test_case empty_servname_prefer_v4
+ atf_add_test_case sock_raw_prefer_v4
+ atf_add_test_case unsupported_family_prefer_v4
+ atf_add_test_case scopeaddr_prefer_v4
+
+ atf_add_test_case basic
+ atf_add_test_case specific
+ atf_add_test_case empty_hostname
+ atf_add_test_case empty_servname
+ atf_add_test_case sock_raw
+ atf_add_test_case unsupported_family
+ atf_add_test_case scopeaddr
+}
diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile
index 6f57b8014a1e..15b8d3844d08 100644
--- a/lib/libc/tests/stdlib/Makefile
+++ b/lib/libc/tests/stdlib/Makefile
@@ -1,6 +1,7 @@
.include <src.opts.mk>
ATF_TESTS_C+= clearenv_test
+ATF_TESTS_C+= cxa_atexit_test
ATF_TESTS_C+= dynthr_test
ATF_TESTS_C+= heapsort_test
ATF_TESTS_C+= libc_exit_test
@@ -58,8 +59,6 @@ PROGS+= h_getopt h_getopt_long
CFLAGS+= -I${.CURDIR}
-CXXSTD.cxa_thread_atexit_test= c++11
-CXXSTD.cxa_thread_atexit_nothr_test= c++11
LIBADD.cxa_thread_atexit_test+= pthread
# Tests that requires Blocks feature
@@ -79,5 +78,6 @@ LIBADD.libc_exit_test+= pthread
LIBADD.strtod_test+= m
SUBDIR+= dynthr_mod
+SUBDIR+= libatexit
.include <bsd.test.mk>
diff --git a/lib/libc/tests/stdlib/cxa_atexit_test.c b/lib/libc/tests/stdlib/cxa_atexit_test.c
new file mode 100644
index 000000000000..7e2cafbce850
--- /dev/null
+++ b/lib/libc/tests/stdlib/cxa_atexit_test.c
@@ -0,0 +1,132 @@
+/*-
+ * Copyright (c) 2025 Kyle Evans <kevans@FreeBSD.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <sys/wait.h>
+
+#include <dlfcn.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <atf-c.h>
+
+#define ARBITRARY_EXIT_CODE 42
+
+static char *
+get_shlib(const char *srcdir)
+{
+ char *shlib;
+
+ shlib = NULL;
+ if (asprintf(&shlib, "%s/libatexit.so", srcdir) < 0)
+ atf_tc_fail("failed to construct path to libatexit.so");
+ return (shlib);
+}
+
+static void
+run_test(const atf_tc_t *tc, bool with_fatal_atexit, bool with_exit)
+{
+ pid_t p;
+ void (*set_fatal_atexit)(bool);
+ void (*set_exit_code)(int);
+ void *hdl;
+ char *shlib;
+
+ shlib = get_shlib(atf_tc_get_config_var(tc, "srcdir"));
+
+ hdl = dlopen(shlib, RTLD_LAZY);
+ ATF_REQUIRE_MSG(hdl != NULL, "dlopen: %s", dlerror());
+
+ free(shlib);
+
+ if (with_fatal_atexit) {
+ set_fatal_atexit = dlsym(hdl, "set_fatal_atexit");
+ ATF_REQUIRE_MSG(set_fatal_atexit != NULL,
+ "set_fatal_atexit: %s", dlerror());
+ }
+ if (with_exit) {
+ set_exit_code = dlsym(hdl, "set_exit_code");
+ ATF_REQUIRE_MSG(set_exit_code != NULL, "set_exit_code: %s",
+ dlerror());
+ }
+
+ p = atf_utils_fork();
+ if (p == 0) {
+ /*
+ * Don't let the child clobber the results file; stderr/stdout
+ * have been replaced by atf_utils_fork() to capture it. We're
+ * intentionally using exit() instead of _exit() here to run
+ * __cxa_finalize at exit, otherwise we'd just leave it be.
+ */
+ closefrom(3);
+
+ if (with_fatal_atexit)
+ set_fatal_atexit(true);
+ if (with_exit)
+ set_exit_code(ARBITRARY_EXIT_CODE);
+
+ dlclose(hdl);
+
+ /*
+ * If the dtor was supposed to exit (most cases), then we should
+ * not have made it to this point. If it's not supposed to
+ * exit, then we just exit with success here because we might
+ * be expecting either a clean exit or a signal on our way out
+ * as the final __cxa_finalize tries to run a callback in the
+ * unloaded DSO.
+ */
+ if (with_exit)
+ exit(1);
+ exit(0);
+ }
+
+ dlclose(hdl);
+ atf_utils_wait(p, with_exit ? ARBITRARY_EXIT_CODE : 0, "", "");
+}
+
+ATF_TC_WITHOUT_HEAD(simple_cxa_atexit);
+ATF_TC_BODY(simple_cxa_atexit, tc)
+{
+ /*
+ * This test exits in a global object's dtor so that we check for our
+ * dtor being run at dlclose() time. If it isn't, then the forked child
+ * will have a chance to exit(1) after dlclose() to raise a failure.
+ */
+ run_test(tc, false, true);
+}
+
+ATF_TC_WITHOUT_HEAD(late_cxa_atexit);
+ATF_TC_BODY(late_cxa_atexit, tc)
+{
+ /*
+ * This test creates another global object during a __cxa_atexit handler
+ * invocation. It's been observed in the wild that we weren't executing
+ * it, then the DSO gets torn down and it was executed at application
+ * exit time instead. In the best case scenario we would crash if
+ * something else hadn't been mapped there.
+ */
+ run_test(tc, true, false);
+}
+
+ATF_TC_WITHOUT_HEAD(late_cxa_atexit_ran);
+ATF_TC_BODY(late_cxa_atexit_ran, tc)
+{
+ /*
+ * This is a slight variation of the previous test where we trigger an
+ * exit() in our late-registered __cxa_atexit handler so that we can
+ * ensure it was ran *before* dlclose() finished and not through some
+ * weird chain of events afterwards.
+ */
+ run_test(tc, true, true);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, simple_cxa_atexit);
+ ATF_TP_ADD_TC(tp, late_cxa_atexit);
+ ATF_TP_ADD_TC(tp, late_cxa_atexit_ran);
+ return (atf_no_error());
+}
diff --git a/lib/libc/tests/stdlib/libatexit/Makefile b/lib/libc/tests/stdlib/libatexit/Makefile
new file mode 100644
index 000000000000..9ba04c77af62
--- /dev/null
+++ b/lib/libc/tests/stdlib/libatexit/Makefile
@@ -0,0 +1,11 @@
+SHLIB_CXX= libatexit
+SHLIB_NAME= libatexit.so
+SHLIB_MAJOR= 1
+SHLIBDIR= ${TESTSDIR}
+PACKAGE= tests
+SRCS= libatexit.cc
+
+TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/:H}
+
+
+.include <bsd.lib.mk>
diff --git a/lib/libc/tests/stdlib/libatexit/libatexit.cc b/lib/libc/tests/stdlib/libatexit/libatexit.cc
new file mode 100644
index 000000000000..bb286c97e421
--- /dev/null
+++ b/lib/libc/tests/stdlib/libatexit/libatexit.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2025 Kyle Evans <kevans@FreeBSD.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ */
+
+#include <unistd.h>
+
+static int exit_code = -1;
+static bool fatal_atexit;
+
+extern "C" {
+ void set_fatal_atexit(bool);
+ void set_exit_code(int);
+}
+
+void
+set_fatal_atexit(bool fexit)
+{
+ fatal_atexit = fexit;
+}
+
+void
+set_exit_code(int code)
+{
+ exit_code = code;
+}
+
+struct other_object {
+ ~other_object() {
+
+ /*
+ * In previous versions of our __cxa_atexit handling, we would
+ * never actually execute this handler because it's added during
+ * ~object() below; __cxa_finalize would never revisit it. We
+ * will allow the caller to configure us to exit with a certain
+ * exit code so that it can run us twice: once to ensure we
+ * don't crash at the end, and again to make sure the handler
+ * actually ran.
+ */
+ if (exit_code != -1)
+ _exit(exit_code);
+ }
+};
+
+void
+create_staticobj()
+{
+ static other_object obj;
+}
+
+struct object {
+ ~object() {
+ /*
+ * If we're doing the fatal_atexit behavior (i.e., create an
+ * object that will add its own dtor for __cxa_finalize), then
+ * we don't exit here.
+ */
+ if (fatal_atexit)
+ create_staticobj();
+ else if (exit_code != -1)
+ _exit(exit_code);
+ }
+};
+
+static object obj;
diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc
index c472e8b741be..e7db5a469661 100644
--- a/lib/libclang_rt/Makefile.inc
+++ b/lib/libclang_rt/Makefile.inc
@@ -33,4 +33,3 @@ CXXFLAGS+= -fvisibility-inlines-hidden
CXXFLAGS+= -fvisibility=hidden
CFLAGS+= -I${CRTSRC}/include
CFLAGS+= -I${CRTSRC}/lib
-CXXSTD= c++17
diff --git a/lib/libcom_err/Makefile b/lib/libcom_err/Makefile
index 2bfd26bae968..f070fd534469 100644
--- a/lib/libcom_err/Makefile
+++ b/lib/libcom_err/Makefile
@@ -7,7 +7,7 @@ MAN= com_err.3
COM_ERRDIR= ${SRCTOP}/contrib/com_err
CFLAGS+= -I${COM_ERRDIR}
-LDFLAGS= -Wl,--no-undefined
+LDFLAGS+= -Wl,--no-undefined
VERSION_MAP= ${COM_ERRDIR}/version-script.map
.include <bsd.lib.mk>
diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile
index 7a683ba779f6..0f203b3a7cb1 100644
--- a/lib/libcxxrt/Makefile
+++ b/lib/libcxxrt/Makefile
@@ -23,7 +23,6 @@ SRCS+= typeinfo.cc
WARNS?= 0
CFLAGS+= -isystem ${SRCDIR} -nostdinc++
-CXXSTD?= c++14
.if exists(Version.map.${MACHINE})
VERSION_MAP= ${.CURDIR}/Version.map.${MACHINE}
diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h
index 2bb52a4baa03..748f75ee157d 100644
--- a/lib/libexpat/expat_config.h
+++ b/lib/libexpat/expat_config.h
@@ -89,7 +89,7 @@
#define PACKAGE_NAME "expat"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "expat 2.6.4"
+#define PACKAGE_STRING "expat 2.7.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "expat"
@@ -98,7 +98,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "2.6.4"
+#define PACKAGE_VERSION "2.7.1"
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
@@ -106,7 +106,7 @@
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "2.6.4"
+#define VERSION "2.7.1"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3
index 21c07d39e5e2..c91184840b70 100644
--- a/lib/libexpat/libbsdxml.3
+++ b/lib/libexpat/libbsdxml.3
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"/
-.Dd December 8, 2024
+.Dd April 7, 2025
.Dt LIBBSDXML 3
.Os
.Sh NAME
@@ -34,7 +34,7 @@
.Sh DESCRIPTION
The
.Nm
-library is a verbatim copy of the eXpat XML library version 2.6.4.
+library is a verbatim copy of the eXpat XML library version 2.7.1.
.Pp
The
.Nm
diff --git a/lib/libgcc_eh/Makefile.inc b/lib/libgcc_eh/Makefile.inc
index af59ee7aaa65..529ef7170485 100644
--- a/lib/libgcc_eh/Makefile.inc
+++ b/lib/libgcc_eh/Makefile.inc
@@ -38,7 +38,6 @@ CFLAGS+= -I${UNWINDINCDIR}
CFLAGS+= -D_LIBUNWIND_IS_NATIVE_ONLY
CFLAGS+= -D_LIBUNWIND_USE_FRAME_HEADER_CACHE
CXXFLAGS+= -fno-rtti
-CXXSTD?= c++11
STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC
# Probably need to just move this earlier or use CXXFLAGS
.if ${MK_DIRDEPS_BUILD} == "yes"
diff --git a/lib/libomp/Makefile b/lib/libomp/Makefile
index 6c14c7d21077..f1513e70f3f6 100644
--- a/lib/libomp/Makefile
+++ b/lib/libomp/Makefile
@@ -57,7 +57,6 @@ CFLAGS+= -fdata-sections
CXXFLAGS+= -fvisibility-inlines-hidden
CXXFLAGS+= -fno-exceptions
CXXFLAGS+= -fno-rtti
-CXXSTD= c++17
.if ${COMPILER_TYPE} == "clang"
.if ${MACHINE_CPUARCH} == "i386"
diff --git a/lib/libsys/fhopen.2 b/lib/libsys/fhopen.2
index 5bd1e9f8d90b..aba53f1dd907 100644
--- a/lib/libsys/fhopen.2
+++ b/lib/libsys/fhopen.2
@@ -31,7 +31,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd June 29, 1999
+.Dd April 6, 2025
.Dt FHOPEN 2
.Os
.Sh NAME
@@ -75,6 +75,10 @@ together the flags used for the
system call.
All said flags are valid except for
.Dv O_CREAT .
+If the file handle refers to a named attribute or named attribute
+directory, the
+.Dv O_NAMEDATTR
+flag must be specified.
.Pp
The
.Fn fhstat
@@ -116,6 +120,16 @@ Calling
with
.Dv O_CREAT
set.
+.It Bq Er ENOATTR
+The file handle does not refer to a named attribute or named attribute
+directory although the
+.Dv O_NAMEDATTR
+flag was specified.
+.It Bq Er ENOATTR
+The file handle refers to a named attribute or named attribute directory
+although the
+.Dv O_NAMEDATTR
+flag was not specified.
.It Bq Er ESTALE
The file handle
.Fa fhp
@@ -125,7 +139,8 @@ is no longer valid.
.Xr fstat 2 ,
.Xr fstatfs 2 ,
.Xr getfh 2 ,
-.Xr open 2
+.Xr open 2 ,
+.Xr named_attribute 9
.Sh HISTORY
The
.Fn fhopen ,
diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2
index b411b3b6ff46..49e8b5120558 100644
--- a/lib/libsys/statfs.2
+++ b/lib/libsys/statfs.2
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd March 29, 2023
+.Dd April 7, 2025
.Dt STATFS 2
.Os
.Sh NAME
@@ -125,6 +125,9 @@ The file system resides locally.
Mandatory Access Control (MAC) support for individual objects
(see
.Xr mac 4 ) .
+.It Dv MNT_NAMEDATTR
+The file system supports named attributes as described in
+.Xr named_attribute 9 .
.It Dv MNT_NFS4ACLS
ACLs in NFSv4 variant are supported.
.It Dv MNT_NOATIME
@@ -260,7 +263,8 @@ each file or directory name or disk label
.Pc .
.Sh SEE ALSO
.Xr fhstatfs 2 ,
-.Xr getfsstat 2
+.Xr getfsstat 2 ,
+.Xr named_attribute 9
.Sh HISTORY
The
.Fn statfs
diff --git a/lib/libutil/kinfo_getfile.c b/lib/libutil/kinfo_getfile.c
index f1441bdf771a..345da657df81 100644
--- a/lib/libutil/kinfo_getfile.c
+++ b/lib/libutil/kinfo_getfile.c
@@ -27,6 +27,10 @@ kinfo_getfile(pid_t pid, int *cntp)
error = sysctl(mib, nitems(mib), NULL, &len, NULL, 0);
if (error)
return (NULL);
+ /*
+ * Add extra space as the table may grow between requesting the size
+ * and fetching the data.
+ */
len = len * 4 / 3;
buf = malloc(len);
if (buf == NULL)
diff --git a/lib/ofed/libibnetdisc/Makefile b/lib/ofed/libibnetdisc/Makefile
index d3e0dd92509a..aac0bf0f5971 100644
--- a/lib/ofed/libibnetdisc/Makefile
+++ b/lib/ofed/libibnetdisc/Makefile
@@ -29,7 +29,6 @@ LIBADD= osmcomp ibmad ibumad
CFLAGS+= -DHAVE_CONFIG_H=1
CFLAGS+= -I${_spath}
CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband
-CXXSTD= c++11
VERSION_MAP= ${_spath}/libibnetdisc.map
.include <bsd.lib.mk>
diff --git a/libexec/atf/atf-pytest-wrapper/Makefile b/libexec/atf/atf-pytest-wrapper/Makefile
index e4dc0f8a5fd1..80b5e411ec4e 100644
--- a/libexec/atf/atf-pytest-wrapper/Makefile
+++ b/libexec/atf/atf-pytest-wrapper/Makefile
@@ -4,7 +4,6 @@
PACKAGE= tests
PROG_CXX= atf_pytest_wrapper
SRCS= atf_pytest_wrapper.cpp
-CXXSTD= c++17
MAN=
.include <bsd.prog.mk>
diff --git a/release/Makefile.inc1 b/release/Makefile.inc1
index 552b6cb60f3c..569b72df5106 100644
--- a/release/Makefile.inc1
+++ b/release/Makefile.inc1
@@ -1,6 +1,3 @@
-#
-#
-
# Figure out where the git binary is.
.for _P in /usr/bin /usr/local/bin
. if !defined(GIT_CMD) || empty(GIT_CMD)
@@ -24,13 +21,19 @@ GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null ||
GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --first-parent --count HEAD 2>/dev/null || true
. export GITCOUNT
. endif
+. if !defined(GITEPOCH) || empty(GITEPOCH)
+GITEPOCH!= ${GIT_CMD} -C ${.CURDIR} show -s --format=%ct HEAD 2>/dev/null || true
+. export GITEPOCH
+. endif
.else
GITBRANCH= nullbranch
GITREV= nullhash
GITCOUNT= nullcount
+GITEPOCH= 0
. export GITBRANCH
. export GITREV
. export GITCOUNT
+. export GITEPOCH
.endif
# Set the build date, primarily for snapshot builds.
diff --git a/release/Makefile.vm b/release/Makefile.vm
index f58c7c7fd092..0b5f5e714cc5 100644
--- a/release/Makefile.vm
+++ b/release/Makefile.vm
@@ -1,6 +1,4 @@
#
-#
-#
# Makefile for building virtual machine and cloud provider disk images.
#
@@ -107,11 +105,12 @@ QEMUTGT=emulator-portinstall
.endif
QEMUTGT?=
-.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
.if (defined(WITHOUT_QEMU) && !defined(NO_ROOT)) || \
(!defined(WITHOUT_QEMU) && defined(NO_ROOT))
.error WITHOUT_QEMU requires NO_ROOT (and vice versa)
.endif
+
+.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
. for _CW in ${CLOUDWARE}
. if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF)
${_CW:tu}CONF?= ${.CURDIR}/tools/${_CW:tl}.conf
@@ -180,7 +179,9 @@ vm-image: ${QEMUTGT}
mkdir -p ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS}
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \
QEMUSTATIC=${QEMUSTATIC} \
- WITHOUT_QEMU=${WITHOUT_QEMU:Dtrue} \
+ ${WITHOUT_QEMU:DWITHOUT_QEMU=true} \
+ ${NO_ROOT:DNO_ROOT=true} \
+ PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \
${.CURDIR}/scripts/mk-vmimage.sh \
-C ${.CURDIR}/tools/vmimage.subr \
-d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 93988d5ce7a4..cbab3fa2973c 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -90,8 +90,8 @@
cap_channel_t *capsyslog;
-time_t cur_time;
-struct timespec time_now;
+time_t cur_time; /* Seconds since epoch. */
+struct timespec time_now; /* CLOCK_MONOTONIC. */
static time_t default_lease_time = 43200; /* 12 hours... */
const char *path_dhclient_conf = _PATH_DHCLIENT_CONF;
@@ -450,7 +450,7 @@ main(int argc, char *argv[])
tzset();
clock_gettime(CLOCK_MONOTONIC, &time_now);
- cur_time = time_now.tv_sec;
+ cur_time = time(NULL);
inaddr_broadcast.s_addr = INADDR_BROADCAST;
inaddr_any.s_addr = INADDR_ANY;
@@ -1030,13 +1030,13 @@ dhcpoffer(struct packet *packet)
struct client_lease *lease, *lp;
int i;
struct timespec arp_timeout_needed;
- struct timespec stop_selecting = { .tv_sec = 0, .tv_nsec = 0 };
- time_now.tv_sec = cur_time;
- time_now.tv_nsec = 0;
-
+ time_t stop_selecting;
+ struct timespec stop_time;
const char *name = packet->options[DHO_DHCP_MESSAGE_TYPE].len ?
"DHCPOFFER" : "BOOTREPLY";
+ clock_gettime(CLOCK_MONOTONIC, &time_now);
+
/* If we're not receptive to an offer right now, or if the offer
has an unrecognizable transaction id, then just drop it. */
if (ip->client->state != S_SELECTING ||
@@ -1095,7 +1095,7 @@ dhcpoffer(struct packet *packet)
arp_timeout_needed = arp_timeout;
/* Figure out when we're supposed to stop selecting. */
- stop_selecting.tv_sec =
+ stop_selecting =
ip->client->first_sending + ip->client->config->select_interval;
/* If this is the lease we asked for, put it at the head of the
@@ -1116,7 +1116,7 @@ dhcpoffer(struct packet *packet)
timespecadd(&time_now, &arp_timeout_needed, &interm_struct);
if (ip->client->offered_leases &&
- timespeccmp(&interm_struct, &stop_selecting, >))
+ interm_struct.tv_sec >= stop_selecting)
arp_timeout_needed = zero_timespec;
/* Put the lease at the end of the list. */
@@ -1131,27 +1131,21 @@ dhcpoffer(struct packet *packet)
}
}
- /* If we're supposed to stop selecting before we've had time
- to wait for the ARPREPLY, add some delay to wait for
- the ARPREPLY. */
- struct timespec time_left;
- timespecsub(&stop_selecting, &time_now, &time_left);
-
+ /*
+ * Wait until stop_selecting seconds past the epoch, or until
+ * arp_timeout_needed past now, whichever is longer. Note that
+ * the first case only occurs if select-timeout is set to nonzero
+ * in dhclient.conf.
+ */
+ struct timespec time_left =
+ {.tv_sec = stop_selecting - cur_time, .tv_nsec = 0};
if (timespeccmp(&time_left, &arp_timeout_needed, <)) {
- timespecadd(&time_now, &arp_timeout_needed, &stop_selecting);
- }
-
- /* If the selecting interval has expired, go immediately to
- state_selecting(). Otherwise, time out into
- state_selecting at the select interval. */
-
-
- if (timespeccmp(&stop_selecting, &zero_timespec, <=))
- state_selecting(ip);
- else {
- add_timeout_timespec(stop_selecting, state_selecting, ip);
- cancel_timeout(send_discover, ip);
+ timespecadd(&time_now, &arp_timeout_needed, &stop_time);
+ } else {
+ timespecadd(&time_now, &time_left, &stop_time);
}
+ add_timeout_timespec(stop_time, state_selecting, ip);
+ cancel_timeout(send_discover, ip);
}
/* Allocate a client_lease structure and initialize it from the parameters
diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h
index 6f1f6679875c..c61564067598 100644
--- a/sbin/dhclient/dhcpd.h
+++ b/sbin/dhclient/dhcpd.h
@@ -361,8 +361,8 @@ char *piaddr(struct iaddr);
extern cap_channel_t *capsyslog;
extern const char *path_dhclient_conf;
extern char *path_dhclient_db;
-extern struct timespec time_now;
-extern time_t cur_time;
+extern struct timespec time_now; /* CLOCK_MONOTONIC */
+extern time_t cur_time; /* Seconds since epoch */
extern int log_priority;
extern int log_perror;
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index 72230c01a491..06bd31e5ec82 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -159,8 +159,8 @@ dispatch(void)
struct protocol *l;
struct pollfd *fds;
struct timespec howlong;
- time_now.tv_sec = cur_time;
- time_now.tv_nsec = 0;
+
+ clock_gettime(CLOCK_MONOTONIC, &time_now);
for (l = protocols; l; l = l->next)
nfds++;
@@ -224,7 +224,7 @@ another:
if (count == -1) {
if (errno == EAGAIN || errno == EINTR) {
clock_gettime(CLOCK_MONOTONIC, &time_now);
- cur_time = time_now.tv_sec;
+ cur_time = time(NULL);
continue;
} else
error("poll: %m");
@@ -232,7 +232,7 @@ another:
/* Get the current time... */
clock_gettime(CLOCK_MONOTONIC, &time_now);
- cur_time = time_now.tv_sec;
+ cur_time = time(NULL);
i = 0;
for (l = protocols; l; l = l->next) {
@@ -365,7 +365,11 @@ active:
void
add_timeout(time_t when_s, void (*where)(void *), void *what)
{
- struct timespec when = { .tv_sec = when_s, .tv_nsec = 0 };
+ struct timespec when;
+
+ cur_time = time(NULL);
+ clock_gettime(CLOCK_MONOTONIC, &when);
+ when.tv_sec += when_s - cur_time;
add_timeout_timespec(when, where, what);
}
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 656e71e325cd..80633e5e9ffc 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -3138,6 +3138,10 @@ rsn_cipher(const u_int8_t *sel)
return "AES-OCB";
case RSN_SEL(RSN_CSE_GCMP_128):
return "AES-GCMP";
+ case RSN_SEL(RSN_CSE_CCMP_256):
+ return "AES-CCMP-256";
+ case RSN_SEL(RSN_CSE_GCMP_256):
+ return "AES-GCMP-256";
}
return "?";
#undef WPA_SEL
@@ -3154,6 +3158,10 @@ rsn_keymgmt(const u_int8_t *sel)
return "8021X-UNSPEC";
case RSN_SEL(RSN_ASE_8021X_PSK):
return "8021X-PSK";
+ case RSN_SEL(RSN_ASE_8021X_UNSPEC_SHA256):
+ return "8021X-UNSPEC-SHA256";
+ case RSN_SEL(RSN_ASE_8021X_PSK_SHA256):
+ return "8021X-PSK-256";
case RSN_SEL(RSN_ASE_NONE):
return "NONE";
}
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 1362ae43428c..6b85c1b36303 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -4559,7 +4559,8 @@ port_redirspec : no_port_redirspec;
}
/* Redirection with an arrow and an optional port: FreeBSD NAT rules */
-nat_redirspec : ARROW port_redirspec {
+nat_redirspec : /* empty */ { $$ = NULL; }
+ | ARROW port_redirspec {
$$ = $2;
}
;
@@ -5361,8 +5362,9 @@ filter_consistent(struct pfctl_rule *r, int anchor_call)
problems++;
}
}
- /* match rules rules */
- if (r->action == PF_MATCH) {
+ /* Basic rule sanity check. */
+ switch (r->action) {
+ case PF_MATCH:
if (r->divert.port) {
yyerror("divert is not supported on match rules");
problems++;
@@ -5376,6 +5378,15 @@ filter_consistent(struct pfctl_rule *r, int anchor_call)
yyerror("af-to is not supported on match rules");
problems++;
}
+ break;
+ case PF_DROP:
+ if (r->rt) {
+ yyerror("route-to, reply-to and dup-to "
+ "are not supported on block rules");
+ problems++;
+ }
+ break;
+ default:;
}
if (r->rdr.opts & PF_POOL_STICKYADDR && !r->keep_state) {
yyerror("'sticky-address' requires 'keep state'");
diff --git a/sbin/pfctl/tests/files/pf1065.in b/sbin/pfctl/tests/files/pf1065.in
new file mode 100644
index 000000000000..690045befee6
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1065.in
@@ -0,0 +1 @@
+no nat on vtnet0 proto tcp from 2001:db8::1 to 2001:db8::2
diff --git a/sbin/pfctl/tests/files/pf1065.ok b/sbin/pfctl/tests/files/pf1065.ok
new file mode 100644
index 000000000000..651a2fa0ae09
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1065.ok
@@ -0,0 +1 @@
+no nat on vtnet0 inet6 proto tcp from 2001:db8::1 to 2001:db8::2
diff --git a/sbin/pfctl/tests/files/pf1066.in b/sbin/pfctl/tests/files/pf1066.in
new file mode 100644
index 000000000000..e81461c470ab
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1066.in
@@ -0,0 +1 @@
+no rdr on vtnet0 proto tcp from 2001:db8::1 to 2001:db8::2
diff --git a/sbin/pfctl/tests/files/pf1066.ok b/sbin/pfctl/tests/files/pf1066.ok
new file mode 100644
index 000000000000..5ff596fa0158
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1066.ok
@@ -0,0 +1 @@
+no rdr on vtnet0 inet6 proto tcp from 2001:db8::1 to 2001:db8::2
diff --git a/sbin/pfctl/tests/files/pf1067.fail b/sbin/pfctl/tests/files/pf1067.fail
new file mode 100644
index 000000000000..23ac1daad64f
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1067.fail
@@ -0,0 +1 @@
+route-to, reply-to and dup-to are not supported on block rules
diff --git a/sbin/pfctl/tests/files/pf1067.in b/sbin/pfctl/tests/files/pf1067.in
new file mode 100644
index 000000000000..47f3bf6285dd
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1067.in
@@ -0,0 +1 @@
+block in route-to (if0 127.0.0.1/8)
diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc
index c6329b978a21..7e43556d2c4d 100644
--- a/sbin/pfctl/tests/pfctl_test_list.inc
+++ b/sbin/pfctl/tests/pfctl_test_list.inc
@@ -173,3 +173,6 @@ PFCTL_TEST_IFACE(1061, "Interface translation: IPv6 rule, interface without brac
PFCTL_TEST_IFACE(1062, "Interface translation: IPv6 rule, interface without brackets is translated, extra host, round-robin is applied")
PFCTL_TEST_IFACE(1063, "Interface translation: IPv6 rule, interface with brackets is not translated, round-robin is applied")
PFCTL_TEST_IFACE(1064, "Interface translation: IPv6 rule, interface with brackets is not translated, extra host, round robin is applied")
+PFCTL_TEST(1065, "no nat")
+PFCTL_TEST(1066, "no rdr")
+PFCTL_TEST_FAIL(1067, "route-to can't be used on block rules")
diff --git a/sbin/reboot/boot_i386.8 b/sbin/reboot/boot_i386.8
index 5e97a7594684..26dd588fb437 100644
--- a/sbin/reboot/boot_i386.8
+++ b/sbin/reboot/boot_i386.8
@@ -32,7 +32,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 11, 2020
+.Dd April 7, 2025
.Dt BOOT 8 i386
.Os
.Sh NAME
@@ -45,14 +45,14 @@ An automatic consistency check of the file systems will be performed,
and unless this fails, the system will resume multi-user operations.
.Pp
.Sy Cold starts .
-Most i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
+Legacy i386 PCs attempt to boot first from floppy disk drive 0 (sometimes
known as drive A:) and, failing that, from hard disk drive 0 (sometimes
known as drive C:, or as drive 0x80 to the BIOS).
Some BIOSes allow
you to change this default sequence, and may also include a CD-ROM
drive as a boot device.
.Pp
-Some newer PCs boot using UEFI firmware, not BIOS.
+Contemporary PCs boot using UEFI firmware, not BIOS.
That process is described
in
.Xr uefi 8 .
diff --git a/sbin/reboot/reboot.8 b/sbin/reboot/reboot.8
index 59cbd9de7519..0ddcee643244 100644
--- a/sbin/reboot/reboot.8
+++ b/sbin/reboot/reboot.8
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd February 8, 2024
+.Dd April 12, 2025
.Dt REBOOT 8
.Os
.Sh NAME
@@ -213,6 +213,7 @@ reboot -r
.Ed
.Sh SEE ALSO
.Xr kenv 1 ,
+.Xr reboot 2 ,
.Xr getutxent 3 ,
.Xr ipmi 4 ,
.Xr boot 8 ,
diff --git a/share/doc/legal/Makefile b/share/doc/legal/Makefile
index 9467a4ece9a7..a4ac98c4d305 100644
--- a/share/doc/legal/Makefile
+++ b/share/doc/legal/Makefile
@@ -1,6 +1,5 @@
SUBDIR= intel_ipw \
intel_iwi \
- intel_iwlwififw \
intel_iwn \
intel_wpi \
realtek
diff --git a/share/doc/legal/intel_iwlwififw/Makefile b/share/doc/legal/intel_iwlwififw/Makefile
deleted file mode 100644
index 87956f8e7a30..000000000000
--- a/share/doc/legal/intel_iwlwififw/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-FILES= ${SRCTOP}/sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware
-FILESDIR= ${SHAREDIR}/doc/legal
-FILESNAME= intel_iwlwifi_firmware.LICENCE
-
-.include <bsd.prog.mk>
diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4
index 5f58a4c1a503..754071e2fad8 100644
--- a/share/man/man4/gve.4
+++ b/share/man/man4/gve.4
@@ -79,6 +79,19 @@ binds to a single PCI device ID presented by gVNIC:
.It
0x1AE0:0x0042
.El
+.Sh EXAMPLES
+.Pp
+Change the TX queue count to 4 for the gve0 interface:
+.D1 sysctl dev.gve.0.num_tx_queues=4
+.Pp
+Change the RX queue count to 4 for the gve0 interface:
+.D1 sysctl dev.gve.0.num_rx_queues=4
+.Pp
+Change the TX ring size to 512 for the gve0 interface:
+.D1 sysctl dev.gve.0.tx_ring_size=512
+.Pp
+Change the RX ring size to 512 for the gve0 interface:
+.D1 sysctl dev.gve.0.rx_ring_size=512
.Sh DIAGNOSTICS
The following messages are recorded during driver initialization:
.Bl -diag
@@ -211,6 +224,29 @@ The default value is 0, which means hardware LRO is enabled by default.
The software LRO stack in the kernel is always used.
This sysctl variable needs to be set before loading the driver, using
.Xr loader.conf 5 .
+.It Va dev.gve.X.num_rx_queues and dev.gve.X.num_tx_queues
+Run-time tunables that represent the number of currently used RX/TX queues.
+The default value is the max number of RX/TX queues the device can support.
+.Pp
+This call turns down the interface while setting up the new queues,
+which may potentially cause any new packets to be dropped.
+This call can fail if the system is not able to provide the driver with enough resources.
+In that situation, the driver will revert to the previous number of RX/TX queues.
+If this also fails, a device reset will be triggered.
+.Pp
+Note: sysctl nodes for queue stats remain available even if a queue is removed.
+.Pp
+.It Va dev.gve.X.rx_ring_size and dev.gve.X.tx_ring_size
+Run-time tunables that represent the current ring size for RX/TX queues.
+The default value is set to device defaults for ring size.
+.Pp
+This call turns down the interface while setting up the queues with the new ring size,
+which may potentially cause any new packets to be dropped.
+This call can fail if the system is not able to provide the driver with enough resources.
+In that situation, the driver will try to revert to the previous ring size for RX/TX queues.
+If this also fails, the device will be in an unhealthy state and will need to be reloaded.
+This value must be a power of 2 and within the defined range.
+.Pp
.El
.Sh LIMITATIONS
.Nm
diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5
index 704f43a30f83..64da49845a32 100644
--- a/share/man/man5/pf.conf.5
+++ b/share/man/man5/pf.conf.5
@@ -27,7 +27,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd February 14, 2025
+.Dd April 9, 2025
.Dt PF.CONF 5
.Os
.Sh NAME
@@ -167,7 +167,7 @@ will be cleared on load.
.El
.Pp
Tables may be defined with the following attributes:
-.Bl -tag -width persist
+.Bl -tag -width counters
.It Ar persist
The
.Ar persist
@@ -1659,10 +1659,6 @@ allows echo requests (such as those created by
out statefully, and matches incoming echo replies correctly to states.
.Pp
Also, looking up states is usually faster than evaluating rules.
-If there are 50 rules, all of them are evaluated sequentially in O(n).
-Even with 50000 states, only 16 comparisons are needed to match a
-state, since states are stored in a binary search tree that allows
-searches in O(log2 n).
.Pp
Furthermore, correct handling of ICMP error messages is critical to
many protocols, particularly TCP.
diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7
index 33a6dd82c06c..273c504ebaff 100644
--- a/share/man/man7/arch.7
+++ b/share/man/man7/arch.7
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd February 4, 2025
+.Dd April 12, 2025
.Dt ARCH 7
.Os
.Sh NAME
@@ -104,17 +104,17 @@ Discontinued architectures are shown in the following table.
.It armeb Ta 8.0 Ta 11.4
.It armv6 Ta 10.0 Ta 14.x
.It ia64 Ta 5.0 Ta 10.4
-.It mips Ta 8.0 Ta 13.x
-.It mipsel Ta 9.0 Ta 13.x
-.It mipselhf Ta 12.0 Ta 13.x
-.It mipshf Ta 12.0 Ta 13.x
-.It mipsn32 Ta 9.0 Ta 13.x
-.It mips64 Ta 9.0 Ta 13.x
-.It mips64el Ta 9.0 Ta 13.x
-.It mips64elhf Ta 12.0 Ta 13.x
-.It mips64hf Ta 12.0 Ta 13.x
+.It mips Ta 8.0 Ta 13.5
+.It mipsel Ta 9.0 Ta 13.5
+.It mipselhf Ta 12.0 Ta 13.5
+.It mipshf Ta 12.0 Ta 13.5
+.It mipsn32 Ta 9.0 Ta 13.5
+.It mips64 Ta 9.0 Ta 13.5
+.It mips64el Ta 9.0 Ta 13.5
+.It mips64elhf Ta 12.0 Ta 13.5
+.It mips64hf Ta 12.0 Ta 13.5
.It pc98 Ta 2.2 Ta 11.4
-.It riscv64sf Ta 12.0 Ta 13.x
+.It riscv64sf Ta 12.0 Ta 13.5
.It sparc64 Ta 5.0 Ta 12.4
.El
.Ss Type sizes
@@ -248,7 +248,7 @@ as the default compiler on all supported CPU architectures,
LLVM's
.Xr ld.lld 1
as the default linker, and
-ELF Tool Chain binary utilities such as
+LLVM binary utilities such as
.Xr objcopy 1
and
.Xr readelf 1 .
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 63496e9b8ccd..b8535809e5aa 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -22,6 +22,8 @@ CFLAGS+= -std=iso9899:1999
CFLAGS+= -std=${CSTD}
.endif # CSTD
+CXXSTD?= gnu++17
+
.if !empty(CXXSTD)
CXXFLAGS+= -std=${CXXSTD}
.endif
diff --git a/share/mk/googletest.test.inc.mk b/share/mk/googletest.test.inc.mk
index 05415775448b..9ef5a3ceac00 100644
--- a/share/mk/googletest.test.inc.mk
+++ b/share/mk/googletest.test.inc.mk
@@ -9,6 +9,4 @@ GTESTS_CXXFLAGS+= -frtti
# libgmock's, etc, headers.
CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private
-CXXSTD?= c++14
-
NO_WTHREAD_SAFETY=
diff --git a/share/vt/keymaps/INDEX.keymaps b/share/vt/keymaps/INDEX.keymaps
index 278f9ec9f373..a3b59989cc5d 100644
--- a/share/vt/keymaps/INDEX.keymaps
+++ b/share/vt/keymaps/INDEX.keymaps
@@ -83,6 +83,9 @@ br.noacc.kbd:fr:Brésilien (sans accents)
br.noacc.kbd:pt:Brasileiro (without accent keys)
br.noacc.kbd:es:Brasileño (without accent keys)
+br.lenovo.kbd:en:Brazilian Lenovo Laptop (accent keys, with slash in place of right Ctrl)
+br.lenovo.kbd:pt:Brasileiro Lenovo Laptop (com acentos, com barra no lugar do Ctrl da direita)
+
by.kbd:en:Belarusian
by.kbd:da:Hviderussisk
by.kbd:de:Weißrussisch
diff --git a/share/vt/keymaps/br.lenovo.kbd b/share/vt/keymaps/br.lenovo.kbd
new file mode 100644
index 000000000000..c5cd3be60b09
--- /dev/null
+++ b/share/vt/keymaps/br.lenovo.kbd
@@ -0,0 +1,160 @@
+#
+# Keymap for Lenovo laptops (Thinkpad, Ideapad, Yoga, Legion)
+#
+# Some laptops sold in Brazil have written "/, ?" in same position
+# where it should be the right control key. The keyboard sends
+# the incorrect scancode.
+#
+# This map should be the same as br.keymap, but with 090 (rctrl)
+# replaced by 115 scancode content (?, /, 0xb0).
+#
+# alt
+# scan cntrl alt alt cntrl lock
+# code base shift cntrl shift alt shift cntrl shift state
+# ------------------------------------------------------------------
+ 000 nop nop nop nop nop nop nop nop O
+ 001 esc esc esc esc esc esc debug esc O
+ 002 '1' '!' nop nop 0xb9 '!' nop nop O
+ 003 '2' '@' nul nul 0xb2 '@' nul nul O
+ 004 '3' '#' nop nop 0xb3 '#' nop nop O
+ 005 '4' '$' nop nop 0xa3 '$' nop nop O
+ 006 '5' '%' nop nop 0xa2 '%' nop nop O
+ 007 '6' duml rs rs 0xac duml rs rs O
+ 008 '7' '&' nop nop '7' '&' nop nop O
+ 009 '8' '*' nop nop '8' '*' nop nop O
+ 010 '9' '(' nop nop '9' '(' nop nop O
+ 011 '0' ')' nop nop '0' ')' nop nop O
+ 012 '-' '_' us us '-' '_' us us O
+ 013 '=' '+' nop nop 0xa7 '+' nop nop O
+ 014 bs bs del del bs bs del del O
+ 015 ht btab nop nop ht btab nop nop O
+ 016 'q' 'Q' dc1 dc1 '/' 'Q' dc1 dc1 C
+ 017 'w' 'W' etb etb '?' 'W' etb etb C
+ 018 'e' 'E' enq enq 0x00b0 'E' enq enq C
+ 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
+ 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
+ 021 'y' 'Y' em em 'y' 'Y' em em C
+ 022 'u' 'U' nak nak 'u' 'U' nak nak C
+ 023 'i' 'I' ht ht 'i' 'I' ht ht C
+ 024 'o' 'O' si si 'o' 'O' si si C
+ 025 'p' 'P' dle dle 'p' 'P' dle dle C
+ 026 dacu dgra nop nop dacu dgra nop nop O
+ 027 '[' '{' esc esc 0xaa '{' esc esc O
+ 028 cr cr nl nl cr cr nl nl O
+ 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
+ 030 'a' 'A' soh soh 'a' 'A' soh soh C
+ 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
+ 032 'd' 'D' eot eot 'd' 'D' eot eot C
+ 033 'f' 'F' ack ack 'f' 'F' ack ack C
+ 034 'g' 'G' bel bel 'g' 'G' bel bel C
+ 035 'h' 'H' bs bs 'h' 'H' bs bs C
+ 036 'j' 'J' nl nl 'j' 'J' nl nl C
+ 037 'k' 'K' vt vt 'k' 'K' vt vt C
+ 038 'l' 'L' ff ff 'l' 'L' ff ff C
+ 039 0xe7 0xc7 nop nop 0xe7 0xc7 nop nop C
+ 040 dtil dcir nop nop dtil dcir nop nop O
+ 041 ''' '"' nop nop ''' '"' nop nop O
+ 042 lshift lshift lshift lshift lshift lshift lshift lshift O
+ 043 ']' '}' gs gs 0xba '}' gs gs O
+ 044 'z' 'Z' sub sub 'z' 'Z' sub sub C
+ 045 'x' 'X' can can 'x' 'X' can can C
+ 046 'c' 'C' etx etx 0x20a2 'C' etx etx C
+ 047 'v' 'V' syn syn 'v' 'V' syn syn C
+ 048 'b' 'B' stx stx 'b' 'B' stx stx C
+ 049 'n' 'N' so so 'n' 'N' so so C
+ 050 'm' 'M' cr cr 'm' 'M' cr cr C
+ 051 ',' '<' nop nop ',' '<' nop nop O
+ 052 '.' '>' nop nop '.' '>' nop nop O
+ 053 ';' ':' nop nop ';' ':' nop nop O
+ 054 rshift rshift rshift rshift rshift rshift rshift rshift O
+ 055 '*' '*' '*' '*' '*' '*' '*' '*' O
+ 056 lalt lalt lalt lalt lalt lalt lalt lalt O
+ 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O
+ 058 clock clock clock clock clock clock clock clock O
+ 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
+ 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
+ 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
+ 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
+ 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
+ 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
+ 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
+ 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
+ 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
+ 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
+ 069 nlock nlock nlock nlock nlock nlock nlock nlock O
+ 070 slock slock slock slock slock slock slock slock O
+ 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
+ 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
+ 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
+ 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
+ 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
+ 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N
+ 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
+ 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
+ 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
+ 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
+ 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
+ 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
+ 083 del ',' ',' ',' ',' ',' boot boot N
+ 084 nop nop nop nop nop nop nop nop O
+ 085 nop nop nop nop nop nop nop nop O
+ 086 '\' '|' fs fs '\' '|' fs fs O
+ 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
+ 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
+ 089 cr cr nl nl cr cr nl nl O
+ 090 '/' '?' nop nop 0xb0 '?' nop nop O
+ 091 '/' '/' '/' '/' '/' '/' '/' '/' N
+ 092 nscr pscr debug debug nop nop nop nop O
+ 093 ralt ralt ralt ralt ralt ralt ralt ralt O
+ 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
+ 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
+ 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
+ 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
+ 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
+ 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
+ 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
+ 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
+ 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
+ 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
+ 104 slock saver slock saver susp nop susp nop O
+ 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
+ 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
+ 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
+ 108 nop nop nop nop nop nop nop nop O
+ 109 nop nop nop nop nop nop nop nop O
+ 110 nop nop nop nop nop nop nop nop O
+ 111 nop nop nop nop nop nop nop nop O
+ 112 nop nop nop nop nop nop nop nop O
+ 113 nop nop nop nop nop nop nop nop O
+ 114 nop nop nop nop nop nop nop nop O
+ 115 nop nop nop nop nop nop nop nop O
+ 116 nop nop nop nop nop nop nop nop O
+ 117 nop nop nop nop nop nop nop nop O
+ 118 nop nop nop nop nop nop nop nop O
+ 119 nop nop nop nop nop nop nop nop O
+ 120 nop nop nop nop nop nop nop nop O
+ 121 nop nop nop nop nop nop nop nop O
+ 122 nop nop nop nop nop nop nop nop O
+ 123 nop nop nop nop nop nop nop nop O
+ 124 nop nop nop nop nop nop nop nop O
+ 125 nop nop nop nop nop nop nop nop O
+ 126 '.' '.' '.' '.' '.' '.' '.' '.' N
+
+ dgra '`' ( 'a' 0xe0 ) ( 'A' 0xc0 ) ( 'e' 0xe8 ) ( 'E' 0xc8 )
+ ( 'i' 0xec ) ( 'I' 0xcc ) ( 'o' 0xf2 ) ( 'O' 0xd2 )
+ ( 'u' 0xf9 ) ( 'U' 0xd9 )
+
+ dacu 0xb4 ( 'a' 0xe1 ) ( 'A' 0xc1 ) ( 'e' 0xe9 ) ( 'E' 0xc9 )
+ ( 'i' 0xed ) ( 'I' 0xcd ) ( 'o' 0xf3 ) ( 'O' 0xd3 )
+ ( 'u' 0xfa ) ( 'U' 0xda ) ( 'y' 0xfd ) ( 'Y' 0xdd )
+
+ dcir '^' ( 'a' 0xe2 ) ( 'A' 0xc2 ) ( 'e' 0xea ) ( 'E' 0xca )
+ ( 'i' 0xee ) ( 'I' 0xce ) ( 'o' 0xf4 ) ( 'O' 0xd4 )
+ ( 'u' 0xfb ) ( 'U' 0xdb )
+
+ dtil '~' ( 'a' 0xe3 ) ( 'A' 0xc3 ) ( 'n' 0xf1 ) ( 'N' 0xd1 )
+ ( 'o' 0xf5 ) ( 'O' 0xd5 )
+
+ duml 0xa8 ( 'a' 0xe4 ) ( 'A' 0xc4 ) ( 'e' 0xeb ) ( 'E' 0xcb )
+ ( 'i' 0xef ) ( 'I' 0xcf ) ( 'o' 0xf6 ) ( 'O' 0xd6 )
+ ( 'u' 0xfc ) ( 'U' 0xdc ) ( 'y' 0xff )
diff --git a/stand/efi/Makefile.inc b/stand/efi/Makefile.inc
index f91ac9102ca8..6bb0af1d84f3 100644
--- a/stand/efi/Makefile.inc
+++ b/stand/efi/Makefile.inc
@@ -1,3 +1,5 @@
+.include <src.opts.mk>
+
# Options used when building app-specific efi components
# See conf/kern.mk for the correct set of these
CFLAGS+= -Wformat
@@ -26,7 +28,20 @@ EFI_TARGET= efi-app-x86_64
.else
EFI_TARGET= binary
.endif
+
+# GNU or ELF Tool Chain objcopy is usable for building EFI objects.
+# LLVM objcopy is not. Use elfcopy if we've bootstrapped it (and thus
+# known to be available) or objcopy is LLVM's.
+.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
EFI_OBJCOPY?= elfcopy
+.else
+_v!= ${OBJCOPY} --version
+.if ${_v:Mllvm-objcopy*} == ""
+EFI_OBJCOPY?= ${OBJCOPY}
+.else
+EFI_OBJCOPY?= elfcopy
+.endif
+.endif
# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2024 00:00:00
# for build reproducibility.
diff --git a/stand/efi/include/amd64/efibind.h b/stand/efi/include/amd64/efibind.h
index d005ade221c4..1c974ee39f84 100644
--- a/stand/efi/include/amd64/efibind.h
+++ b/stand/efi/include/amd64/efibind.h
@@ -28,17 +28,17 @@ Revision History
#ifdef EFI_NT_EMULATOR
#define POST_CODE(_Data)
-#else
+#else
#ifdef EFI_DEBUG
#define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al
#else
#define POST_CODE(_Data)
- #endif
+ #endif
#endif
#define EFIERR(a) (0x8000000000000000 | a)
#define EFI_ERROR_MASK 0x8000000000000000
-#define EFIERR_OEM(a) (0xc000000000000000 | a)
+#define EFIERR_OEM(a) (0xc000000000000000 | a)
#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
@@ -72,18 +72,18 @@ Revision History
// BOOTSERVICE - prototype for implementation of a boot service interface
// RUNTIMESERVICE - prototype for implementation of a runtime service interface
// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
-// RUNTIME_CODE - pragma macro for declaring runtime code
+// RUNTIME_CODE - pragma macro for declaring runtime code
//
#ifdef __amd64__
#define EFIAPI __attribute__((ms_abi))
#endif
-#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
+#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#ifdef _MSC_EXTENSIONS
- #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
+ #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
#else
- #define EFIAPI // Substitute expresion to force C calling convention
+ #define EFIAPI // Substitute expresion to force C calling convention
#endif
#endif
@@ -100,7 +100,7 @@ Revision History
#define VOLATILE volatile
-#define MEMORY_FENCE()
+#define MEMORY_FENCE()
#ifdef EFI_NO_INTERFACE_DECL
#define EFI_FORWARD_DECLARATION(x)
@@ -149,9 +149,9 @@ Revision History
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
- (_if)->LoadInternal(type, name, NULL)
+ (_if)->LoadInternal(type, name, NULL)
-#else // EFI_NT_EMULATOR
+#else // EFI_NT_EMULATOR
//
// When building similar to FW, link everything together as
@@ -163,7 +163,7 @@ Revision History
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
(_if)->LoadInternal(type, name, entry)
-#endif // EFI_FW_NT
+#endif // EFI_FW_NT
#ifdef __FreeBSD__
#define INTERFACE_DECL(x) struct x
diff --git a/stand/efi/include/amd64/pe.h b/stand/efi/include/amd64/pe.h
index ad5985cc2740..b858ba916c7d 100644
--- a/stand/efi/include/amd64/pe.h
+++ b/stand/efi/include/amd64/pe.h
@@ -1,4 +1,4 @@
-/*
+/*
PE32+ header file
*/
#ifndef _PE_H
@@ -7,7 +7,7 @@
#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
#define IMAGE_OS2_SIGNATURE 0x454E // NE
#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE
-#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
+#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
#define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
@@ -129,7 +129,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER {
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
UINT32 BaseOfData;
-
+
//
// NT additional fields.
//
diff --git a/stand/efi/include/arm64/efibind.h b/stand/efi/include/arm64/efibind.h
index 417da1b4d4ff..c81506f79334 100644
--- a/stand/efi/include/arm64/efibind.h
+++ b/stand/efi/include/arm64/efibind.h
@@ -31,10 +31,10 @@ Revision History
//
#define BIT63 0x8000000000000000
-#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63)
+#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63)
#define PORT_TO_MEMD(_Port) (PLATFORM_IOBASE_ADDRESS | ( ( ( (_Port) & 0xfffc) << 10 ) | ( (_Port) & 0x0fff) ) )
-
-//
+
+//
// Macro's with casts make this much easier to use and read.
//
#define PORT_TO_MEM8D(_Port) (*(UINT8 *)(PORT_TO_MEMD(_Port)))
@@ -45,7 +45,7 @@ Revision History
#define EFIERR(a) (0x8000000000000000 | a)
#define EFI_ERROR_MASK 0x8000000000000000
-#define EFIERR_OEM(a) (0xc000000000000000 | a)
+#define EFIERR_OEM(a) (0xc000000000000000 | a)
#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
@@ -77,14 +77,14 @@ Revision History
// BOOTSERVICE - prototype for implementation of a boot service interface
// RUNTIMESERVICE - prototype for implementation of a runtime service interface
// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
-// RUNTIME_CODE - pragma macro for declaring runtime code
+// RUNTIME_CODE - pragma macro for declaring runtime code
//
-#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
+#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#ifdef _MSC_EXTENSIONS
- #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
+ #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
#else
- #define EFIAPI // Substitute expresion to force C calling convention
+ #define EFIAPI // Substitute expresion to force C calling convention
#endif
#endif
@@ -101,7 +101,7 @@ Revision History
//
// BugBug: Need to find out if this is portable across compilers.
//
-void __mfa (void);
+void __mfa (void);
#define MEMORY_FENCE() __mfa()
#ifdef EFI_NO_INTERFACE_DECL
diff --git a/stand/efi/include/efi_nii.h b/stand/efi/include/efi_nii.h
index 069e318428ea..173108c55004 100644
--- a/stand/efi/include/efi_nii.h
+++ b/stand/efi/include/efi_nii.h
@@ -20,7 +20,7 @@ Revision history:
2000-Feb-18 M(f)J GUID updated.
Structure order changed for machine word alignment.
Added StringId[4] to structure.
-
+
2000-Feb-14 M(f)J Genesis.
--*/
diff --git a/stand/efi/include/efidebug.h b/stand/efi/include/efidebug.h
index b43b62d1283c..40a3cd0d5bb2 100644
--- a/stand/efi/include/efidebug.h
+++ b/stand/efi/include/efidebug.h
@@ -32,12 +32,12 @@ extern UINTN EFIDebug;
#define DBGASSERT(a) DbgAssert(__FILE__, __LINE__, #a)
#define DEBUG(a) DbgPrint a
-
+
#else
#define DBGASSERT(a)
#define DEBUG(a)
-
+
#endif
#if EFI_DEBUG_CLEAR_MEMORY
@@ -59,7 +59,7 @@ extern UINTN EFIDebug;
#define D_INFO 0x00000040 // Verbose
#define D_VARIABLE 0x00000100 // Variable
#define D_VAR 0x00000100 // Variable
-#define D_BM 0x00000400 // Boot Manager
+#define D_BM 0x00000400 // Boot Manager
#define D_BLKIO 0x00001000 // BlkIo Driver
#define D_BLKIO_ULTRA 0x00002000 // BlkIo Driver
#define D_NET 0x00004000 // SNI Driver
@@ -90,9 +90,9 @@ extern UINTN EFIDebug;
#else
- #define ASSERT(a)
- #define ASSERT_LOCKED(l)
- #define ASSERT_STRUCT(p,t)
+ #define ASSERT(a)
+ #define ASSERT_LOCKED(l)
+ #define ASSERT_STRUCT(p,t)
#endif
diff --git a/stand/efi/include/efidef.h b/stand/efi/include/efidef.h
index 54be3bb2a0ce..7a63fd185874 100644
--- a/stand/efi/include/efidef.h
+++ b/stand/efi/include/efidef.h
@@ -70,11 +70,11 @@ typedef VOID *EFI_EVENT;
// A GUID
//
-typedef struct {
+typedef struct {
UINT32 Data1;
UINT16 Data2;
UINT16 Data3;
- UINT8 Data4[8];
+ UINT8 Data4[8];
} EFI_GUID;
@@ -82,7 +82,7 @@ typedef struct {
// Time
//
-typedef struct {
+typedef struct {
UINT16 Year; // 1998 - 20XX
UINT8 Month; // 1 - 12
UINT8 Day; // 1 - 31
@@ -179,9 +179,9 @@ typedef enum {
#define EFI_MEMORY_WC 0x0000000000000002
#define EFI_MEMORY_WT 0x0000000000000004
#define EFI_MEMORY_WB 0x0000000000000008
-#define EFI_MEMORY_UCE 0x0000000000000010
+#define EFI_MEMORY_UCE 0x0000000000000010
-// physical memory protection on range
+// physical memory protection on range
#define EFI_MEMORY_WP 0x0000000000001000
#define EFI_MEMORY_RP 0x0000000000002000
#define EFI_MEMORY_XP 0x0000000000004000
diff --git a/stand/efi/include/efidevp.h b/stand/efi/include/efidevp.h
index 409f2b23b9ef..5fe42a3e7e8f 100644
--- a/stand/efi/include/efidevp.h
+++ b/stand/efi/include/efidevp.h
@@ -150,8 +150,8 @@ typedef struct _ACPI_EXTENDED_HID_DEVICE_PATH {
// bits[31:16] - binary number
// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
//
-#define PNP_EISA_ID_CONST 0x41d0
-#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
+#define PNP_EISA_ID_CONST 0x41d0
+#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
@@ -160,7 +160,7 @@ typedef struct _ACPI_EXTENDED_HID_DEVICE_PATH {
/*
*
*/
-#define MESSAGING_DEVICE_PATH 0x03
+#define MESSAGING_DEVICE_PATH 0x03
#define MSG_ATAPI_DP 0x01
typedef struct _ATAPI_DEVICE_PATH {
@@ -174,7 +174,7 @@ typedef struct _ATAPI_DEVICE_PATH {
typedef struct _SCSI_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT16 Pun;
- UINT16 Lun;
+ UINT16 Lun;
} SCSI_DEVICE_PATH;
#define MSG_FIBRECHANNEL_DP 0x03
@@ -283,7 +283,7 @@ typedef struct _UART_DEVICE_PATH {
#define DEVICE_PATH_MESSAGING_VT_100_PLUS \
{ 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43} }
-
+
#define DEVICE_PATH_MESSAGING_VT_UTF8 \
{ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} }
@@ -393,7 +393,7 @@ typedef union {
PCCARD_DEVICE_PATH PcCard;
MEMMAP_DEVICE_PATH MemMap;
VENDOR_DEVICE_PATH Vendor;
- UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor;
+ UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor;
CONTROLLER_DEVICE_PATH Controller;
ACPI_HID_DEVICE_PATH Acpi;
@@ -427,7 +427,7 @@ typedef union {
PCCARD_DEVICE_PATH *PcCard;
MEMMAP_DEVICE_PATH *MemMap;
VENDOR_DEVICE_PATH *Vendor;
- UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor;
+ UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor;
CONTROLLER_DEVICE_PATH *Controller;
ACPI_HID_DEVICE_PATH *Acpi;
ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
diff --git a/stand/efi/include/efifs.h b/stand/efi/include/efifs.h
index 3ba238496b23..0197449a9399 100644
--- a/stand/efi/include/efifs.h
+++ b/stand/efi/include/efifs.h
@@ -100,7 +100,7 @@ typedef struct _EFI_LBAL {
UINT32 ArrayCount;
} EFI_LBAL;
-// Array size
+// Array size
#define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \
(((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL))
diff --git a/stand/efi/include/efinet.h b/stand/efi/include/efinet.h
index 9cd13f5a4653..d8bcf9a36bcb 100644
--- a/stand/efi/include/efinet.h
+++ b/stand/efi/include/efinet.h
@@ -172,8 +172,8 @@ typedef struct {
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_START) (
IN struct _EFI_SIMPLE_NETWORK *This
);
@@ -181,8 +181,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STOP) (
IN struct _EFI_SIMPLE_NETWORK *This
);
@@ -190,8 +190,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN UINTN ExtraRxBufferSize OPTIONAL,
@@ -201,8 +201,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RESET) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN BOOLEAN ExtendedVerification
@@ -211,8 +211,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (
IN struct _EFI_SIMPLE_NETWORK *This
);
@@ -220,8 +220,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN UINT32 Enable,
@@ -234,8 +234,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN BOOLEAN Reset,
@@ -245,8 +245,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN BOOLEAN Reset,
@@ -257,8 +257,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN BOOLEAN IPv6,
@@ -269,8 +269,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN BOOLEAN ReadWrite,
@@ -282,8 +282,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (
IN struct _EFI_SIMPLE_NETWORK *This,
OUT UINT32 *InterruptStatus OPTIONAL,
@@ -293,8 +293,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (
IN struct _EFI_SIMPLE_NETWORK *This,
IN UINTN HeaderSize,
@@ -308,8 +308,8 @@ EFI_STATUS
///////////////////////////////////////////////////////////////////////////////
//
-typedef
-EFI_STATUS
+typedef
+EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (
IN struct _EFI_SIMPLE_NETWORK *This,
OUT UINTN *HeaderSize OPTIONAL,
diff --git a/stand/efi/include/efipart.h b/stand/efi/include/efipart.h
index 32a715c8781b..abad72440657 100644
--- a/stand/efi/include/efipart.h
+++ b/stand/efi/include/efipart.h
@@ -15,8 +15,8 @@ Intel Corporation.
Module Name:
efipart.h
-
-Abstract:
+
+Abstract:
Info about disk partitions and Master Boot Records
@@ -54,7 +54,7 @@ typedef struct {
#define MIN_MBR_DEVICE_SIZE 0x80000
#define MBR_ERRATA_PAD 0x40000 // 128 MB
-#define MAX_MBR_PARTITIONS 4
+#define MAX_MBR_PARTITIONS 4
typedef struct {
UINT8 BootStrapCode[440];
UINT8 UniqueMbrSignature[4];
diff --git a/stand/efi/include/efipciio.h b/stand/efi/include/efipciio.h
index 4e9ca153f721..8499ad9e9d7a 100644
--- a/stand/efi/include/efipciio.h
+++ b/stand/efi/include/efipciio.h
@@ -1,15 +1,15 @@
/** @file
- EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration,
+ EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration,
and DMA interfaces that a driver uses to access its PCI controller.
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -127,27 +127,27 @@ typedef enum {
EfiPciIoAttributeOperationMaximum
} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
-/**
+/**
Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is
- satisfied or after a defined duration.
-
+ satisfied or after a defined duration.
+
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory or I/O operations.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
- base address for the memory operation to perform.
+ base address for the memory operation to perform.
@param Offset The offset within the selected BAR to start the memory operation.
@param Mask Mask used for the polling criteria.
@param Value The comparison value used for the polling exit criteria.
@param Delay The number of 100 ns units to poll.
@param Result Pointer to the last value read from the memory location.
-
+
@retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED Offset is not valid for the BarIndex of this PCI controller.
@retval EFI_TIMEOUT Delay expired before a match occurred.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
-
+
**/
typedef
EFI_STATUS
@@ -162,25 +162,25 @@ EFI_STATUS
OUT UINT64 *Result
);
-/**
+/**
Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.
-
+
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory or I/O operations.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
- base address for the memory or I/O operation to perform.
- @param Offset The offset within the selected BAR to start the memory or I/O operation.
+ base address for the memory or I/O operation to perform.
+ @param Offset The offset within the selected BAR to start the memory or I/O operation.
@param Count The number of memory or I/O operations to perform.
@param Buffer For read operations, the destination buffer to store the results. For write
- operations, the source buffer to write data from.
-
+ operations, the source buffer to write data from.
+
@retval EFI_SUCCESS The data was read from or written to the PCI controller.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not
- valid for the PCI BAR specified by BarIndex.
+ valid for the PCI BAR specified by BarIndex.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
-
+
**/
typedef
EFI_STATUS
@@ -204,23 +204,22 @@ typedef struct {
EFI_PCI_IO_PROTOCOL_IO_MEM Write;
} EFI_PCI_IO_PROTOCOL_ACCESS;
-/**
+/**
Enable a PCI driver to access PCI controller registers in PCI configuration space.
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory operations.
@param Offset The offset within the PCI configuration space for the PCI controller.
@param Count The number of PCI configuration operations to perform.
@param Buffer For read operations, the destination buffer to store the results. For write
operations, the source buffer to write data from.
-
-
+
@retval EFI_SUCCESS The data was read from or written to the PCI controller.
@retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not
valid for the PCI configuration header of the PCI controller.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
- @retval EFI_INVALID_PARAMETER Buffer is NULL or Width is invalid.
-
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL or Width is invalid.
+
**/
typedef
EFI_STATUS
@@ -243,33 +242,33 @@ typedef struct {
EFI_PCI_IO_PROTOCOL_CONFIG Write;
} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
-/**
+/**
Enables a PCI driver to copy one region of PCI memory space to another region of PCI
memory space.
-
+
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory operations.
@param DestBarIndex The BAR index in the standard PCI Configuration header to use as the
- base address for the memory operation to perform.
+ base address for the memory operation to perform.
@param DestOffset The destination offset within the BAR specified by DestBarIndex to
- start the memory writes for the copy operation.
+ start the memory writes for the copy operation.
@param SrcBarIndex The BAR index in the standard PCI Configuration header to use as the
- base address for the memory operation to perform.
+ base address for the memory operation to perform.
@param SrcOffset The source offset within the BAR specified by SrcBarIndex to start
- the memory reads for the copy operation.
+ the memory reads for the copy operation.
@param Count The number of memory operations to perform. Bytes moved is Width
- size * Count, starting at DestOffset and SrcOffset.
-
+ size * Count, starting at DestOffset and SrcOffset.
+
@retval EFI_SUCCESS The data was copied from one memory region to another memory region.
@retval EFI_UNSUPPORTED DestBarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED SrcBarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED The address range specified by DestOffset, Width, and Count
- is not valid for the PCI BAR specified by DestBarIndex.
+ is not valid for the PCI BAR specified by DestBarIndex.
@retval EFI_UNSUPPORTED The address range specified by SrcOffset, Width, and Count is
- not valid for the PCI BAR specified by SrcBarIndex.
+ not valid for the PCI BAR specified by SrcBarIndex.
@retval EFI_INVALID_PARAMETER Width is invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
-
+
**/
typedef
EFI_STATUS
@@ -283,24 +282,24 @@ EFI_STATUS
IN UINTN Count
);
-/**
+/**
Provides the PCI controller-specific addresses needed to access system memory.
-
+
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Operation Indicates if the bus master is going to read or write to system memory.
@param HostAddress The system memory address to map to the PCI controller.
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes
- that were mapped.
+ that were mapped.
@param DeviceAddress The resulting map address for the bus master PCI controller to use to
- access the hosts HostAddress.
+ access the hosts HostAddress.
@param Mapping A resulting value to pass to Unmap().
-
+
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
- @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
-
+
**/
typedef
EFI_STATUS
@@ -313,15 +312,15 @@ EFI_STATUS
OUT VOID **Mapping
);
-/**
+/**
Completes the Map() operation and releases any corresponding resources.
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Mapping The mapping value returned from Map().
-
+
@retval EFI_SUCCESS The range was unmapped.
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
-
+
**/
typedef
EFI_STATUS
@@ -330,25 +329,25 @@ EFI_STATUS
IN VOID *Mapping
);
-/**
+/**
Allocates pages that are suitable for an EfiPciIoOperationBusMasterCommonBuffer
- mapping.
-
+ mapping.
+
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Type This parameter is not used and must be ignored.
@param MemoryType The type of memory to allocate, EfiBootServicesData or
- EfiRuntimeServicesData.
- @param Pages The number of pages to allocate.
+ EfiRuntimeServicesData.
+ @param Pages The number of pages to allocate.
@param HostAddress A pointer to store the base system memory address of the
- allocated range.
+ allocated range.
@param Attributes The requested bit mask of attributes for the allocated range.
-
+
@retval EFI_SUCCESS The requested memory pages were allocated.
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
- MEMORY_WRITE_COMBINE and MEMORY_CACHED.
+ MEMORY_WRITE_COMBINE and MEMORY_CACHED.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
-
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
+
**/
typedef
EFI_STATUS
@@ -361,17 +360,17 @@ EFI_STATUS
IN UINT64 Attributes
);
-/**
+/**
Frees memory that was allocated with AllocateBuffer().
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
- @param Pages The number of pages to free.
- @param HostAddress The base system memory address of the allocated range.
-
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ @param Pages The number of pages to free.
+ @param HostAddress The base system memory address of the allocated range.
+
@retval EFI_SUCCESS The requested memory pages were freed.
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
was not allocated with AllocateBuffer().
-
+
**/
typedef
EFI_STATUS
@@ -381,16 +380,16 @@ EFI_STATUS
IN VOID *HostAddress
);
-/**
+/**
Flushes all PCI posted write transactions from a PCI host bridge to system memory.
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
-
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+
@retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host
- bridge to system memory.
+ bridge to system memory.
@retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI
- host bridge due to a hardware error.
-
+ host bridge due to a hardware error.
+
**/
typedef
EFI_STATUS
@@ -398,18 +397,18 @@ EFI_STATUS
IN EFI_PCI_IO_PROTOCOL *This
);
-/**
+/**
Retrieves this PCI controller's current PCI bus number, device number, and function number.
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param SegmentNumber The PCI controller's current PCI segment number.
@param BusNumber The PCI controller's current PCI bus number.
@param DeviceNumber The PCI controller's current PCI device number.
@param FunctionNumber The PCI controller's current PCI function number.
-
- @retval EFI_SUCCESS The PCI controller location was returned.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
-
+
+ @retval EFI_SUCCESS The PCI controller location was returned.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
**/
typedef
EFI_STATUS
@@ -421,24 +420,24 @@ EFI_STATUS
OUT UINTN *FunctionNumber
);
-/**
+/**
Performs an operation on the attributes that this PCI controller supports. The operations include
- getting the set of supported attributes, retrieving the current attributes, setting the current
- attributes, enabling attributes, and disabling attributes.
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+ getting the set of supported attributes, retrieving the current attributes, setting the current
+ attributes, enabling attributes, and disabling attributes.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Operation The operation to perform on the attributes for this PCI controller.
@param Attributes The mask of attributes that are used for Set, Enable, and Disable
- operations.
+ operations.
@param Result A pointer to the result mask of attributes that are returned for the Get
- and Supported operations.
-
+ and Supported operations.
+
@retval EFI_SUCCESS The operation on the PCI controller's attributes was completed.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
- @retval EFI_UNSUPPORTED one or more of the bits set in
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_UNSUPPORTED one or more of the bits set in
Attributes are not supported by this PCI controller or one of
its parent bridges when Operation is Set, Enable or Disable.
-
+
**/
typedef
EFI_STATUS
@@ -449,27 +448,27 @@ EFI_STATUS
OUT UINT64 *Result OPTIONAL
);
-/**
+/**
Gets the attributes that this PCI controller supports setting on a BAR using
SetBarAttributes(), and retrieves the list of resource descriptors for a BAR.
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
base address for resource range. The legal range for this field is 0..5.
@param Supports A pointer to the mask of attributes that this PCI controller supports
- setting for this BAR with SetBarAttributes().
+ setting for this BAR with SetBarAttributes().
@param Resources A pointer to the ACPI 2.0 resource descriptors that describe the current
- configuration of this BAR of the PCI controller.
-
- @retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI
- controller supports are returned in Supports. If Resources
+ configuration of this BAR of the PCI controller.
+
+ @retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI
+ controller supports are returned in Supports. If Resources
is not NULL, then the ACPI 2.0 resource descriptors that the PCI
- controller is currently using are returned in Resources.
+ controller is currently using are returned in Resources.
@retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate
- Resources.
-
+ Resources.
+
**/
typedef
EFI_STATUS
@@ -480,29 +479,29 @@ EFI_STATUS
OUT VOID **Resources OPTIONAL
);
-/**
+/**
Sets the attributes for a range of a BAR on a PCI controller.
-
- @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
+
+ @param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Attributes The mask of attributes to set for the resource range specified by
- BarIndex, Offset, and Length.
+ BarIndex, Offset, and Length.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
base address for resource range. The legal range for this field is 0..5.
@param Offset A pointer to the BAR relative base address of the resource range to be
- modified by the attributes specified by Attributes.
+ modified by the attributes specified by Attributes.
@param Length A pointer to the length of the resource range to be modified by the
- attributes specified by Attributes.
-
- @retval EFI_SUCCESS The set of attributes specified by Attributes for the resource
- range specified by BarIndex, Offset, and Length were
+ attributes specified by Attributes.
+
+ @retval EFI_SUCCESS The set of attributes specified by Attributes for the resource
+ range specified by BarIndex, Offset, and Length were
set on the PCI controller, and the actual resource range is returned
- in Offset and Length.
+ in Offset and Length.
@retval EFI_INVALID_PARAMETER Offset or Length is NULL.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the
- resource range specified by BarIndex, Offset, and
- Length.
-
+ resource range specified by BarIndex, Offset, and
+ Length.
+
**/
typedef
EFI_STATUS
@@ -515,11 +514,11 @@ EFI_STATUS
);
///
-/// The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration,
-/// and DMA interfaces used to abstract accesses to PCI controllers.
-/// There is one EFI_PCI_IO_PROTOCOL instance for each PCI controller on a PCI bus.
-/// A device driver that wishes to manage a PCI controller in a system will have to
-/// retrieve the EFI_PCI_IO_PROTOCOL instance that is associated with the PCI controller.
+/// The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration,
+/// and DMA interfaces used to abstract accesses to PCI controllers.
+/// There is one EFI_PCI_IO_PROTOCOL instance for each PCI controller on a PCI bus.
+/// A device driver that wishes to manage a PCI controller in a system will have to
+/// retrieve the EFI_PCI_IO_PROTOCOL instance that is associated with the PCI controller.
///
struct _EFI_PCI_IO_PROTOCOL {
EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem;
@@ -537,20 +536,20 @@ struct _EFI_PCI_IO_PROTOCOL {
EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes;
EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes;
EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes;
-
+
///
/// The size, in bytes, of the ROM image.
///
UINT64 RomSize;
///
- /// A pointer to the in memory copy of the ROM image. The PCI Bus Driver is responsible
- /// for allocating memory for the ROM image, and copying the contents of the ROM to memory.
- /// The contents of this buffer are either from the PCI option ROM that can be accessed
- /// through the ROM BAR of the PCI controller, or it is from a platform-specific location.
- /// The Attributes() function can be used to determine from which of these two sources
+ /// A pointer to the in memory copy of the ROM image. The PCI Bus Driver is responsible
+ /// for allocating memory for the ROM image, and copying the contents of the ROM to memory.
+ /// The contents of this buffer are either from the PCI option ROM that can be accessed
+ /// through the ROM BAR of the PCI controller, or it is from a platform-specific location.
+ /// The Attributes() function can be used to determine from which of these two sources
/// the RomImage buffer was initialized.
- ///
+ ///
VOID *RomImage;
};
diff --git a/stand/efi/include/efiprot.h b/stand/efi/include/efiprot.h
index 5b8ac2309c8e..bcedf8b1f653 100644
--- a/stand/efi/include/efiprot.h
+++ b/stand/efi/include/efiprot.h
@@ -308,9 +308,9 @@ typedef struct {
//
// The FileName field of the EFI_FILE_INFO data structure is variable length.
// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
-// be the size of the data structure without the FileName field. The following macro
+// be the size of the data structure without the FileName field. The following macro
// computes this size correctly no matter how big the FileName array is declared.
-// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
+// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
//
#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
@@ -330,9 +330,9 @@ typedef struct {
//
// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
-// to be the size of the data structure without the VolumeLable field. The following macro
+// to be the size of the data structure without the VolumeLable field. The following macro
// computes this size correctly no matter how big the VolumeLable array is declared.
-// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
+// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
//
#define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
@@ -412,7 +412,7 @@ typedef struct {
EFI_DEVICE_IO Write;
} EFI_IO_ACCESS;
-typedef
+typedef
EFI_STATUS
(EFIAPI *EFI_PCI_DEVICE_PATH) (
IN struct _EFI_DEVICE_IO_INTERFACE *This,
diff --git a/stand/efi/include/efipxebc.h b/stand/efi/include/efipxebc.h
index 5d5c60a104b0..80a190d9c150 100644
--- a/stand/efi/include/efipxebc.h
+++ b/stand/efi/include/efipxebc.h
@@ -150,7 +150,7 @@ typedef struct {
// Discover() definitions
//
-#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2
#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3
@@ -355,7 +355,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_ARP) (
IN struct _EFI_PXE_BASE_CODE *This,
- IN EFI_IP_ADDRESS *IpAddr,
+ IN EFI_IP_ADDRESS *IpAddr,
IN EFI_MAC_ADDRESS *MacAddr OPTIONAL
);
@@ -454,7 +454,7 @@ typedef enum {
} EFI_PXE_BASE_CODE_CALLBACK_STATUS;
typedef
-EFI_PXE_BASE_CODE_CALLBACK_STATUS
+EFI_PXE_BASE_CODE_CALLBACK_STATUS
(EFIAPI *EFI_PXE_CALLBACK) (
IN struct _EFI_PXE_BASE_CODE_CALLBACK *This,
IN EFI_PXE_BASE_CODE_FUNCTION Function,
diff --git a/stand/efi/include/efirng.h b/stand/efi/include/efirng.h
index 3d6c77677981..d5a2212ea13f 100644
--- a/stand/efi/include/efirng.h
+++ b/stand/efi/include/efirng.h
@@ -2,10 +2,10 @@
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright 2006 - 2016 Unified EFI, Inc.<BR>
- * Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
+ * Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
- * which accompanies this distribution. The full text of the license may be found at
+ * which accompanies this distribution. The full text of the license may be found at
* http://opensource.org/licenses/bsd-license.php
*
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
diff --git a/stand/efi/include/efiser.h b/stand/efi/include/efiser.h
index 9a13653453fb..596d2b94db59 100644
--- a/stand/efi/include/efiser.h
+++ b/stand/efi/include/efiser.h
@@ -34,8 +34,8 @@ Revision History
INTERFACE_DECL(_SERIAL_IO_INTERFACE);
typedef enum {
- DefaultParity,
- NoParity,
+ DefaultParity,
+ NoParity,
EvenParity,
OddParity,
MarkParity,
@@ -43,7 +43,7 @@ typedef enum {
} EFI_PARITY_TYPE;
typedef enum {
- DefaultStopBits,
+ DefaultStopBits,
OneStopBit, // 1 stop bit
OneFiveStopBits, // 1.5 stop bits
TwoStopBits // 2 stop bits
diff --git a/stand/efi/include/efiuga.h b/stand/efi/include/efiuga.h
index b15c2176c32f..8c4b40dc84cc 100644
--- a/stand/efi/include/efiuga.h
+++ b/stand/efi/include/efiuga.h
@@ -99,33 +99,33 @@ typedef enum {
The following table defines actions for BltOperations:
- <B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
+ <B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
+ directly to every pixel of the video display rectangle
+ (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
Only one pixel will be used from the BltBuffer. Delta is NOT used.
- <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
+ <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle
+ (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
+ the BltBuffer rectangle (DestinationX, DestinationY )
+ (DestinationX + Width, DestinationY + Height). If DestinationX or
+ DestinationY is not zero then Delta must be set to the length in bytes
of a row in the BltBuffer.
- <B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
+ <B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle
+ (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
+ video display rectangle (DestinationX, DestinationY)
+ (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
+ not zero then Delta must be set to the length in bytes of a row in the
BltBuffer.
<B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
- (SourceX + Width, SourceY + Height) .to the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
+ (SourceX + Width, SourceY + Height) .to the video display rectangle
+ (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
The BltBuffer and Delta are not used in this mode.
@param[in] This - Protocol instance pointer.
- @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
+ @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
@param[in] BltOperation - Operation to perform on BlitBuffer and video memory
@param[in] SourceX - X coordinate of source for the BltBuffer.
@@ -135,7 +135,7 @@ typedef enum {
@param[in] Width - Width of rectangle in BltBuffer in pixels.
@param[in] Height - Hight of rectangle in BltBuffer in pixels.
@param[in] Delta - OPTIONAL
-
+
@retval EFI_SUCCESS - The Blt operation completed.
@retval EFI_INVALID_PARAMETER - BltOperation is not valid.
@retval EFI_DEVICE_ERROR - A hardware error occurred writing to the video buffer.
diff --git a/stand/efi/include/i386/efibind.h b/stand/efi/include/i386/efibind.h
index e4cbceae8216..dac056571c7c 100644
--- a/stand/efi/include/i386/efibind.h
+++ b/stand/efi/include/i386/efibind.h
@@ -28,17 +28,17 @@ Revision History
#ifdef EFI_NT_EMULATOR
#define POST_CODE(_Data)
-#else
+#else
#ifdef EFI_DEBUG
#define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al
#else
#define POST_CODE(_Data)
- #endif
+ #endif
#endif
#define EFIERR(a) (0x80000000 | a)
#define EFI_ERROR_MASK 0x80000000
-#define EFIERR_OEM(a) (0xc0000000 | a)
+#define EFIERR_OEM(a) (0xc0000000 | a)
#define BAD_POINTER 0xFBFBFBFB
@@ -72,14 +72,14 @@ Revision History
// BOOTSERVICE - prototype for implementation of a boot service interface
// RUNTIMESERVICE - prototype for implementation of a runtime service interface
// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
-// RUNTIME_CODE - pragma macro for declaring runtime code
+// RUNTIME_CODE - pragma macro for declaring runtime code
//
-#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
+#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#ifdef _MSC_EXTENSIONS
- #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
+ #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
#else
- #define EFIAPI // Substitute expresion to force C calling convention
+ #define EFIAPI // Substitute expresion to force C calling convention
#endif
#endif
@@ -96,7 +96,7 @@ Revision History
#define VOLATILE volatile
-#define MEMORY_FENCE()
+#define MEMORY_FENCE()
#ifdef EFI_NO_INTERFACE_DECL
#define EFI_FORWARD_DECLARATION(x)
@@ -145,9 +145,9 @@ Revision History
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
- (_if)->LoadInternal(type, name, NULL)
+ (_if)->LoadInternal(type, name, NULL)
-#else // EFI_NT_EMULATOR
+#else // EFI_NT_EMULATOR
//
// When build similar to FW, then link everything together as
@@ -159,7 +159,7 @@ Revision History
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
(_if)->LoadInternal(type, name, entry)
-#endif // EFI_FW_NT
+#endif // EFI_FW_NT
#ifdef __FreeBSD__
#define INTERFACE_DECL(x) struct x
diff --git a/stand/efi/include/i386/pe.h b/stand/efi/include/i386/pe.h
index ede10814939f..c756080fe2d7 100644
--- a/stand/efi/include/i386/pe.h
+++ b/stand/efi/include/i386/pe.h
@@ -1,4 +1,4 @@
-/*
+/*
PE32+ header file
*/
#ifndef _PE_H
@@ -7,7 +7,7 @@
#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
#define IMAGE_OS2_SIGNATURE 0x454E // NE
#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE
-#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
+#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
#define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
@@ -129,7 +129,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER {
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
UINT32 BaseOfData;
-
+
//
// NT additional fields.
//
@@ -606,7 +606,7 @@ typedef struct {
UINT32 Signature; // "NB10"
UINT32 Unknown;
UINT32 Unknown2;
- UINT32 Unknown3;
+ UINT32 Unknown3;
//
// Filename of .PDB goes here
//
@@ -618,9 +618,9 @@ typedef struct {
UINT32 Signature; // "RSDS"
UINT32 Unknown;
UINT32 Unknown2;
- UINT32 Unknown3;
- UINT32 Unknown4;
- UINT32 Unknown5;
+ UINT32 Unknown3;
+ UINT32 Unknown4;
+ UINT32 Unknown5;
//
// Filename of .PDB goes here
//
diff --git a/stand/efi/include/riscv/efibind.h b/stand/efi/include/riscv/efibind.h
index 417da1b4d4ff..c81506f79334 100644
--- a/stand/efi/include/riscv/efibind.h
+++ b/stand/efi/include/riscv/efibind.h
@@ -31,10 +31,10 @@ Revision History
//
#define BIT63 0x8000000000000000
-#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63)
+#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63)
#define PORT_TO_MEMD(_Port) (PLATFORM_IOBASE_ADDRESS | ( ( ( (_Port) & 0xfffc) << 10 ) | ( (_Port) & 0x0fff) ) )
-
-//
+
+//
// Macro's with casts make this much easier to use and read.
//
#define PORT_TO_MEM8D(_Port) (*(UINT8 *)(PORT_TO_MEMD(_Port)))
@@ -45,7 +45,7 @@ Revision History
#define EFIERR(a) (0x8000000000000000 | a)
#define EFI_ERROR_MASK 0x8000000000000000
-#define EFIERR_OEM(a) (0xc000000000000000 | a)
+#define EFIERR_OEM(a) (0xc000000000000000 | a)
#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
@@ -77,14 +77,14 @@ Revision History
// BOOTSERVICE - prototype for implementation of a boot service interface
// RUNTIMESERVICE - prototype for implementation of a runtime service interface
// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
-// RUNTIME_CODE - pragma macro for declaring runtime code
+// RUNTIME_CODE - pragma macro for declaring runtime code
//
-#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
+#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#ifdef _MSC_EXTENSIONS
- #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
+ #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
#else
- #define EFIAPI // Substitute expresion to force C calling convention
+ #define EFIAPI // Substitute expresion to force C calling convention
#endif
#endif
@@ -101,7 +101,7 @@ Revision History
//
// BugBug: Need to find out if this is portable across compilers.
//
-void __mfa (void);
+void __mfa (void);
#define MEMORY_FENCE() __mfa()
#ifdef EFI_NO_INTERFACE_DECL
diff --git a/stand/efi/libefi/devpath.c b/stand/efi/libefi/devpath.c
index 85a5459c7d6b..db152f8eb9ad 100644
--- a/stand/efi/libefi/devpath.c
+++ b/stand/efi/libefi/devpath.c
@@ -491,7 +491,7 @@ efi_devpath_to_name(EFI_DEVICE_PATH *devpath)
free(ptr);
ptr = out;
}
-
+
return (ptr);
}
diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c
index 5813e2d20aef..cbb4dd01d1fb 100644
--- a/stand/efi/libefi/efi_console.c
+++ b/stand/efi/libefi/efi_console.c
@@ -552,7 +552,7 @@ curs_move(int *_x, int *_y, int x, int y)
if (_y != NULL)
*_y = conout->Mode->CursorRow;
}
-
+
/* Clear internal state of the terminal emulation code. */
void
end_term(void)
@@ -687,7 +687,7 @@ HO(void)
args[0] = args[1] = 1;
CM();
}
-
+
/* Clear line from current position to end of line */
static void
CL(int direction)
@@ -710,7 +710,7 @@ CL(int direction)
default: /* NOTREACHED */
__unreachable();
}
-
+
if (cury == y - 1)
len--;
@@ -725,7 +725,7 @@ CL(int direction)
if (direction != 0)
curs_move(NULL, NULL, 0, cury);
-
+
conout->OutputString(conout, line);
/* restore cursor position */
curs_move(NULL, NULL, curx, cury);
@@ -742,7 +742,7 @@ get_arg(int c)
args[argc] += c - '0';
}
#endif
-
+
/* Emulate basic capabilities of cons25 terminal */
static void
efi_term_emu(int c)
@@ -755,7 +755,7 @@ efi_term_emu(int c)
};
int t, i;
EFI_STATUS status;
-
+
switch (esc) {
case 0:
switch (c) {
diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c
index f1ce14eb50f8..2aa592da47f4 100644
--- a/stand/efi/libefi/eficom.c
+++ b/stand/efi/libefi/eficom.c
@@ -336,7 +336,7 @@ comc_probe(struct console *sc)
return;
}
- if (env != NULL)
+ if (env != NULL)
unsetenv("efi_com_port");
snprintf(value, sizeof (value), "%u", comc_port->ioaddr);
env_setenv("efi_com_port", EV_VOLATILE, value,
@@ -497,7 +497,7 @@ comc_port_set(struct env_var *ev, int flags, const void *value)
if (value == NULL || comc_port == NULL)
return (CMD_ERROR);
- if (comc_parse_intval(value, &port) != CMD_OK)
+ if (comc_parse_intval(value, &port) != CMD_OK)
return (CMD_ERROR);
handle = efi_serial_get_handle(port, NULL);
@@ -532,7 +532,7 @@ comc_speed_set(struct env_var *ev, int flags, const void *value)
if (value == NULL || comc_port == NULL)
return (CMD_ERROR);
- if (comc_parse_intval(value, &speed) != CMD_OK)
+ if (comc_parse_intval(value, &speed) != CMD_OK)
return (CMD_ERROR);
comc_port->newbaudrate = speed;
diff --git a/stand/efi/libefi/efinet.c b/stand/efi/libefi/efinet.c
index 97890c9d9b43..186d816cd323 100644
--- a/stand/efi/libefi/efinet.c
+++ b/stand/efi/libefi/efinet.c
@@ -48,7 +48,7 @@ static int efinet_match(struct netif *, void *);
static int efinet_probe(struct netif *, void *);
static ssize_t efinet_put(struct iodesc *, void *, size_t);
-struct netif_driver efinetif = {
+struct netif_driver efinetif = {
.netif_bname = "efinet",
.netif_match = efinet_match,
.netif_probe = efinet_probe,
@@ -150,7 +150,7 @@ efinet_put(struct iodesc *desc, void *pkt, size_t len)
buf = NULL; /* XXX Is this needed? */
status = net->GetStatus(net, NULL, &buf);
/*
- * XXX EFI1.1 and the E1000 card returns a different
+ * XXX EFI1.1 and the E1000 card returns a different
* address than we gave. Sigh.
*/
} while (status == EFI_SUCCESS && buf == NULL);
@@ -328,7 +328,7 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
static void
efinet_end(struct netif *nif)
{
- EFI_SIMPLE_NETWORK *net = nif->nif_devdata;
+ EFI_SIMPLE_NETWORK *net = nif->nif_devdata;
if (net == NULL)
return;
diff --git a/stand/efi/libefi/time.c b/stand/efi/libefi/time.c
index 99d86e30ee96..aa8508879b20 100644
--- a/stand/efi/libefi/time.c
+++ b/stand/efi/libefi/time.c
@@ -175,7 +175,7 @@ from_efi_time(EFI_TIME *ETime)
/*
* UTime should now be set to 00:00:00 on Jan 1 of the file's year.
*
- * Months
+ * Months
*/
UTime += (CumulativeDays[isleap(ETime->Year)][ETime->Month] *
SECSPERDAY);
diff --git a/stand/efi/loader/arch/amd64/multiboot2.h b/stand/efi/loader/arch/amd64/multiboot2.h
index 5693923c014f..a039aa0439aa 100644
--- a/stand/efi/loader/arch/amd64/multiboot2.h
+++ b/stand/efi/loader/arch/amd64/multiboot2.h
@@ -244,7 +244,7 @@ struct multiboot_tag_mmap
multiboot_uint32_t size;
multiboot_uint32_t entry_size;
multiboot_uint32_t entry_version;
- struct multiboot_mmap_entry entries[0];
+ struct multiboot_mmap_entry entries[0];
};
struct multiboot_vbe_info_block
@@ -388,7 +388,7 @@ struct multiboot_tag_efi_mmap
multiboot_uint32_t descr_size;
multiboot_uint32_t descr_vers;
multiboot_uint8_t efi_mmap[0];
-};
+};
struct multiboot_tag_efi32_ih
{
diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c
index ca86a319613f..75d755686658 100644
--- a/stand/efi/loader/bootinfo.c
+++ b/stand/efi/loader/bootinfo.c
@@ -414,7 +414,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
/* Handle device tree blob */
dtbp = addr;
dtb_size = fdt_copy(addr);
-
+
/* Pad to a page boundary */
if (dtb_size)
addr += roundup(dtb_size, PAGE_SIZE);
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index f592f8ecf495..2384fd08b964 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -4,7 +4,7 @@
* All rights reserved.
*
* Copyright (c) 2016-2019 Netflix, Inc. written by M. Warner Losh
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
diff --git a/stand/kboot/include/efi.h b/stand/kboot/include/efi.h
new file mode 100644
index 000000000000..10368bd4a829
--- /dev/null
+++ b/stand/kboot/include/efi.h
@@ -0,0 +1,17 @@
+/*-
+ * Copyright (c) 2024, Netflix, Inc.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <sys/efi.h>
+#include <machine/metadata.h>
+
+/* Note, we mix and match FreeBSD types and EFI standard defined types */
+
+typedef void (*efi_map_entry_cb)(struct efi_md *, void *argp);
+
+void foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void *argp);
+void print_efi_map(struct efi_map_header *efihdr);
diff --git a/stand/kboot/include/seg.h b/stand/kboot/include/seg.h
new file mode 100644
index 000000000000..5ca30670bdd1
--- /dev/null
+++ b/stand/kboot/include/seg.h
@@ -0,0 +1,24 @@
+/*-
+ * Copyright (c) 2024, Netflix, Inc.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+struct memory_segments
+{
+ uint64_t start;
+ uint64_t end;
+ uint64_t type; /* MD defined */
+};
+
+#define SYSTEM_RAM 1
+void init_avail(void);
+void need_avail(int n);
+void add_avail(uint64_t start, uint64_t end, uint64_t type);
+void remove_avail(uint64_t start, uint64_t end, uint64_t type);
+uint64_t first_avail(uint64_t align, uint64_t min_size, uint64_t type);
+void print_avail(void);
+bool populate_avail_from_iomem(void);
+uint64_t space_avail(uint64_t start);
diff --git a/stand/kboot/include/util.h b/stand/kboot/include/util.h
new file mode 100644
index 000000000000..ca71277bc66a
--- /dev/null
+++ b/stand/kboot/include/util.h
@@ -0,0 +1,10 @@
+/*-
+ * Copyright (c) 2022, Netflix, Inc.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+bool file2str(const char *fn, char *buffer, size_t buflen);
+bool file2u64(const char *fn, uint64_t *val);
diff --git a/stand/kboot/kboot/Makefile b/stand/kboot/kboot/Makefile
index 064d43701ebd..19bae09df5ea 100644
--- a/stand/kboot/kboot/Makefile
+++ b/stand/kboot/kboot/Makefile
@@ -25,8 +25,6 @@ SRCS= \
hostfs.c \
init.c \
main.c \
- seg.c \
- util.c \
vers.c
.if ${MK_FDT} != "no"
diff --git a/stand/kboot/kboot/arch/aarch64/load_addr.c b/stand/kboot/kboot/arch/aarch64/load_addr.c
index 8ea3516a5cff..8ceb21007c45 100644
--- a/stand/kboot/kboot/arch/aarch64/load_addr.c
+++ b/stand/kboot/kboot/arch/aarch64/load_addr.c
@@ -5,7 +5,6 @@
*/
#include <sys/param.h>
-#include <sys/efi.h>
#include <machine/metadata.h>
#include <sys/linker.h>
#include <fdt_platform.h>
@@ -13,6 +12,7 @@
#include "kboot.h"
#include "bootstrap.h"
+#include "efi.h"
/*
* Info from dtb about the EFI system
@@ -23,87 +23,6 @@ uint32_t efi_map_size;
vm_paddr_t efi_map_phys_src; /* From DTB */
vm_paddr_t efi_map_phys_dst; /* From our memory map metadata module */
-typedef void (*efi_map_entry_cb)(struct efi_md *, void *argp);
-
-static void
-foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void *argp)
-{
- struct efi_md *map, *p;
- size_t efisz;
- int ndesc, i;
-
- /*
- * Memory map data provided by UEFI via the GetMemoryMap
- * Boot Services API.
- */
- efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf;
- map = (struct efi_md *)((uint8_t *)efihdr + efisz);
-
- if (efihdr->descriptor_size == 0)
- return;
- ndesc = efihdr->memory_size / efihdr->descriptor_size;
-
- for (i = 0, p = map; i < ndesc; i++,
- p = efi_next_descriptor(p, efihdr->descriptor_size)) {
- cb(p, argp);
- }
-}
-
-static void
-print_efi_map_entry(struct efi_md *p, void *argp __unused)
-{
- const char *type;
- static const char *types[] = {
- "Reserved",
- "LoaderCode",
- "LoaderData",
- "BootServicesCode",
- "BootServicesData",
- "RuntimeServicesCode",
- "RuntimeServicesData",
- "ConventionalMemory",
- "UnusableMemory",
- "ACPIReclaimMemory",
- "ACPIMemoryNVS",
- "MemoryMappedIO",
- "MemoryMappedIOPortSpace",
- "PalCode",
- "PersistentMemory"
- };
-
- if (p->md_type < nitems(types))
- type = types[p->md_type];
- else
- type = "<INVALID>";
- printf("%23s %012lx %012lx %08lx ", type, p->md_phys,
- p->md_virt, p->md_pages);
- if (p->md_attr & EFI_MD_ATTR_UC)
- printf("UC ");
- if (p->md_attr & EFI_MD_ATTR_WC)
- printf("WC ");
- if (p->md_attr & EFI_MD_ATTR_WT)
- printf("WT ");
- if (p->md_attr & EFI_MD_ATTR_WB)
- printf("WB ");
- if (p->md_attr & EFI_MD_ATTR_UCE)
- printf("UCE ");
- if (p->md_attr & EFI_MD_ATTR_WP)
- printf("WP ");
- if (p->md_attr & EFI_MD_ATTR_RP)
- printf("RP ");
- if (p->md_attr & EFI_MD_ATTR_XP)
- printf("XP ");
- if (p->md_attr & EFI_MD_ATTR_NV)
- printf("NV ");
- if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
- printf("MORE_RELIABLE ");
- if (p->md_attr & EFI_MD_ATTR_RO)
- printf("RO ");
- if (p->md_attr & EFI_MD_ATTR_RT)
- printf("RUNTIME");
- printf("\n");
-}
-
static bool
do_memory_from_fdt(int fd)
{
@@ -169,7 +88,7 @@ do_memory_from_fdt(int fd)
* so early boot can copy the memory map into this space and have the
* rest of the code cope.
*/
- efisz = (sizeof(*efihdr) + 0xf) & ~0xf;
+ efisz = roundup2(sizeof(*efihdr), 16);
buf = malloc(sz + efisz);
if (buf == NULL)
return false;
@@ -212,9 +131,7 @@ do_memory_from_fdt(int fd)
efi_map_phys_src = 0; /* Mark MODINFOMD_EFI_MAP as valid */
close(fd2);
printf("UEFI MAP:\n");
- printf("%23s %12s %12s %8s %4s\n",
- "Type", "Physical", "Virtual", "#Pages", "Attr");
- foreach_efi_map_entry(efihdr, print_efi_map_entry, NULL);
+ print_efi_map(efihdr);
return true; /* OK, we really have the memory map */
no_read:
diff --git a/stand/kboot/kboot/kboot.h b/stand/kboot/kboot/kboot.h
index 49e5dea25b12..cbacf8d1e453 100644
--- a/stand/kboot/kboot/kboot.h
+++ b/stand/kboot/kboot/kboot.h
@@ -9,13 +9,6 @@
#define DEVT_HOSTDISK 1234
-struct memory_segments
-{
- uint64_t start;
- uint64_t end;
- uint64_t type; /* MD defined */
-};
-
bool enumerate_memory_arch(void);
struct preloaded_file;
void bi_loadsmap(struct preloaded_file *kfp);
@@ -40,19 +33,7 @@ const char *hostdisk_gen_probe(void);
void hostdisk_zfs_probe(void);
bool hostdisk_zfs_find_default(void);
-/* seg.c */
-#define SYSTEM_RAM 1
-void init_avail(void);
-void need_avail(int n);
-void add_avail(uint64_t start, uint64_t end, uint64_t type);
-void remove_avail(uint64_t start, uint64_t end, uint64_t type);
-uint64_t first_avail(uint64_t align, uint64_t min_size, uint64_t type);
-void print_avail(void);
-bool populate_avail_from_iomem(void);
-uint64_t space_avail(uint64_t start);
-
-/* util.c */
-bool file2str(const char *fn, char *buffer, size_t buflen);
-bool file2u64(const char *fn, uint64_t *val);
+#include "seg.h"
+#include "util.h"
#endif /* KBOOT_H */
diff --git a/stand/kboot/libkboot/Makefile b/stand/kboot/libkboot/Makefile
index d9ce08cb0856..e23ae9bb9215 100644
--- a/stand/kboot/libkboot/Makefile
+++ b/stand/kboot/libkboot/Makefile
@@ -6,10 +6,16 @@ WARNS?= 4
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}
CFLAGS+=-I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH}
-SRCS= crt1.c \
- host_syscall.S \
- host_syscalls.c \
- termios.c
+SRCS= crt1.c
+SRCS+= host_syscall.S
+SRCS+= host_syscalls.c
+SRCS+= seg.c
+SRCS+= termios.c
+SRCS+= util.c
+
+.if ${MACHINE_ARCH} != "powerpc64"
+SRCS+= efi.c
+.endif
.sinclude "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
diff --git a/stand/kboot/libkboot/efi.c b/stand/kboot/libkboot/efi.c
new file mode 100644
index 000000000000..1f7f28093819
--- /dev/null
+++ b/stand/kboot/libkboot/efi.c
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2024 Netflix, Inc
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <sys/param.h>
+#include "stand.h"
+#include "efi.h"
+
+void
+foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void *argp)
+{
+ struct efi_md *map, *p;
+ size_t efisz;
+ int ndesc, i;
+
+ /*
+ * Memory map data provided by UEFI via the GetMemoryMap
+ * Boot Services API.
+ */
+ efisz = roundup2(sizeof(struct efi_map_header), 16);
+ map = (struct efi_md *)((uint8_t *)efihdr + efisz);
+
+ if (efihdr->descriptor_size == 0)
+ return;
+ ndesc = efihdr->memory_size / efihdr->descriptor_size;
+
+ for (i = 0, p = map; i < ndesc; i++,
+ p = efi_next_descriptor(p, efihdr->descriptor_size)) {
+ cb(p, argp);
+ }
+}
+
+static void
+print_efi_map_entry(struct efi_md *p, void *argp __unused)
+{
+ const char *type;
+ static const char *types[] = {
+ "Reserved",
+ "LoaderCode",
+ "LoaderData",
+ "BootServicesCode",
+ "BootServicesData",
+ "RuntimeServicesCode",
+ "RuntimeServicesData",
+ "ConventionalMemory",
+ "UnusableMemory",
+ "ACPIReclaimMemory",
+ "ACPIMemoryNVS",
+ "MemoryMappedIO",
+ "MemoryMappedIOPortSpace",
+ "PalCode",
+ "PersistentMemory"
+ };
+
+ if (p->md_type < nitems(types))
+ type = types[p->md_type];
+ else
+ type = "<INVALID>";
+ printf("%23s %012lx %012lx %08lx ", type, p->md_phys,
+ p->md_virt, p->md_pages);
+ if (p->md_attr & EFI_MD_ATTR_UC)
+ printf("UC ");
+ if (p->md_attr & EFI_MD_ATTR_WC)
+ printf("WC ");
+ if (p->md_attr & EFI_MD_ATTR_WT)
+ printf("WT ");
+ if (p->md_attr & EFI_MD_ATTR_WB)
+ printf("WB ");
+ if (p->md_attr & EFI_MD_ATTR_UCE)
+ printf("UCE ");
+ if (p->md_attr & EFI_MD_ATTR_WP)
+ printf("WP ");
+ if (p->md_attr & EFI_MD_ATTR_RP)
+ printf("RP ");
+ if (p->md_attr & EFI_MD_ATTR_XP)
+ printf("XP ");
+ if (p->md_attr & EFI_MD_ATTR_NV)
+ printf("NV ");
+ if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
+ printf("MORE_RELIABLE ");
+ if (p->md_attr & EFI_MD_ATTR_RO)
+ printf("RO ");
+ if (p->md_attr & EFI_MD_ATTR_RT)
+ printf("RUNTIME");
+ printf("\n");
+}
+
+void
+print_efi_map(struct efi_map_header *efihdr)
+{
+ printf("%23s %12s %12s %8s %4s\n",
+ "Type", "Physical", "Virtual", "#Pages", "Attr");
+
+ foreach_efi_map_entry(efihdr, print_efi_map_entry, NULL);
+}
diff --git a/stand/kboot/kboot/seg.c b/stand/kboot/libkboot/seg.c
index 558cac501224..6979d5cfa5fd 100644
--- a/stand/kboot/kboot/seg.c
+++ b/stand/kboot/libkboot/seg.c
@@ -5,7 +5,7 @@
*/
#include "stand.h"
-#include "kboot.h"
+#include "seg.h"
#include <sys/param.h>
@@ -20,6 +20,7 @@ init_avail(void)
free(segs);
nr_seg = 0;
segalloc = 16;
+ free(segs);
segs = malloc(sizeof(*segs) * segalloc);
if (segs == NULL)
panic("not enough memory to get memory map\n");
diff --git a/stand/kboot/libkboot/termios.c b/stand/kboot/libkboot/termios.c
index ec62170a44c9..cd25b252f735 100644
--- a/stand/kboot/libkboot/termios.c
+++ b/stand/kboot/libkboot/termios.c
@@ -22,7 +22,7 @@ int
host_tcsetattr(int fd, int act, const struct host_termios *tio)
{
if (act < 0 || act > 2) {
-// errno = EINVAL; /* XXX ?? */
+ errno = EINVAL; /* XXX ?? */
return -1;
}
return host_ioctl(fd, HOST_TCSETS+act, (uintptr_t)tio);
diff --git a/stand/kboot/kboot/util.c b/stand/kboot/libkboot/util.c
index 7d467a29b059..0100a7cc5d8a 100644
--- a/stand/kboot/kboot/util.c
+++ b/stand/kboot/libkboot/util.c
@@ -6,7 +6,7 @@
#include "stand.h"
#include "host_syscall.h"
-#include "kboot.h"
+#include "util.h"
bool
file2str(const char *fn, char *buffer, size_t buflen)
diff --git a/stand/libsa/smbios.c b/stand/libsa/smbios.c
index 618c8a1052ec..32cd198a9537 100644
--- a/stand/libsa/smbios.c
+++ b/stand/libsa/smbios.c
@@ -461,6 +461,7 @@ smbios_parse_table(const caddr_t addr)
break;
case 4: /* 3.3.5 Processor Information (Type 4) */
+ smbios_setenv("smbios.processor.version", addr, 0x10);
/*
* Offset 18h: Processor Status
*
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 1041422b9f92..09ac0a67dbef 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -436,7 +436,7 @@ trap(struct trapframe *frame)
curpcb->pcb_onfault != NULL && type != T_PAGEFLT) {
u_long cnt = atomic_fetchadd_long(&cnt_efirt_faults, 1);
- if ((print_efirt_faults == 1 && cnt == 1) ||
+ if ((print_efirt_faults == 1 && cnt == 0) ||
print_efirt_faults == 2) {
trap_diag(frame, 0);
printf("EFI RT fault %s\n",
@@ -869,8 +869,13 @@ after_vmfault:
if (td->td_intr_nesting_level == 0 &&
curpcb->pcb_onfault != NULL) {
if ((td->td_pflags & TDP_EFIRT) != 0) {
- trap_diag(frame, eva);
- printf("EFI RT page fault\n");
+ u_long cnt = atomic_fetchadd_long(&cnt_efirt_faults, 1);
+
+ if ((print_efirt_faults == 1 && cnt == 0) ||
+ print_efirt_faults == 2) {
+ trap_diag(frame, eva);
+ printf("EFI RT page fault\n");
+ }
}
frame->tf_rip = (long)curpcb->pcb_onfault;
return (0);
diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c
index 87283325600c..831c31277570 100644
--- a/sys/amd64/vmm/amd/amdvi_hw.c
+++ b/sys/amd64/vmm/amd/amdvi_hw.c
@@ -1155,9 +1155,9 @@ amdvi_update_mapping(struct amdvi_domain *domain, vm_paddr_t gpa,
return (mapped);
}
-static uint64_t
+static int
amdvi_create_mapping(void *arg, vm_paddr_t gpa, vm_paddr_t hpa,
- uint64_t len)
+ uint64_t len, uint64_t *res_len)
{
struct amdvi_domain *domain;
@@ -1165,7 +1165,7 @@ amdvi_create_mapping(void *arg, vm_paddr_t gpa, vm_paddr_t hpa,
if (domain->id && !domain->ptp) {
printf("ptp is NULL");
- return (-1);
+ return (EINVAL);
}
/*
@@ -1173,13 +1173,14 @@ amdvi_create_mapping(void *arg, vm_paddr_t gpa, vm_paddr_t hpa,
* table set-up.
*/
if (domain->ptp)
- return (amdvi_update_mapping(domain, gpa, hpa, len, true));
+ *res_len = amdvi_update_mapping(domain, gpa, hpa, len, true);
else
- return (len);
+ *res_len = len;
+ return (0);
}
-static uint64_t
-amdvi_remove_mapping(void *arg, vm_paddr_t gpa, uint64_t len)
+static int
+amdvi_remove_mapping(void *arg, vm_paddr_t gpa, uint64_t len, uint64_t *res_len)
{
struct amdvi_domain *domain;
@@ -1189,9 +1190,10 @@ amdvi_remove_mapping(void *arg, vm_paddr_t gpa, uint64_t len)
* table set-up.
*/
if (domain->ptp)
- return (amdvi_update_mapping(domain, gpa, 0, len, false));
- return
- (len);
+ *res_len = amdvi_update_mapping(domain, gpa, 0, len, false);
+ else
+ *res_len = len;
+ return (0);
}
static struct amdvi_softc *
@@ -1268,8 +1270,8 @@ amdvi_inv_device(struct amdvi_softc *softc, uint16_t devid)
amdvi_wait(softc);
}
-static void
-amdvi_add_device(void *arg, uint16_t devid)
+static int
+amdvi_add_device(void *arg, device_t dev __unused, uint16_t devid)
{
struct amdvi_domain *domain;
struct amdvi_softc *softc;
@@ -1282,13 +1284,14 @@ amdvi_add_device(void *arg, uint16_t devid)
#endif
softc = amdvi_find_iommu(devid);
if (softc == NULL)
- return;
+ return (ENXIO);
amdvi_set_dte(domain, softc, devid, true);
amdvi_inv_device(softc, devid);
+ return (0);
}
-static void
-amdvi_remove_device(void *arg, uint16_t devid)
+static int
+amdvi_remove_device(void *arg, device_t dev __unused, uint16_t devid)
{
struct amdvi_domain *domain;
struct amdvi_softc *softc;
@@ -1300,9 +1303,10 @@ amdvi_remove_device(void *arg, uint16_t devid)
#endif
softc = amdvi_find_iommu(devid);
if (softc == NULL)
- return;
+ return (ENXIO);
amdvi_set_dte(domain, softc, devid, false);
amdvi_inv_device(softc, devid);
+ return (0);
}
static void
@@ -1357,7 +1361,7 @@ amdvi_disable(void)
}
}
-static void
+static int
amdvi_invalidate_tlb(void *arg)
{
struct amdvi_domain *domain;
@@ -1365,6 +1369,7 @@ amdvi_invalidate_tlb(void *arg)
domain = (struct amdvi_domain *)arg;
KASSERT(domain, ("domain is NULL"));
amdvi_do_inv_domain(domain->id, false);
+ return (0);
}
const struct iommu_ops iommu_ops_amd = {
diff --git a/sys/amd64/vmm/intel/vtd.c b/sys/amd64/vmm/intel/vtd.c
index 72cedeca6ec1..b56541290a9d 100644
--- a/sys/amd64/vmm/intel/vtd.c
+++ b/sys/amd64/vmm/intel/vtd.c
@@ -431,8 +431,8 @@ vtd_disable(void)
}
}
-static void
-vtd_add_device(void *arg, uint16_t rid)
+static int
+vtd_add_device(void *arg, device_t dev __unused, uint16_t rid)
{
int idx;
uint64_t *ctxp;
@@ -475,10 +475,11 @@ vtd_add_device(void *arg, uint16_t rid)
* 'Not Present' entries are not cached in either the Context Cache
* or in the IOTLB, so there is no need to invalidate either of them.
*/
+ return (0);
}
-static void
-vtd_remove_device(void *arg, uint16_t rid)
+static int
+vtd_remove_device(void *arg, device_t dev __unused, uint16_t rid)
{
int i, idx;
uint64_t *ctxp;
@@ -506,6 +507,7 @@ vtd_remove_device(void *arg, uint16_t rid)
vtd_ctx_global_invalidate(vtdmap);
vtd_iotlb_global_invalidate(vtdmap);
}
+ return (0);
}
#define CREATE_MAPPING 0
@@ -600,21 +602,24 @@ vtd_update_mapping(void *arg, vm_paddr_t gpa, vm_paddr_t hpa, uint64_t len,
return (1UL << ptpshift);
}
-static uint64_t
-vtd_create_mapping(void *arg, vm_paddr_t gpa, vm_paddr_t hpa, uint64_t len)
+static int
+vtd_create_mapping(void *arg, vm_paddr_t gpa, vm_paddr_t hpa, uint64_t len,
+ uint64_t *res_len)
{
- return (vtd_update_mapping(arg, gpa, hpa, len, CREATE_MAPPING));
+ *res_len = vtd_update_mapping(arg, gpa, hpa, len, CREATE_MAPPING);
+ return (0);
}
-static uint64_t
-vtd_remove_mapping(void *arg, vm_paddr_t gpa, uint64_t len)
+static int
+vtd_remove_mapping(void *arg, vm_paddr_t gpa, uint64_t len, uint64_t *res_len)
{
- return (vtd_update_mapping(arg, gpa, 0, len, REMOVE_MAPPING));
+ *res_len = vtd_update_mapping(arg, gpa, 0, len, REMOVE_MAPPING);
+ return (0);
}
-static void
+static int
vtd_invalidate_tlb(void *dom)
{
int i;
@@ -628,6 +633,7 @@ vtd_invalidate_tlb(void *dom)
vtdmap = vtdmaps[i];
vtd_iotlb_global_invalidate(vtdmap);
}
+ return (0);
}
static void *
diff --git a/sys/amd64/vmm/io/iommu.c b/sys/amd64/vmm/io/iommu.c
index dc4a0de94bb6..9fc612244699 100644
--- a/sys/amd64/vmm/io/iommu.c
+++ b/sys/amd64/vmm/io/iommu.c
@@ -58,6 +58,8 @@ static const struct iommu_ops *ops;
static void *host_domain;
static eventhandler_tag add_tag, delete_tag;
+static void iommu_cleanup_int(bool iommu_disable);
+
static __inline int
IOMMU_INIT(void)
{
@@ -92,48 +94,51 @@ IOMMU_DESTROY_DOMAIN(void *dom)
(*ops->destroy_domain)(dom);
}
-static __inline uint64_t
-IOMMU_CREATE_MAPPING(void *domain, vm_paddr_t gpa, vm_paddr_t hpa, uint64_t len)
+static __inline int
+IOMMU_CREATE_MAPPING(void *domain, vm_paddr_t gpa, vm_paddr_t hpa,
+ uint64_t len, uint64_t *res_len)
{
if (ops != NULL && iommu_avail)
- return ((*ops->create_mapping)(domain, gpa, hpa, len));
- else
- return (len); /* XXX */
+ return ((*ops->create_mapping)(domain, gpa, hpa, len, res_len));
+ return (EOPNOTSUPP);
}
static __inline uint64_t
-IOMMU_REMOVE_MAPPING(void *domain, vm_paddr_t gpa, uint64_t len)
+IOMMU_REMOVE_MAPPING(void *domain, vm_paddr_t gpa, uint64_t len,
+ uint64_t *res_len)
{
if (ops != NULL && iommu_avail)
- return ((*ops->remove_mapping)(domain, gpa, len));
- else
- return (len); /* XXX */
+ return ((*ops->remove_mapping)(domain, gpa, len, res_len));
+ return (EOPNOTSUPP);
}
-static __inline void
-IOMMU_ADD_DEVICE(void *domain, uint16_t rid)
+static __inline int
+IOMMU_ADD_DEVICE(void *domain, device_t dev, uint16_t rid)
{
if (ops != NULL && iommu_avail)
- (*ops->add_device)(domain, rid);
+ return ((*ops->add_device)(domain, dev, rid));
+ return (EOPNOTSUPP);
}
-static __inline void
-IOMMU_REMOVE_DEVICE(void *domain, uint16_t rid)
+static __inline int
+IOMMU_REMOVE_DEVICE(void *domain, device_t dev, uint16_t rid)
{
if (ops != NULL && iommu_avail)
- (*ops->remove_device)(domain, rid);
+ return ((*ops->remove_device)(domain, dev, rid));
+ return (0); /* To allow ppt_attach() to succeed. */
}
-static __inline void
+static __inline int
IOMMU_INVALIDATE_TLB(void *domain)
{
if (ops != NULL && iommu_avail)
- (*ops->invalidate_tlb)(domain);
+ return ((*ops->invalidate_tlb)(domain));
+ return (0);
}
static __inline void
@@ -157,14 +162,14 @@ iommu_pci_add(void *arg, device_t dev)
{
/* Add new devices to the host domain. */
- iommu_add_device(host_domain, pci_get_rid(dev));
+ iommu_add_device(host_domain, dev, pci_get_rid(dev));
}
static void
iommu_pci_delete(void *arg, device_t dev)
{
- iommu_remove_device(host_domain, pci_get_rid(dev));
+ iommu_remove_device(host_domain, dev, pci_get_rid(dev));
}
static void
@@ -230,17 +235,24 @@ iommu_init(void)
* Everything else belongs to the host
* domain.
*/
- iommu_add_device(host_domain,
+ error = iommu_add_device(host_domain, dev,
pci_get_rid(dev));
+ if (error != 0 && error != ENXIO) {
+ printf(
+ "iommu_add_device(%s rid %#x) failed, error %d\n",
+ device_get_name(dev),
+ pci_get_rid(dev), error);
+ iommu_cleanup_int(false);
+ return;
+ }
}
}
}
IOMMU_ENABLE();
-
}
-void
-iommu_cleanup(void)
+static void
+iommu_cleanup_int(bool iommu_disable)
{
if (add_tag != NULL) {
@@ -251,12 +263,19 @@ iommu_cleanup(void)
EVENTHANDLER_DEREGISTER(pci_delete_device, delete_tag);
delete_tag = NULL;
}
- IOMMU_DISABLE();
+ if (iommu_disable)
+ IOMMU_DISABLE();
IOMMU_DESTROY_DOMAIN(host_domain);
host_domain = NULL;
IOMMU_CLEANUP();
}
+void
+iommu_cleanup(void)
+{
+ iommu_cleanup_int(true);
+}
+
void *
iommu_create_domain(vm_paddr_t maxaddr)
{
@@ -280,33 +299,39 @@ iommu_destroy_domain(void *dom)
IOMMU_DESTROY_DOMAIN(dom);
}
-void
+int
iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa, size_t len)
{
uint64_t mapped, remaining;
-
- remaining = len;
-
- while (remaining > 0) {
- mapped = IOMMU_CREATE_MAPPING(dom, gpa, hpa, remaining);
- gpa += mapped;
- hpa += mapped;
- remaining -= mapped;
+ int error;
+
+ for (remaining = len; remaining > 0; gpa += mapped, hpa += mapped,
+ remaining -= mapped) {
+ error = IOMMU_CREATE_MAPPING(dom, gpa, hpa, remaining,
+ &mapped);
+ if (error != 0) {
+ /* XXXKIB rollback */
+ return (error);
+ }
}
+ return (0);
}
-void
+int
iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len)
{
uint64_t unmapped, remaining;
-
- remaining = len;
-
- while (remaining > 0) {
- unmapped = IOMMU_REMOVE_MAPPING(dom, gpa, remaining);
- gpa += unmapped;
- remaining -= unmapped;
+ int error;
+
+ for (remaining = len; remaining > 0; gpa += unmapped,
+ remaining -= unmapped) {
+ error = IOMMU_REMOVE_MAPPING(dom, gpa, remaining, &unmapped);
+ if (error != 0) {
+ /* XXXKIB ? */
+ return (error);
+ }
}
+ return (0);
}
void *
@@ -316,23 +341,23 @@ iommu_host_domain(void)
return (host_domain);
}
-void
-iommu_add_device(void *dom, uint16_t rid)
+int
+iommu_add_device(void *dom, device_t dev, uint16_t rid)
{
- IOMMU_ADD_DEVICE(dom, rid);
+ return (IOMMU_ADD_DEVICE(dom, dev, rid));
}
-void
-iommu_remove_device(void *dom, uint16_t rid)
+int
+iommu_remove_device(void *dom, device_t dev, uint16_t rid)
{
- IOMMU_REMOVE_DEVICE(dom, rid);
+ return (IOMMU_REMOVE_DEVICE(dom, dev, rid));
}
-void
+int
iommu_invalidate_tlb(void *domain)
{
- IOMMU_INVALIDATE_TLB(domain);
+ return (IOMMU_INVALIDATE_TLB(domain));
}
diff --git a/sys/amd64/vmm/io/iommu.h b/sys/amd64/vmm/io/iommu.h
index c2891b62b5f2..5294a9d92a6b 100644
--- a/sys/amd64/vmm/io/iommu.h
+++ b/sys/amd64/vmm/io/iommu.h
@@ -35,13 +35,13 @@ typedef void (*iommu_enable_func_t)(void);
typedef void (*iommu_disable_func_t)(void);
typedef void *(*iommu_create_domain_t)(vm_paddr_t maxaddr);
typedef void (*iommu_destroy_domain_t)(void *domain);
-typedef uint64_t (*iommu_create_mapping_t)(void *domain, vm_paddr_t gpa,
- vm_paddr_t hpa, uint64_t len);
-typedef uint64_t (*iommu_remove_mapping_t)(void *domain, vm_paddr_t gpa,
- uint64_t len);
-typedef void (*iommu_add_device_t)(void *domain, uint16_t rid);
-typedef void (*iommu_remove_device_t)(void *dom, uint16_t rid);
-typedef void (*iommu_invalidate_tlb_t)(void *dom);
+typedef int (*iommu_create_mapping_t)(void *domain, vm_paddr_t gpa,
+ vm_paddr_t hpa, uint64_t len, uint64_t *res_len);
+typedef int (*iommu_remove_mapping_t)(void *domain, vm_paddr_t gpa,
+ uint64_t len, uint64_t *res_len);
+typedef int (*iommu_add_device_t)(void *domain, device_t dev, uint16_t rid);
+typedef int (*iommu_remove_device_t)(void *dom, device_t dev, uint16_t rid);
+typedef int (*iommu_invalidate_tlb_t)(void *dom);
struct iommu_ops {
iommu_init_func_t init; /* module wide */
@@ -65,10 +65,10 @@ void iommu_cleanup(void);
void *iommu_host_domain(void);
void *iommu_create_domain(vm_paddr_t maxaddr);
void iommu_destroy_domain(void *dom);
-void iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa,
- size_t len);
-void iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len);
-void iommu_add_device(void *dom, uint16_t rid);
-void iommu_remove_device(void *dom, uint16_t rid);
-void iommu_invalidate_tlb(void *domain);
+int iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa,
+ size_t len);
+int iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len);
+int iommu_add_device(void *dom, device_t dev, uint16_t rid);
+int iommu_remove_device(void *dom, device_t dev, uint16_t rid);
+int iommu_invalidate_tlb(void *domain);
#endif
diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c
index 3b043c64fbde..c3b2b57da988 100644
--- a/sys/amd64/vmm/io/ppt.c
+++ b/sys/amd64/vmm/io/ppt.c
@@ -151,14 +151,19 @@ static int
ppt_attach(device_t dev)
{
struct pptdev *ppt;
- uint16_t cmd;
+ uint16_t cmd, cmd1;
+ int error;
ppt = device_get_softc(dev);
- cmd = pci_read_config(dev, PCIR_COMMAND, 2);
+ cmd1 = cmd = pci_read_config(dev, PCIR_COMMAND, 2);
cmd &= ~(PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN);
pci_write_config(dev, PCIR_COMMAND, cmd, 2);
- iommu_remove_device(iommu_host_domain(), pci_get_rid(dev));
+ error = iommu_remove_device(iommu_host_domain(), dev, pci_get_rid(dev));
+ if (error != 0) {
+ pci_write_config(dev, PCIR_COMMAND, cmd1, 2);
+ return (error);
+ }
num_pptdevs++;
TAILQ_INSERT_TAIL(&pptdev_list, ppt, next);
ppt->dev = dev;
@@ -173,17 +178,23 @@ static int
ppt_detach(device_t dev)
{
struct pptdev *ppt;
+ int error;
ppt = device_get_softc(dev);
if (ppt->vm != NULL)
return (EBUSY);
+ if (iommu_host_domain() != NULL) {
+ error = iommu_add_device(iommu_host_domain(), dev,
+ pci_get_rid(dev));
+ } else {
+ error = 0;
+ }
+ if (error != 0)
+ return (error);
num_pptdevs--;
TAILQ_REMOVE(&pptdev_list, ppt, next);
- if (iommu_host_domain() != NULL)
- iommu_add_device(iommu_host_domain(), pci_get_rid(dev));
-
return (0);
}
@@ -410,8 +421,11 @@ ppt_assign_device(struct vm *vm, int bus, int slot, int func)
pci_save_state(ppt->dev);
ppt_pci_reset(ppt->dev);
pci_restore_state(ppt->dev);
+ error = iommu_add_device(vm_iommu_domain(vm), ppt->dev,
+ pci_get_rid(ppt->dev));
+ if (error != 0)
+ return (error);
ppt->vm = vm;
- iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev));
cmd = pci_read_config(ppt->dev, PCIR_COMMAND, 2);
cmd |= PCIM_CMD_BUSMASTEREN | ppt_bar_enables(ppt);
pci_write_config(ppt->dev, PCIR_COMMAND, cmd, 2);
@@ -438,9 +452,10 @@ ppt_unassign_device(struct vm *vm, int bus, int slot, int func)
ppt_unmap_all_mmio(vm, ppt);
ppt_teardown_msi(ppt);
ppt_teardown_msix(ppt);
- iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev));
+ error = iommu_remove_device(vm_iommu_domain(vm), ppt->dev,
+ pci_get_rid(ppt->dev));
ppt->vm = NULL;
- return (0);
+ return (error);
}
int
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index 1d410835be88..c42da02d0bf6 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -745,12 +745,12 @@ vm_unmap_mmio(struct vm *vm, vm_paddr_t gpa, size_t len)
return (0);
}
-static void
+static int
vm_iommu_map(struct vm *vm)
{
vm_paddr_t gpa, hpa;
struct vm_mem_map *mm;
- int i;
+ int error, i;
sx_assert(&vm->mem.mem_segs_lock, SX_LOCKED);
@@ -789,15 +789,16 @@ vm_iommu_map(struct vm *vm)
}
}
- iommu_invalidate_tlb(iommu_host_domain());
+ error = iommu_invalidate_tlb(iommu_host_domain());
+ return (error);
}
-static void
+static int
vm_iommu_unmap(struct vm *vm)
{
vm_paddr_t gpa;
struct vm_mem_map *mm;
- int i;
+ int error, i;
sx_assert(&vm->mem.mem_segs_lock, SX_LOCKED);
@@ -826,7 +827,8 @@ vm_iommu_unmap(struct vm *vm)
* Invalidate the cached translations associated with the domain
* from which pages were removed.
*/
- iommu_invalidate_tlb(vm->iommu);
+ error = iommu_invalidate_tlb(vm->iommu);
+ return (error);
}
int
@@ -839,9 +841,9 @@ vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func)
return (error);
if (ppt_assigned_devices(vm) == 0)
- vm_iommu_unmap(vm);
+ error = vm_iommu_unmap(vm);
- return (0);
+ return (error);
}
int
@@ -849,6 +851,7 @@ vm_assign_pptdev(struct vm *vm, int bus, int slot, int func)
{
int error;
vm_paddr_t maxaddr;
+ bool map = false;
/* Set up the IOMMU to do the 'gpa' to 'hpa' translation */
if (ppt_assigned_devices(vm) == 0) {
@@ -858,10 +861,12 @@ vm_assign_pptdev(struct vm *vm, int bus, int slot, int func)
vm->iommu = iommu_create_domain(maxaddr);
if (vm->iommu == NULL)
return (ENXIO);
- vm_iommu_map(vm);
+ map = true;
}
error = ppt_assign_device(vm, bus, slot, func);
+ if (error == 0 && map)
+ error = vm_iommu_map(vm);
return (error);
}
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 31f888313d59..cfc0b32f5102 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -105,8 +105,8 @@
#endif
-#if __ARM_ARCH < 6
-#error FreeBSD requires ARMv6 or later
+#if __ARM_ARCH < 7
+#error FreeBSD requires ARMv7 or later
#endif
struct pcpu __pcpu[MAXCPU];
@@ -415,14 +415,26 @@ arm_kdb_init(void)
}
#ifdef FDT
+static void
+fdt_physmem_hardware_region_cb(const struct mem_region *mr, void *arg __unused)
+{
+ physmem_hardware_region(mr->mr_start, mr->mr_size);
+}
+
+static void
+fdt_physmem_exclude_region_cb(const struct mem_region *mr, void *arg __unused)
+{
+ physmem_exclude_region(mr->mr_start, mr->mr_size,
+ EXFLAG_NODUMP | EXFLAG_NOALLOC);
+}
+
void *
initarm(struct arm_boot_params *abp)
{
- struct mem_region mem_regions[FDT_MEM_REGIONS];
vm_paddr_t lastaddr;
vm_offset_t dtbp, kernelstack, dpcpu;
char *env;
- int err_devmap, mem_regions_sz;
+ int err_devmap;
phandle_t root;
char dts_version[255];
#ifdef EFI
@@ -469,15 +481,13 @@ initarm(struct arm_boot_params *abp)
#endif
{
/* Grab physical memory regions information from device tree. */
- if (fdt_get_mem_regions(mem_regions, &mem_regions_sz,NULL) != 0)
+ if (fdt_foreach_mem_region(fdt_physmem_hardware_region_cb,
+ NULL) != 0)
panic("Cannot get physical memory regions");
- physmem_hardware_regions(mem_regions, mem_regions_sz);
-
/* Grab reserved memory regions information from device tree. */
- if (fdt_get_reserved_regions(mem_regions, &mem_regions_sz) == 0)
- physmem_exclude_regions(mem_regions, mem_regions_sz,
- EXFLAG_NODUMP | EXFLAG_NOALLOC);
+ fdt_foreach_reserved_region(fdt_physmem_exclude_region_cb,
+ NULL);
}
/*
diff --git a/sys/arm/conf/std.qca b/sys/arm/conf/std.qca
index 24e6601f0939..ea6912606517 100644
--- a/sys/arm/conf/std.qca
+++ b/sys/arm/conf/std.qca
@@ -46,7 +46,7 @@ device mpcore_timer
device psci
# Clock/Reset provider
-device qcom_gcc_ipq4018
+device qcom_gcc
# TLMM (gpio/pinmux)
device gpio
diff --git a/sys/arm/include/metadata.h b/sys/arm/include/metadata.h
index 49f3a32826b8..d6f6f5ac8553 100644
--- a/sys/arm/include/metadata.h
+++ b/sys/arm/include/metadata.h
@@ -33,10 +33,15 @@
#define MODINFOMD_DTBP 0x1002
#define MODINFOMD_EFI_MAP 0x1003
+/*
+ * This is not the same as the UEFI standard EFI_MEMORY_ATTRIBUTES_TABLE, though
+ * memory_size / descritpr_size entries of EFI_MEMORY_DESCRIPTORS follow this table
+ * starting at a 16-byte alignment.
+ */
struct efi_map_header {
- uint64_t memory_size;
- uint64_t descriptor_size;
- uint32_t descriptor_version;
+ uint64_t memory_size; /* Numnber of bytes that follow */
+ uint64_t descriptor_size; /* Size of each EFI_MEMORY_DESCRIPTOR */
+ uint32_t descriptor_version; /* Currently '1' */
};
/*
diff --git a/sys/arm/mv/armadaxp/armadaxp.c b/sys/arm/mv/armadaxp/armadaxp.c
index 2835a0d6b637..17a4b082d686 100644
--- a/sys/arm/mv/armadaxp/armadaxp.c
+++ b/sys/arm/mv/armadaxp/armadaxp.c
@@ -49,11 +49,9 @@
#define FAB_FREQ_FIELD(sar) (((0x01 & (sar >> 51)) << 4) | \
(0x0F & (sar >> 24)))
-static uint32_t count_l2clk(void);
void armadaxp_l2_init(void);
void armadaxp_init_coher_fabric(void);
int platform_get_ncpus(void);
-static uint64_t get_sar_value_armadaxp(void);
#define ARMADAXP_L2_BASE (MV_BASE + 0x8000)
#define ARMADAXP_L2_CTRL 0x100
@@ -93,48 +91,6 @@ struct vco_freq_ratio {
uint8_t vco_ddr; /* VCO to DR(DDR memory) clock ratio */
};
-static struct vco_freq_ratio freq_conf_table[] = {
-/*00*/ { 1, 1, 4, 2 },
-/*01*/ { 1, 2, 2, 2 },
-/*02*/ { 2, 2, 6, 3 },
-/*03*/ { 2, 2, 3, 3 },
-/*04*/ { 1, 2, 3, 3 },
-/*05*/ { 1, 2, 4, 2 },
-/*06*/ { 1, 1, 2, 2 },
-/*07*/ { 2, 3, 6, 6 },
-/*08*/ { 2, 3, 5, 5 },
-/*09*/ { 1, 2, 6, 3 },
-/*10*/ { 2, 4, 10, 5 },
-/*11*/ { 1, 3, 6, 6 },
-/*12*/ { 1, 2, 5, 5 },
-/*13*/ { 1, 3, 6, 3 },
-/*14*/ { 1, 2, 5, 5 },
-/*15*/ { 2, 2, 5, 5 },
-/*16*/ { 1, 1, 3, 3 },
-/*17*/ { 2, 5, 10, 10 },
-/*18*/ { 1, 3, 8, 4 },
-/*19*/ { 1, 1, 2, 1 },
-/*20*/ { 2, 3, 6, 3 },
-/*21*/ { 1, 2, 8, 4 },
-/*22*/ { 2, 5, 10, 5 }
-};
-
-static uint16_t cpu_clock_table[] = {
- 1000, 1066, 1200, 1333, 1500, 1666, 1800, 2000, 600, 667, 800, 1600,
- 2133, 2200, 2400 };
-
-static uint64_t
-get_sar_value_armadaxp(void)
-{
- uint32_t sar_low, sar_high;
-
- sar_high = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
- SAMPLE_AT_RESET_HI);
- sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
- SAMPLE_AT_RESET_LO);
- return (((uint64_t)sar_high << 32) | sar_low);
-}
-
uint32_t
get_tclk_armadaxp(void)
{
@@ -157,57 +113,6 @@ get_cpu_freq_armadaxp(void)
}
static uint32_t
-count_l2clk(void)
-{
- uint64_t sar_reg;
- uint32_t freq_vco, freq_l2clk;
- uint8_t sar_cpu_freq, sar_fab_freq, array_size;
-
- /* Get value of the SAR register and process it */
- sar_reg = get_sar_value_armadaxp();
- sar_cpu_freq = CPU_FREQ_FIELD(sar_reg);
- sar_fab_freq = FAB_FREQ_FIELD(sar_reg);
-
- /* Check if CPU frequency field has correct value */
- array_size = nitems(cpu_clock_table);
- if (sar_cpu_freq >= array_size)
- panic("Reserved value in cpu frequency configuration field: "
- "%d", sar_cpu_freq);
-
- /* Check if fabric frequency field has correct value */
- array_size = nitems(freq_conf_table);
- if (sar_fab_freq >= array_size)
- panic("Reserved value in fabric frequency configuration field: "
- "%d", sar_fab_freq);
-
- /* Get CPU clock frequency */
- freq_vco = cpu_clock_table[sar_cpu_freq] *
- freq_conf_table[sar_fab_freq].vco_cpu;
-
- /* Get L2CLK clock frequency */
- freq_l2clk = freq_vco / freq_conf_table[sar_fab_freq].vco_l2c;
-
- /* Round L2CLK value to integer MHz */
- if (((freq_vco % freq_conf_table[sar_fab_freq].vco_l2c) * 10 /
- freq_conf_table[sar_fab_freq].vco_l2c) >= 5)
- freq_l2clk++;
-
- return (freq_l2clk * 1000000);
-}
-
-uint32_t
-get_l2clk(void)
-{
- static uint32_t l2clk_freq = 0;
-
- /* If get_l2clk is called first time get L2CLK value from register */
- if (l2clk_freq == 0)
- l2clk_freq = count_l2clk();
-
- return (l2clk_freq);
-}
-
-static uint32_t
read_coher_fabric(uint32_t reg)
{
diff --git a/sys/arm/mv/armadaxp/armadaxp_mp.c b/sys/arm/mv/armadaxp/armadaxp_mp.c
index 75a119e0cec9..34cdc611a21f 100644
--- a/sys/arm/mv/armadaxp/armadaxp_mp.c
+++ b/sys/arm/mv/armadaxp/armadaxp_mp.c
@@ -46,6 +46,7 @@
#include <machine/armreg.h>
#include <arm/mv/mvwin.h>
+#include <arm/mv/mvvar.h>
#include <machine/platformvar.h>
diff --git a/sys/arm/mv/mv_armv7_machdep.c b/sys/arm/mv/mv_armv7_machdep.c
index 4fe59d2fe7df..c4c3280e4078 100644
--- a/sys/arm/mv/mv_armv7_machdep.c
+++ b/sys/arm/mv/mv_armv7_machdep.c
@@ -103,6 +103,10 @@ void mv_axp_platform_mp_setmaxid(platform_t plate);
void mv_axp_platform_mp_start_ap(platform_t plate);
#endif
+vm_paddr_t fdt_immr_pa;
+vm_offset_t fdt_immr_va;
+static vm_offset_t fdt_immr_size;
+
#define MPP_PIN_MAX 68
#define MPP_PIN_CELLS 2
#define MPP_PINS_PER_REG 8
@@ -270,9 +274,35 @@ static int
mv_platform_probe_and_attach(platform_t plate)
{
- if (fdt_immr_addr(MV_BASE) != 0)
- while (1);
- return (0);
+ phandle_t node;
+ u_long base, size;
+ int r;
+
+ /*
+ * Try to access the SOC node directly i.e. through /aliases/.
+ */
+ if ((node = OF_finddevice("soc")) != -1)
+ if (ofw_bus_node_is_compatible(node, "simple-bus"))
+ goto moveon;
+ /*
+ * Find the node the long way.
+ */
+ if ((node = OF_finddevice("/")) == -1)
+ goto errout;
+
+ if ((node = fdt_find_compatible(node, "simple-bus", 0)) == 0)
+ goto errout;
+
+moveon:
+ if ((r = fdt_get_range(node, 0, &base, &size)) == 0) {
+ fdt_immr_pa = base;
+ fdt_immr_va = MV_BASE;
+ fdt_immr_size = size;
+ return (0);
+ }
+
+errout:
+ while (1);
}
static void
diff --git a/sys/arm/mv/mv_common.c b/sys/arm/mv/mv_common.c
index a1302859644a..ff6ec5af19d9 100644
--- a/sys/arm/mv/mv_common.c
+++ b/sys/arm/mv/mv_common.c
@@ -93,9 +93,6 @@ static int decode_win_pcie_valid(void);
static int decode_win_sata_valid(void);
static int decode_win_sdhci_valid(void);
-static int decode_win_idma_valid(void);
-static int decode_win_xor_valid(void);
-
static void decode_win_cpu_setup(void);
static int decode_win_sdram_fixup(void);
static void decode_win_cesa_setup(u_long);
@@ -108,17 +105,12 @@ static void decode_win_sata_setup(u_long);
static void decode_win_ahci_setup(u_long);
static void decode_win_sdhci_setup(u_long);
-static void decode_win_idma_setup(u_long);
-static void decode_win_xor_setup(u_long);
-
static void decode_win_cesa_dump(u_long);
static void decode_win_a38x_cesa_dump(u_long);
static void decode_win_usb_dump(u_long);
static void decode_win_usb3_dump(u_long);
static void decode_win_eth_dump(u_long base);
static void decode_win_neta_dump(u_long base);
-static void decode_win_idma_dump(u_long base);
-static void decode_win_xor_dump(u_long base);
static void decode_win_ahci_dump(u_long base);
static void decode_win_sdhci_dump(u_long);
static void decode_win_pcie_dump(u_long);
@@ -195,9 +187,6 @@ static struct soc_node_spec soc_nodes[] = {
{ "marvell,armada-380-sdhci", &decode_win_sdhci_setup,
&decode_win_sdhci_dump, &decode_win_sdhci_valid},
{ "mrvl,sata", &decode_win_sata_setup, NULL, &decode_win_sata_valid},
- { "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump, &decode_win_xor_valid},
- { "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump, &decode_win_idma_valid},
- { "mrvl,cesa", &decode_win_cesa_setup, &decode_win_cesa_dump, &decode_win_cesa_valid},
{ "mrvl,pcie", &decode_win_pcie_setup, &decode_win_pcie_dump, &decode_win_pcie_valid},
{ "marvell,armada-38x-crypto", &decode_win_a38x_cesa_setup,
&decode_win_a38x_cesa_dump, &decode_win_cesa_valid},
@@ -590,7 +579,6 @@ SYSINIT(mv_enter_debugger, SI_SUB_CPU, SI_ORDER_ANY, mv_enter_debugger, NULL);
int
soc_decode_win(void)
{
- uint32_t dev, rev;
int mask, err;
mask = 0;
@@ -603,9 +591,6 @@ soc_decode_win(void)
if ((err = win_cpu_from_dt()) != 0)
return (err);
- /* Retrieve our ID: some windows facilities vary between SoC models */
- soc_id(&dev, &rev);
-
if (soc_family == MV_SOC_ARMADA_XP)
if ((err = decode_win_sdram_fixup()) != 0)
return(err);
@@ -984,40 +969,46 @@ decode_win_cpu_setup(void)
}
+struct ddr_data {
+ uint8_t window_valid[MV_WIN_DDR_MAX];
+ uint32_t mr_count;
+ uint32_t valid_win_num;
+};
+
+static void
+ddr_valid_cb(const struct mem_region *mr, void *arg)
+{
+ struct ddr_data *data = arg;
+ int j;
+
+ for (j = 0; j < MV_WIN_DDR_MAX; j++) {
+ if (ddr_is_active(j) &&
+ (ddr_base(j) == mr->mr_start) &&
+ (ddr_size(j) == mr->mr_size)) {
+ data->window_valid[j] = 1;
+ data->valid_win_num++;
+ }
+ }
+ data->mr_count++;
+}
+
static int
decode_win_sdram_fixup(void)
{
- struct mem_region mr[FDT_MEM_REGIONS];
- uint8_t window_valid[MV_WIN_DDR_MAX];
- int mr_cnt, err, i, j;
- uint32_t valid_win_num = 0;
+ struct ddr_data window_data;
+ int err, j;
- /* Grab physical memory regions information from device tree. */
- err = fdt_get_mem_regions(mr, &mr_cnt, NULL);
+ memset(&window_data, 0, sizeof(window_data));
+ err = fdt_foreach_mem_region(ddr_valid_cb, &window_data);
if (err != 0)
return (err);
- for (i = 0; i < MV_WIN_DDR_MAX; i++)
- window_valid[i] = 0;
-
- /* Try to match entries from device tree with settings from u-boot */
- for (i = 0; i < mr_cnt; i++) {
- for (j = 0; j < MV_WIN_DDR_MAX; j++) {
- if (ddr_is_active(j) &&
- (ddr_base(j) == mr[i].mr_start) &&
- (ddr_size(j) == mr[i].mr_size)) {
- window_valid[j] = 1;
- valid_win_num++;
- }
- }
- }
-
- if (mr_cnt != valid_win_num)
+ if (window_data.mr_count != window_data.valid_win_num)
return (EINVAL);
/* Destroy windows without corresponding device tree entry */
for (j = 0; j < MV_WIN_DDR_MAX; j++) {
- if (ddr_is_active(j) && (window_valid[j] != 1)) {
+ if (ddr_is_active(j) && (window_data.window_valid[j] != 1)) {
printf("Disabling SDRAM decoding window: %d\n", j);
ddr_disable(j);
}
@@ -1523,49 +1514,6 @@ decode_win_pcie_valid(void)
}
/**************************************************************************
- * IDMA windows routines
- **************************************************************************/
-
-/* Provide dummy functions to satisfy the build for SoCs not equipped with IDMA */
-int
-decode_win_idma_valid(void)
-{
-
- return (1);
-}
-
-void
-decode_win_idma_setup(u_long base)
-{
-}
-
-void
-decode_win_idma_dump(u_long base)
-{
-}
-
-/**************************************************************************
- * XOR windows routines
- **************************************************************************/
-/* Provide dummy functions to satisfy the build for SoCs not equipped with XOR */
-static int
-decode_win_xor_valid(void)
-{
-
- return (1);
-}
-
-static void
-decode_win_xor_setup(u_long base)
-{
-}
-
-static void
-decode_win_xor_dump(u_long base)
-{
-}
-
-/**************************************************************************
* SATA windows routines
**************************************************************************/
static void
@@ -1651,10 +1599,6 @@ decode_win_ahci_dump(u_long base)
static int
decode_win_sata_valid(void)
{
- uint32_t dev, rev;
-
- soc_id(&dev, &rev);
-
return (decode_win_can_cover_ddr(MV_WIN_SATA_MAX));
}
diff --git a/sys/arm/mv/mvvar.h b/sys/arm/mv/mvvar.h
index fe0867860e6a..990eeb444345 100644
--- a/sys/arm/mv/mvvar.h
+++ b/sys/arm/mv/mvvar.h
@@ -80,6 +80,9 @@ extern const struct decode_win *xor_wins;
extern int idma_wins_no;
extern int xor_wins_no;
+extern vm_paddr_t fdt_immr_pa;
+extern vm_offset_t fdt_immr_va;
+
int soc_decode_win(void);
void soc_id(uint32_t *dev, uint32_t *rev);
void soc_dump_decode_win(void);
@@ -99,7 +102,6 @@ uint32_t ddr_attr(int i);
uint32_t get_tclk(void);
uint32_t get_cpu_freq(void);
-uint32_t get_l2clk(void);
uint32_t read_cpu_ctrl(uint32_t);
void write_cpu_ctrl(uint32_t, uint32_t);
diff --git a/sys/arm/qualcomm/std.ipq4018 b/sys/arm/qualcomm/std.ipq4018
index 6360a3ce25db..89d2cb546bf3 100644
--- a/sys/arm/qualcomm/std.ipq4018
+++ b/sys/arm/qualcomm/std.ipq4018
@@ -34,17 +34,19 @@ dev/qcom_rnd/qcom_rnd.c optional qcom_rnd
dev/qcom_qup/qcom_spi.c optional qcom_qup_spi
dev/qcom_qup/qcom_spi_hw.c optional qcom_qup_spi
-dev/qcom_gcc/qcom_gcc_ipq4018.c optional qcom_gcc_ipq4018
-dev/qcom_gcc/qcom_gcc_ipq4018_reset.c optional qcom_gcc_ipq4018
-dev/qcom_gcc/qcom_gcc_ipq4018_clock.c optional qcom_gcc_ipq4018
+dev/qcom_gcc/qcom_gcc_main.c optional qcom_gcc
+dev/qcom_gcc/qcom_gcc_clock.c optional qcom_gcc
+dev/qcom_gcc/qcom_gcc_reset.c optional qcom_gcc
+dev/qcom_gcc/qcom_gcc_ipq4018_reset.c optional qcom_gcc
+dev/qcom_gcc/qcom_gcc_ipq4018_clock.c optional qcom_gcc
-dev/qcom_clk/qcom_clk_fepll.c optional qcom_gcc_ipq4018
-dev/qcom_clk/qcom_clk_fdiv.c optional qcom_gcc_ipq4018
-dev/qcom_clk/qcom_clk_apssdiv.c optional qcom_gcc_ipq4018
-dev/qcom_clk/qcom_clk_freqtbl.c optional qcom_gcc_ipq4018
-dev/qcom_clk/qcom_clk_rcg2.c optional qcom_gcc_ipq4018
-dev/qcom_clk/qcom_clk_branch2.c optional qcom_gcc_ipq4018
-dev/qcom_clk/qcom_clk_ro_div.c optional qcom_gcc_ipq4018
+dev/qcom_clk/qcom_clk_fepll.c optional qcom_gcc
+dev/qcom_clk/qcom_clk_fdiv.c optional qcom_gcc
+dev/qcom_clk/qcom_clk_apssdiv.c optional qcom_gcc
+dev/qcom_clk/qcom_clk_freqtbl.c optional qcom_gcc
+dev/qcom_clk/qcom_clk_rcg2.c optional qcom_gcc
+dev/qcom_clk/qcom_clk_branch2.c optional qcom_gcc
+dev/qcom_clk/qcom_clk_ro_div.c optional qcom_gcc
dev/qcom_tlmm/qcom_tlmm_debug.c optional qcom_tlmm_ipq4018
dev/qcom_tlmm/qcom_tlmm_ipq4018.c optional qcom_tlmm_ipq4018
diff --git a/sys/arm64/acpica/acpi_iort.c b/sys/arm64/acpica/acpi_iort.c
index a0e24788b775..a180dc1a2a2c 100644
--- a/sys/arm64/acpica/acpi_iort.c
+++ b/sys/arm64/acpica/acpi_iort.c
@@ -630,7 +630,7 @@ acpi_iort_map_pci_msi(u_int seg, u_int rid, u_int *xref, u_int *devid)
}
int
-acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *sid)
+acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, uint64_t *xref, u_int *sid)
{
ACPI_IORT_SMMU_V3 *smmu;
struct iort_node *node;
@@ -672,7 +672,7 @@ acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref,
}
int
-acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref,
+acpi_iort_map_named_smmuv3(const char *devname, u_int rid, uint64_t *xref,
u_int *devid)
{
ACPI_IORT_SMMU_V3 *smmu;
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index 93343a1972af..6184ce937b8a 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -722,6 +722,21 @@ memory_mapping_mode(vm_paddr_t pa)
return (VM_MEMATTR_DEVICE);
}
+#ifdef FDT
+static void
+fdt_physmem_hardware_region_cb(const struct mem_region *mr, void *arg __unused)
+{
+ physmem_hardware_region(mr->mr_start, mr->mr_size);
+}
+
+static void
+fdt_physmem_exclude_region_cb(const struct mem_region *mr, void *arg __unused)
+{
+ physmem_exclude_region(mr->mr_start, mr->mr_size,
+ EXFLAG_NODUMP | EXFLAG_NOALLOC);
+}
+#endif
+
void
initarm(struct arm64_bootparams *abp)
{
@@ -729,8 +744,6 @@ initarm(struct arm64_bootparams *abp)
struct pcpu *pcpup;
char *env;
#ifdef FDT
- struct mem_region mem_regions[FDT_MEM_REGIONS];
- int mem_regions_sz;
phandle_t root;
char dts_version[255];
#endif
@@ -781,14 +794,11 @@ initarm(struct arm64_bootparams *abp)
#ifdef FDT
else {
/* Grab physical memory regions information from device tree. */
- if (fdt_get_mem_regions(mem_regions, &mem_regions_sz,
+ if (fdt_foreach_mem_region(fdt_physmem_hardware_region_cb,
NULL) != 0)
panic("Cannot get physical memory regions");
- physmem_hardware_regions(mem_regions, mem_regions_sz);
}
- if (fdt_get_reserved_mem(mem_regions, &mem_regions_sz) == 0)
- physmem_exclude_regions(mem_regions, mem_regions_sz,
- EXFLAG_NODUMP | EXFLAG_NOALLOC);
+ fdt_foreach_reserved_mem(fdt_physmem_exclude_region_cb, NULL);
#endif
/* Exclude the EFI framebuffer from our view of physical memory. */
diff --git a/sys/arm64/conf/std.qcom b/sys/arm64/conf/std.qcom
index af7e0add8b40..4051df46bf49 100644
--- a/sys/arm64/conf/std.qcom
+++ b/sys/arm64/conf/std.qcom
@@ -13,3 +13,6 @@ device uart_msm # Qualcomm MSM UART driver
device sdhci
options FDT
+
+# DTBs
+makeoptions MODULES_EXTRA+="dtb/qcom"
diff --git a/sys/arm64/include/metadata.h b/sys/arm64/include/metadata.h
index 7459aa90a6e2..30ec5115e670 100644
--- a/sys/arm64/include/metadata.h
+++ b/sys/arm64/include/metadata.h
@@ -31,10 +31,15 @@
#define MODINFOMD_DTBP 0x1002
#define MODINFOMD_EFI_FB 0x1003
+/*
+ * This is not the same as the UEFI standard EFI_MEMORY_ATTRIBUTES_TABLE, though
+ * memory_size / descritpr_size entries of EFI_MEMORY_DESCRIPTORS follow this table
+ * starting at a 16-byte alignment.
+ */
struct efi_map_header {
- size_t memory_size;
- size_t descriptor_size;
- uint32_t descriptor_version;
+ size_t memory_size; /* Numnber of bytes that follow */
+ size_t descriptor_size; /* Size of each EFI_MEMORY_DESCRIPTOR */
+ uint32_t descriptor_version; /* Currently '1' */
};
struct efi_fb {
diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c
index a832f6a6ec70..ec8e04ce117b 100644
--- a/sys/arm64/iommu/smmu.c
+++ b/sys/arm64/iommu/smmu.c
@@ -1781,7 +1781,7 @@ smmu_set_buswide(device_t dev, struct smmu_domain *domain,
}
static int
-smmu_pci_get_sid(device_t child, u_int *xref0, u_int *sid0)
+smmu_pci_get_sid(device_t child, uintptr_t *xref0, u_int *sid0)
{
struct pci_id_ofw_iommu pi;
int err;
@@ -1945,7 +1945,7 @@ static int
smmu_find(device_t dev, device_t child)
{
struct smmu_softc *sc;
- u_int xref;
+ uintptr_t xref;
int err;
sc = device_get_softc(dev);
diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c
index 37028b667be8..97f73e79fb6c 100644
--- a/sys/compat/lindebugfs/lindebugfs.c
+++ b/sys/compat/lindebugfs/lindebugfs.c
@@ -624,6 +624,121 @@ debugfs_create_atomic_t(const char *name, umode_t mode, struct dentry *parent, a
}
+static int
+fops_str_open(struct inode *inode, struct file *filp)
+{
+
+ return (simple_open(inode, filp));
+}
+
+static ssize_t
+fops_str_read(struct file *filp, char __user *ubuf, size_t read_size,
+ loff_t *ppos)
+{
+ ssize_t ret;
+ char *str, *str_with_newline;
+ size_t str_len, str_with_newline_len;
+
+ if (filp->private_data == NULL)
+ return (-EINVAL);
+
+ str = *(char **)filp->private_data;
+ str_len = strlen(str);
+
+ /*
+ * `str_with_newline` is terminated with a newline, but is not
+ * NUL-terminated.
+ */
+ str_with_newline_len = str_len + 1;
+ str_with_newline = kmalloc(str_with_newline_len, GFP_KERNEL);
+ if (str_with_newline == NULL)
+ return (-ENOMEM);
+
+ strncpy(str_with_newline, str, str_len);
+ str_with_newline[str_len] = '\n';
+
+ ret = simple_read_from_buffer(ubuf, read_size, ppos,
+ str_with_newline, str_with_newline_len);
+
+ kfree(str_with_newline);
+
+ return (ret);
+}
+
+static ssize_t
+fops_str_write(struct file *filp, const char *buf, size_t write_size,
+ loff_t *ppos)
+{
+ char *old, *new;
+ size_t old_len, new_len;
+
+ if (filp->private_data == NULL)
+ return (-EINVAL);
+
+ old = *(char **)filp->private_data;
+ new = NULL;
+
+ /*
+ * We enforce concatenation of the newly written value to the existing
+ * value.
+ */
+ old_len = strlen(old);
+ if (*ppos && *ppos != old_len)
+ return (-EINVAL);
+
+ new_len = old_len + write_size;
+ if (new_len + 1 > PAGE_SIZE)
+ return (-E2BIG);
+
+ new = kmalloc(new_len + 1, GFP_KERNEL);
+ if (new == NULL)
+ return (-ENOMEM);
+
+ memcpy(new, old, old_len);
+ if (copy_from_user(new + old_len, buf, write_size) != 0) {
+ kfree(new);
+ return (-EFAULT);
+ }
+
+ new[new_len] = '\0';
+ strim(new);
+
+ filp->private_data = &new;
+
+ kfree(old);
+
+ return (write_size);
+}
+
+static const struct file_operations fops_str = {
+ .owner = THIS_MODULE,
+ .open = fops_str_open,
+ .read = fops_str_read,
+ .write = fops_str_write,
+ .llseek = no_llseek
+};
+static const struct file_operations fops_str_ro = {
+ .owner = THIS_MODULE,
+ .open = fops_str_open,
+ .read = fops_str_read,
+ .llseek = no_llseek
+};
+static const struct file_operations fops_str_wo = {
+ .owner = THIS_MODULE,
+ .open = fops_str_open,
+ .write = fops_str_write,
+ .llseek = no_llseek
+};
+
+void
+debugfs_create_str(const char *name, umode_t mode, struct dentry *parent,
+ char **value)
+{
+ debugfs_create_mode_unsafe(name, mode, parent, value,
+ &fops_str, &fops_str_ro, &fops_str_wo);
+}
+
+
static ssize_t
fops_blob_read(struct file *filp, char __user *ubuf, size_t read_size, loff_t *ppos)
{
diff --git a/sys/compat/linuxkpi/common/include/linux/acpi_amd_wbrf.h b/sys/compat/linuxkpi/common/include/linux/acpi_amd_wbrf.h
new file mode 100644
index 000000000000..92c2ead41c45
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/acpi_amd_wbrf.h
@@ -0,0 +1,97 @@
+/*-
+ * Copyright (c) 2025 The FreeBSD Foundation
+ * Copyright (c) 2025 Jean-Sébastien Pédron
+ *
+ * This software was developed by Jean-Sébastien Pédron under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _LINUXKPI_LINUX_ACPI_AMD_WBRF_H_
+#define _LINUXKPI_LINUX_ACPI_AMD_WBRF_H_
+
+#include <linux/device.h>
+#include <linux/notifier.h>
+
+#define MAX_NUM_OF_WBRF_RANGES 11
+
+#define WBRF_RECORD_ADD 0x0
+#define WBRF_RECORD_REMOVE 0x1
+
+struct freq_band_range {
+ uint64_t start;
+ uint64_t end;
+};
+
+struct wbrf_ranges_in_out {
+ uint64_t num_of_ranges;
+ struct freq_band_range band_list[MAX_NUM_OF_WBRF_RANGES];
+};
+
+enum wbrf_notifier_actions {
+ WBRF_CHANGED,
+};
+
+/*
+ * The following functions currently have dummy implementations that, on Linux,
+ * are used when CONFIG_AMD_WBRF is not set at compile time.
+ */
+
+static inline bool
+acpi_amd_wbrf_supported_consumer(struct device *dev)
+{
+ return (false);
+}
+
+static inline int
+acpi_amd_wbrf_add_remove(struct device *dev, uint8_t action,
+ struct wbrf_ranges_in_out *in)
+{
+ return (-ENODEV);
+}
+
+static inline bool
+acpi_amd_wbrf_supported_producer(struct device *dev)
+{
+ return (false);
+}
+
+static inline int
+amd_wbrf_retrieve_freq_band(struct device *dev, struct wbrf_ranges_in_out *out)
+{
+ return (-ENODEV);
+}
+
+static inline int
+amd_wbrf_register_notifier(struct notifier_block *nb)
+{
+ return (-ENODEV);
+}
+
+static inline int
+amd_wbrf_unregister_notifier(struct notifier_block *nb)
+{
+ return (-ENODEV);
+}
+
+#endif /* _LINUXKPI_LINUX_ACPI_AMD_WBRF_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/debugfs.h b/sys/compat/linuxkpi/common/include/linux/debugfs.h
index 54145b61503e..4d146e085a7b 100644
--- a/sys/compat/linuxkpi/common/include/linux/debugfs.h
+++ b/sys/compat/linuxkpi/common/include/linux/debugfs.h
@@ -115,6 +115,8 @@ void debugfs_create_ulong(const char *name, umode_t mode, struct dentry *parent,
unsigned long *value);
void debugfs_create_atomic_t(const char *name, umode_t mode, struct dentry *parent,
atomic_t *value);
+void debugfs_create_str(const char *name, umode_t mode, struct dentry *parent,
+ char **value);
struct dentry *debugfs_create_blob(const char *name, umode_t mode,
struct dentry *parent, struct debugfs_blob_wrapper *value);
diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h
index 76a81e676744..f1568ad6282d 100644
--- a/sys/compat/linuxkpi/common/include/linux/fs.h
+++ b/sys/compat/linuxkpi/common/include/linux/fs.h
@@ -150,6 +150,11 @@ struct file_operations {
* an illegal seek error
*/
off_t (*llseek)(struct linux_file *, off_t, int);
+/*
+ * Not supported in FreeBSD. That's ok, we never call it and it allows some
+ * drivers like DRM drivers to compile without changes.
+ */
+ void (*show_fdinfo)(struct seq_file *, struct file *);
#if 0
/* We do not support these methods. Don't permit them to compile. */
loff_t (*llseek)(struct file *, loff_t, int);
diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h
index b8874481f9c6..8b5255c1869c 100644
--- a/sys/compat/linuxkpi/common/include/linux/highmem.h
+++ b/sys/compat/linuxkpi/common/include/linux/highmem.h
@@ -139,4 +139,34 @@ kunmap_local(void *addr)
kunmap_atomic(addr);
}
+static inline void
+memcpy_from_page(char *to, struct page *page, size_t offset, size_t len)
+{
+ char *from;
+
+ KASSERT(offset + len <= PAGE_SIZE,
+ ("%s: memcpy from page %p to address %p: "
+ "offset+len (%zu+%zu) would go beyond page end",
+ __func__, page, to, offset, len));
+
+ from = kmap_local_page(page);
+ memcpy(to, from + offset, len);
+ kunmap_local(from);
+}
+
+static inline void
+memcpy_to_page(struct page *page, size_t offset, const char *from, size_t len)
+{
+ char *to;
+
+ KASSERT(offset + len <= PAGE_SIZE,
+ ("%s: memcpy from address %p to page %p: "
+ "offset+len (%zu+%zu) would go beyond page end",
+ __func__, from, page, offset, len));
+
+ to = kmap_local_page(page);
+ memcpy(to + offset, from, len);
+ kunmap_local(to);
+}
+
#endif /* _LINUXKPI_LINUX_HIGHMEM_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index afd6c827b3b4..e4e8e5c0abd1 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -523,7 +523,20 @@ pci_upstream_bridge(struct pci_dev *pdev)
if (pdev == pdev->bus->self) {
device_t bridge;
- bridge = device_get_parent(pdev->dev.bsddev);
+ /*
+ * In the case of DRM drivers, the passed device is a child of
+ * `vgapci`. We want to start the lookup from `vgapci`, so the
+ * parent of the passed `drmn`.
+ *
+ * We can use the `isdrm` flag to determine this.
+ */
+ bridge = pdev->dev.bsddev;
+ if (pdev->pdrv != NULL && pdev->pdrv->isdrm)
+ bridge = device_get_parent(bridge);
+ if (bridge == NULL)
+ goto done;
+
+ bridge = device_get_parent(bridge);
if (bridge == NULL)
goto done;
bridge = device_get_parent(bridge);
diff --git a/sys/compat/linuxkpi/common/include/linux/printk.h b/sys/compat/linuxkpi/common/include/linux/printk.h
index 3840a6e5fb8a..da9d45122d4d 100644
--- a/sys/compat/linuxkpi/common/include/linux/printk.h
+++ b/sys/compat/linuxkpi/common/include/linux/printk.h
@@ -44,57 +44,19 @@ enum {
DUMP_PREFIX_OFFSET
};
+int __lkpi_hexdump_printf(void *, const char *, ...) __printflike(2, 3);
+
+void lkpi_hex_dump(int(*)(void *, const char *, ...), void *arg1,
+ const char *, const char *, const int, const int, const int,
+ const void *, size_t, const bool);
+
static inline void
print_hex_dump(const char *level, const char *prefix_str,
const int prefix_type, const int rowsize, const int groupsize,
const void *buf, size_t len, const bool ascii)
{
- typedef const struct { long long value; } __packed *print_64p_t;
- typedef const struct { uint32_t value; } __packed *print_32p_t;
- typedef const struct { uint16_t value; } __packed *print_16p_t;
- const void *buf_old = buf;
- int row;
-
- while (len > 0) {
- if (level != NULL)
- printf("%s", level);
- if (prefix_str != NULL)
- printf("%s ", prefix_str);
-
- switch (prefix_type) {
- case DUMP_PREFIX_ADDRESS:
- printf("[%p] ", buf);
- break;
- case DUMP_PREFIX_OFFSET:
- printf("[%#tx] ", ((const char *)buf -
- (const char *)buf_old));
- break;
- default:
- break;
- }
- for (row = 0; row != rowsize; row++) {
- if (groupsize == 8 && len > 7) {
- printf("%016llx ", ((print_64p_t)buf)->value);
- buf = (const uint8_t *)buf + 8;
- len -= 8;
- } else if (groupsize == 4 && len > 3) {
- printf("%08x ", ((print_32p_t)buf)->value);
- buf = (const uint8_t *)buf + 4;
- len -= 4;
- } else if (groupsize == 2 && len > 1) {
- printf("%04x ", ((print_16p_t)buf)->value);
- buf = (const uint8_t *)buf + 2;
- len -= 2;
- } else if (len > 0) {
- printf("%02x ", *(const uint8_t *)buf);
- buf = (const uint8_t *)buf + 1;
- len--;
- } else {
- break;
- }
- }
- printf("\n");
- }
+ lkpi_hex_dump(__lkpi_hexdump_printf, NULL, level, prefix_str, prefix_type,
+ rowsize, groupsize, buf, len, ascii);
}
static inline void
diff --git a/sys/compat/linuxkpi/common/include/linux/ref_tracker.h b/sys/compat/linuxkpi/common/include/linux/ref_tracker.h
new file mode 100644
index 000000000000..fa510b2498e1
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/ref_tracker.h
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2025 The FreeBSD Foundation
+ * Copyright (c) 2025 Jean-Sébastien Pédron
+ *
+ * This software was developed by Jean-Sébastien Pédron under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _LINUXKPI_LINUX_REF_TRACKER_H_
+#define _LINUXKPI_LINUX_REF_TRACKER_H_
+
+#include <linux/refcount.h>
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <linux/stackdepot.h>
+
+struct ref_tracker;
+
+struct ref_tracker_dir {
+};
+
+/*
+ * The following functions currently have dummy implementations that, on Linux,
+ * are used when CONFIG_REF_TRACKER is not set at compile time.
+ *
+ * The ref tracker is a tool to associate a refcount increase to a refcount
+ * decrease. This helps developers track, document and debug refcounts. We
+ * don't need this feature for now in linuxkpi.
+ */
+
+static inline void
+ref_tracker_dir_init(struct ref_tracker_dir *dir,
+ unsigned int quarantine_count, const char *name)
+{
+}
+
+static inline void
+ref_tracker_dir_exit(struct ref_tracker_dir *dir)
+{
+}
+
+static inline void
+ref_tracker_dir_print_locked(struct ref_tracker_dir *dir,
+ unsigned int display_limit)
+{
+}
+
+static inline void
+ref_tracker_dir_print(struct ref_tracker_dir *dir, unsigned int display_limit)
+{
+}
+
+static inline int
+ref_tracker_dir_snprint(struct ref_tracker_dir *dir, char *buf, size_t size)
+{
+ return (0);
+}
+
+static inline int
+ref_tracker_alloc(struct ref_tracker_dir *dir, struct ref_tracker **trackerp,
+ gfp_t gfp)
+{
+ return (0);
+}
+
+static inline int
+ref_tracker_free(struct ref_tracker_dir *dir, struct ref_tracker **trackerp)
+{
+ return (0);
+}
+
+#endif /* !defined(_LINUXKPI_LINUX_REF_TRACKER_H_) */
diff --git a/sys/compat/linuxkpi/common/include/linux/seq_file.h b/sys/compat/linuxkpi/common/include/linux/seq_file.h
index d8b327f59538..876ef9e8dfe5 100644
--- a/sys/compat/linuxkpi/common/include/linux/seq_file.h
+++ b/sys/compat/linuxkpi/common/include/linux/seq_file.h
@@ -28,9 +28,13 @@
#ifndef _LINUXKPI_LINUX_SEQ_FILE_H_
#define _LINUXKPI_LINUX_SEQ_FILE_H_
+#include <sys/types.h>
+#include <sys/sbuf.h>
+
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/string_helpers.h>
+#include <linux/printk.h>
#undef file
#define inode vnode
@@ -89,6 +93,16 @@ void lkpi_seq_printf(struct seq_file *m, const char *fmt, ...);
#define seq_vprintf(...) lkpi_seq_vprintf(__VA_ARGS__)
#define seq_printf(...) lkpi_seq_printf(__VA_ARGS__)
+int __lkpi_hexdump_sbuf_printf(void *, const char *, ...) __printflike(2, 3);
+
+static inline void
+seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
+ int rowsize, int groupsize, const void *buf, size_t len, bool ascii)
+{
+ lkpi_hex_dump(__lkpi_hexdump_sbuf_printf, m->buf, NULL, prefix_str, prefix_type,
+ rowsize, groupsize, buf, len, ascii);
+}
+
#define file linux_file
#endif /* _LINUXKPI_LINUX_SEQ_FILE_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h
index 07c16884b00e..f3a840d9bf4b 100644
--- a/sys/compat/linuxkpi/common/include/linux/slab.h
+++ b/sys/compat/linuxkpi/common/include/linux/slab.h
@@ -4,6 +4,10 @@
* Copyright (c) 2010 Panasas, Inc.
* Copyright (c) 2013-2021 Mellanox Technologies, Ltd.
* All rights reserved.
+ * Copyright (c) 2024-2025 The FreeBSD Foundation
+ *
+ * Portions of this software were developed by Björn Zeeb
+ * under sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,13 +45,12 @@
MALLOC_DECLARE(M_KMALLOC);
-#define kmalloc(size, flags) lkpi_kmalloc(size, flags)
-#define kvmalloc(size, flags) kmalloc(size, flags)
#define kvzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO)
#define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO)
#define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO)
#define kzalloc_node(size, flags, node) kmalloc_node(size, (flags) | __GFP_ZERO, node)
#define kfree_const(ptr) kfree(ptr)
+#define kfree_async(ptr) kfree(ptr) /* drm-kmod 5.4 compat */
#define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, 0)
#define vfree(arg) kfree(arg)
#define kvfree(arg) kfree(arg)
@@ -85,15 +88,21 @@ struct linux_kmem_cache;
#define ARCH_KMALLOC_MINALIGN \
__alignof(unsigned long long)
-/* drm-kmod 5.4 compat */
-#define kfree_async(ptr) kfree(ptr);
-
#define ZERO_SIZE_PTR ((void *)16)
#define ZERO_OR_NULL_PTR(x) ((x) == NULL || (x) == ZERO_SIZE_PTR)
-extern void *lkpi_kmalloc(size_t size, gfp_t flags);
-void *lkpi___kmalloc(size_t size, gfp_t flags);
-#define __kmalloc(_s, _f) lkpi___kmalloc(_s, _f)
+struct linux_kmem_cache *linux_kmem_cache_create(const char *name,
+ size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor);
+void *lkpi_kmem_cache_alloc(struct linux_kmem_cache *, gfp_t);
+void *lkpi_kmem_cache_zalloc(struct linux_kmem_cache *, gfp_t);
+void lkpi_kmem_cache_free(struct linux_kmem_cache *, void *);
+void linux_kmem_cache_destroy(struct linux_kmem_cache *);
+
+void *lkpi_kmalloc(size_t, gfp_t);
+void *lkpi___kmalloc(size_t, gfp_t);
+void *lkpi___kmalloc_node(size_t, gfp_t, int);
+void *lkpi_krealloc(void *, size_t, gfp_t);
+void lkpi_kfree(const void *);
static inline gfp_t
linux_check_m_flags(gfp_t flags)
@@ -110,103 +119,122 @@ linux_check_m_flags(gfp_t flags)
return (flags & GFP_NATIVE_MASK);
}
+/*
+ * Base functions with a native implementation.
+ */
static inline void *
-kmalloc_node(size_t size, gfp_t flags, int node)
+kmalloc(size_t size, gfp_t flags)
{
- return (malloc_domainset(size, M_KMALLOC,
- linux_get_vm_domain_set(node), linux_check_m_flags(flags)));
+ return (lkpi_kmalloc(size, flags));
}
static inline void *
-kcalloc(size_t n, size_t size, gfp_t flags)
+__kmalloc(size_t size, gfp_t flags)
{
- flags |= __GFP_ZERO;
- return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags)));
+ return (lkpi___kmalloc(size, flags));
}
static inline void *
-kcalloc_node(size_t n, size_t size, gfp_t flags, int node)
+kmalloc_node(size_t size, gfp_t flags, int node)
{
- flags |= __GFP_ZERO;
- return (mallocarray_domainset(n, size, M_KMALLOC,
- linux_get_vm_domain_set(node), linux_check_m_flags(flags)));
+ return (lkpi___kmalloc_node(size, flags, node));
}
static inline void *
-__vmalloc(size_t size, gfp_t flags, int other)
+krealloc(void *ptr, size_t size, gfp_t flags)
{
- return (malloc(size, M_KMALLOC, linux_check_m_flags(flags)));
+ return (lkpi_krealloc(ptr, size, flags));
}
-static inline void *
-__vmalloc_node(size_t size, gfp_t flags, int node)
+static inline void
+kfree(const void *ptr)
{
- return (malloc_domainset(size, M_KMALLOC,
- linux_get_vm_domain_set(node), linux_check_m_flags(flags)));
+ lkpi_kfree(ptr);
}
+/*
+ * Other k*alloc() funtions using the above as underlying allocator.
+ */
+/* kmalloc */
static inline void *
-vmalloc_32(size_t size)
+kmalloc_array(size_t n, size_t size, gfp_t flags)
{
- return (contigmalloc(size, M_KMALLOC, M_WAITOK, 0, UINT_MAX, 1, 1));
+ if (WOULD_OVERFLOW(n, size))
+ panic("%s: %zu * %zu overflowed", __func__, n, size);
+
+ return (kmalloc(size * n, flags));
}
static inline void *
-kmalloc_array(size_t n, size_t size, gfp_t flags)
+kcalloc(size_t n, size_t size, gfp_t flags)
{
- return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags)));
+ flags |= __GFP_ZERO;
+ return (kmalloc_array(n, size, flags));
}
+/* kmalloc_node */
static inline void *
kmalloc_array_node(size_t n, size_t size, gfp_t flags, int node)
{
- return (mallocarray_domainset(n, size, M_KMALLOC,
- linux_get_vm_domain_set(node), linux_check_m_flags(flags)));
-}
+ if (WOULD_OVERFLOW(n, size))
+ panic("%s: %zu * %zu overflowed", __func__, n, size);
-static inline void *
-kvmalloc_array(size_t n, size_t size, gfp_t flags)
-{
- return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags)));
+ return (kmalloc_node(size * n, flags, node));
}
static inline void *
-krealloc(void *ptr, size_t size, gfp_t flags)
+kcalloc_node(size_t n, size_t size, gfp_t flags, int node)
{
- return (realloc(ptr, size, M_KMALLOC, linux_check_m_flags(flags)));
+ flags |= __GFP_ZERO;
+ return (kmalloc_array_node(n, size, flags, node));
}
+/* krealloc */
static inline void *
krealloc_array(void *ptr, size_t n, size_t size, gfp_t flags)
{
- if (WOULD_OVERFLOW(n, size)) {
+ if (WOULD_OVERFLOW(n, size))
return NULL;
- }
- return (realloc(ptr, n * size, M_KMALLOC, linux_check_m_flags(flags)));
+ return (krealloc(ptr, n * size, flags));
+}
+
+/*
+ * vmalloc/kvalloc functions.
+ */
+static inline void *
+__vmalloc(size_t size, gfp_t flags, int other)
+{
+ return (malloc(size, M_KMALLOC, linux_check_m_flags(flags)));
}
-extern void linux_kfree_async(void *);
+static inline void *
+__vmalloc_node(size_t size, gfp_t flags, int node)
+{
+ return (malloc_domainset(size, M_KMALLOC,
+ linux_get_vm_domain_set(node), linux_check_m_flags(flags)));
+}
-static inline void
-kfree(const void *ptr)
+static inline void *
+vmalloc_32(size_t size)
{
- if (ZERO_OR_NULL_PTR(ptr))
- return;
+ return (contigmalloc(size, M_KMALLOC, M_WAITOK, 0, UINT_MAX, 1, 1));
+}
- if (curthread->td_critnest != 0)
- linux_kfree_async(__DECONST(void *, ptr));
- else
- free(__DECONST(void *, ptr), M_KMALLOC);
+/* May return non-contiguous memory. */
+static inline void *
+kvmalloc(size_t size, gfp_t flags)
+{
+ return (malloc(size, M_KMALLOC, linux_check_m_flags(flags)));
}
-static __inline void
-kfree_sensitive(const void *ptr)
+static inline void *
+kvmalloc_array(size_t n, size_t size, gfp_t flags)
{
- if (ZERO_OR_NULL_PTR(ptr))
- return;
+ if (WOULD_OVERFLOW(n, size))
+ panic("%s: %zu * %zu overflowed", __func__, n, size);
- zfree(__DECONST(void *, ptr), M_KMALLOC);
+ return (kvmalloc(size * n, flags));
}
static inline void *
@@ -226,6 +254,19 @@ kvrealloc(const void *ptr, size_t oldsize, size_t newsize, gfp_t flags)
return (newptr);
}
+/*
+ * Misc.
+ */
+
+static __inline void
+kfree_sensitive(const void *ptr)
+{
+ if (ZERO_OR_NULL_PTR(ptr))
+ return;
+
+ zfree(__DECONST(void *, ptr), M_KMALLOC);
+}
+
static inline size_t
ksize(const void *ptr)
{
@@ -240,11 +281,4 @@ kmalloc_size_roundup(size_t size)
return (malloc_size(size));
}
-extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name,
- size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor);
-extern void *lkpi_kmem_cache_alloc(struct linux_kmem_cache *, gfp_t);
-extern void *lkpi_kmem_cache_zalloc(struct linux_kmem_cache *, gfp_t);
-extern void lkpi_kmem_cache_free(struct linux_kmem_cache *, void *);
-extern void linux_kmem_cache_destroy(struct linux_kmem_cache *);
-
#endif /* _LINUXKPI_LINUX_SLAB_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h
index 2992e41c9c02..dc10b0457153 100644
--- a/sys/compat/linuxkpi/common/include/linux/spinlock.h
+++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h
@@ -154,6 +154,14 @@ typedef struct mtx spinlock_t;
mtx_assert(_l, MA_OWNED); \
} while (0)
+#define local_irq_save(flags) do { \
+ (flags) = 0; \
+} while (0)
+
+#define local_irq_restore(flags) do { \
+ (void)(flags); \
+} while (0)
+
#define atomic_dec_and_lock_irqsave(cnt, lock, flags) \
_atomic_dec_and_lock_irqsave(cnt, lock, &(flags))
static inline int
diff --git a/sys/compat/linuxkpi/common/include/linux/sysfs.h b/sys/compat/linuxkpi/common/include/linux/sysfs.h
index b5ad73e4460b..f11db5ece515 100644
--- a/sys/compat/linuxkpi/common/include/linux/sysfs.h
+++ b/sys/compat/linuxkpi/common/include/linux/sysfs.h
@@ -50,6 +50,15 @@ struct attribute_group {
struct attribute **attrs;
};
+struct bin_attribute {
+ struct attribute attr;
+ size_t size;
+ ssize_t (*read)(struct linux_file *, struct kobject *,
+ struct bin_attribute *, char *, loff_t, size_t);
+ ssize_t (*write)(struct linux_file *, struct kobject *,
+ struct bin_attribute *, char *, loff_t, size_t);
+};
+
#define __ATTR(_name, _mode, _show, _store) { \
.attr = { .name = __stringify(_name), .mode = _mode }, \
.show = _show, .store = _store, \
@@ -72,6 +81,39 @@ struct attribute_group {
NULL, \
}
+#define __BIN_ATTR(_name, _mode, _read, _write, _size) { \
+ .attr = { .name = __stringify(_name), .mode = _mode }, \
+ .read = _read, .write = _write, .size = _size, \
+}
+#define __BIN_ATTR_RO(_name, _size) { \
+ .attr = { .name = __stringify(_name), .mode = 0444 }, \
+ .read = _name##_read, .size = _size, \
+}
+#define __BIN_ATTR_WO(_name, _size) { \
+ .attr = { .name = __stringify(_name), .mode = 0200 }, \
+ .write = _name##_write, .size = _size, \
+}
+#define __BIN_ATTR_WR(_name, _size) { \
+ .attr = { .name = __stringify(_name), .mode = 0644 }, \
+ .read = _name##_read, .write = _name##_write, .size = _size, \
+}
+
+#define BIN_ATTR(_name, _mode, _read, _write, _size) \
+struct bin_attribute bin_attr_##_name = \
+ __BIN_ATTR(_name, _mode, _read, _write, _size);
+
+#define BIN_ATTR_RO(_name, _size) \
+struct bin_attribute bin_attr_##_name = \
+ __BIN_ATTR_RO(_name, _size);
+
+#define BIN_ATTR_WO(_name, _size) \
+struct bin_attribute bin_attr_##_name = \
+ __BIN_ATTR_WO(_name, _size);
+
+#define BIN_ATTR_WR(_name, _size) \
+struct bin_attribute bin_attr_##_name = \
+ __BIN_ATTR_WR(_name, _size);
+
/*
* Handle our generic '\0' terminated 'C' string.
* Two cases:
@@ -156,6 +198,80 @@ sysfs_remove_file(struct kobject *kobj, const struct attribute *attr)
}
static inline int
+sysctl_handle_bin_attr(SYSCTL_HANDLER_ARGS)
+{
+ struct kobject *kobj;
+ struct bin_attribute *attr;
+ char *buf;
+ int error;
+ ssize_t len;
+
+ kobj = arg1;
+ attr = (struct bin_attribute *)(intptr_t)arg2;
+ if (kobj->ktype == NULL || kobj->ktype->sysfs_ops == NULL)
+ return (ENODEV);
+ buf = (char *)get_zeroed_page(GFP_KERNEL);
+ if (buf == NULL)
+ return (ENOMEM);
+
+ if (attr->read) {
+ len = attr->read(
+ NULL, /* <-- struct file, unimplemented */
+ kobj, attr, buf, req->oldidx, PAGE_SIZE);
+ if (len < 0) {
+ error = -len;
+ if (error != EIO)
+ goto out;
+ }
+ }
+
+ error = sysctl_handle_opaque(oidp, buf, PAGE_SIZE, req);
+ if (error != 0 || req->newptr == NULL || attr->write == NULL)
+ goto out;
+
+ len = attr->write(
+ NULL, /* <-- struct file, unimplemented */
+ kobj, attr, buf, req->newidx, req->newlen);
+ if (len < 0)
+ error = -len;
+out:
+ free_page((unsigned long)buf);
+
+ return (error);
+}
+
+static inline int
+sysfs_create_bin_file(struct kobject *kobj, const struct bin_attribute *attr)
+{
+ struct sysctl_oid *oid;
+ int ctlflags;
+
+ ctlflags = CTLTYPE_OPAQUE | CTLFLAG_MPSAFE;
+ if (attr->attr.mode & (S_IRUSR | S_IWUSR))
+ ctlflags |= CTLFLAG_RW;
+ else if (attr->attr.mode & S_IRUSR)
+ ctlflags |= CTLFLAG_RD;
+ else if (attr->attr.mode & S_IWUSR)
+ ctlflags |= CTLFLAG_WR;
+
+ oid = SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO,
+ attr->attr.name, ctlflags, kobj,
+ (uintptr_t)attr, sysctl_handle_bin_attr, "", "");
+ if (oid == NULL)
+ return (-ENOMEM);
+
+ return (0);
+}
+
+static inline void
+sysfs_remove_bin_file(struct kobject *kobj, const struct bin_attribute *attr)
+{
+
+ if (kobj->oidp)
+ sysctl_remove_name(kobj->oidp, attr->attr.name, 1, 1);
+}
+
+static inline int
sysfs_create_link(struct kobject *kobj __unused,
struct kobject *target __unused, const char *name __unused)
{
diff --git a/sys/compat/linuxkpi/common/include/linux/workqueue.h b/sys/compat/linuxkpi/common/include/linux/workqueue.h
index 1c9df9fcb74d..7e740f0f1dfc 100644
--- a/sys/compat/linuxkpi/common/include/linux/workqueue.h
+++ b/sys/compat/linuxkpi/common/include/linux/workqueue.h
@@ -258,4 +258,10 @@ extern struct work_struct *linux_current_work(void);
extern bool linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork);
extern bool linux_flush_rcu_work(struct rcu_work *rwork);
+static inline bool
+queue_work_node(int node __unused, struct workqueue_struct *wq, struct work_struct *work)
+{
+ return (queue_work(wq, work));
+}
+
#endif /* _LINUXKPI_LINUX_WORKQUEUE_H_ */
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 9830d8f16d05..8856eee8c696 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -343,6 +343,7 @@ struct ieee80211_bss_conf {
bool eht_support;
bool csa_active;
bool mu_mimo_owner;
+ bool color_change_active;
uint32_t sync_device_ts;
uint64_t sync_tsf;
uint16_t beacon_int;
@@ -363,7 +364,6 @@ struct ieee80211_bss_conf {
int twt_requester, uora_exists, uora_ocw_range;
int assoc_capability, enable_beacon, hidden_ssid, ibss_joined, twt_protected;
int twt_responder, unsol_bcast_probe_resp_interval;
- int color_change_active;
};
struct ieee80211_channel_switch {
@@ -373,18 +373,6 @@ struct ieee80211_channel_switch {
struct cfg80211_chan_def chandef;
};
-struct ieee80211_cipher_scheme {
- uint32_t cipher;
- uint8_t iftype; /* We do not know the size of this. */
- uint8_t hdr_len;
- uint8_t pn_len;
- uint8_t pn_off;
- uint8_t key_idx_off;
- uint8_t key_idx_mask;
- uint8_t key_idx_shift;
- uint8_t mic_len;
-};
-
enum ieee80211_event_type {
BA_FRAME_TIMEOUT,
BAR_RX_EVENT,
@@ -508,8 +496,6 @@ struct ieee80211_hw {
/* TODO FIXME */
int extra_tx_headroom, weight_multiplier;
int max_rate_tries, max_rates, max_report_rates;
- struct ieee80211_cipher_scheme *cipher_schemes;
- int n_cipher_schemes;
const char *rate_control_algorithm;
struct {
uint16_t units_pos; /* radiotap "spec" is .. inconsistent. */
@@ -845,15 +831,13 @@ struct ieee80211_vif_cfg {
struct ieee80211_vif {
/* TODO FIXME */
enum nl80211_iftype type;
- int csa_active, mu_mimo_owner;
int cab_queue;
- int color_change_active, offload_flags;
+ int offload_flags;
enum ieee80211_vif_driver_flags driver_flags;
bool p2p;
bool probe_req_reg;
uint8_t addr[ETH_ALEN];
struct ieee80211_vif_cfg cfg;
- struct ieee80211_chanctx_conf *chanctx_conf;
struct ieee80211_txq *txq;
struct ieee80211_bss_conf bss_conf;
struct ieee80211_bss_conf *link_conf[IEEE80211_MLD_MAX_NUM_LINKS]; /* rcu? */
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index ec1798d2e886..149926a54907 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -365,9 +365,81 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS)
return (0);
}
+static enum ieee80211_sta_rx_bw
+lkpi_cw_to_rx_bw(enum nl80211_chan_width cw)
+{
+ switch (cw) {
+ case NL80211_CHAN_WIDTH_320:
+ return (IEEE80211_STA_RX_BW_320);
+ case NL80211_CHAN_WIDTH_160:
+ case NL80211_CHAN_WIDTH_80P80:
+ return (IEEE80211_STA_RX_BW_160);
+ case NL80211_CHAN_WIDTH_80:
+ return (IEEE80211_STA_RX_BW_80);
+ case NL80211_CHAN_WIDTH_40:
+ return (IEEE80211_STA_RX_BW_40);
+ case NL80211_CHAN_WIDTH_20:
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ return (IEEE80211_STA_RX_BW_20);
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
+ /* Unsupported input. */
+ return (IEEE80211_STA_RX_BW_20);
+ }
+}
+
+static enum nl80211_chan_width
+lkpi_rx_bw_to_cw(enum ieee80211_sta_rx_bw rx_bw)
+{
+ switch (rx_bw) {
+ case IEEE80211_STA_RX_BW_20:
+ return (NL80211_CHAN_WIDTH_20); /* _NOHT */
+ case IEEE80211_STA_RX_BW_40:
+ return (NL80211_CHAN_WIDTH_40);
+ case IEEE80211_STA_RX_BW_80:
+ return (NL80211_CHAN_WIDTH_80);
+ case IEEE80211_STA_RX_BW_160:
+ return (NL80211_CHAN_WIDTH_160); /* 80P80 */
+ case IEEE80211_STA_RX_BW_320:
+ return (NL80211_CHAN_WIDTH_320);
+ }
+}
+
+static void
+lkpi_sync_chanctx_cw_from_rx_bw(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif, struct ieee80211_sta *sta)
+{
+ struct ieee80211_chanctx_conf *chanctx_conf;
+ enum ieee80211_sta_rx_bw old_bw;
+ uint32_t changed;
+
+ chanctx_conf = rcu_dereference_protected(vif->bss_conf.chanctx_conf,
+ lockdep_is_held(&hw->wiphy->mtx));
+ if (chanctx_conf == NULL)
+ return;
+
+ old_bw = lkpi_cw_to_rx_bw(chanctx_conf->def.width);
+ if (old_bw == sta->deflink.bandwidth)
+ return;
+
+ chanctx_conf->def.width = lkpi_rx_bw_to_cw(sta->deflink.bandwidth);
+ if (chanctx_conf->def.width == NL80211_CHAN_WIDTH_20 &&
+ !sta->deflink.ht_cap.ht_supported)
+ chanctx_conf->def.width = NL80211_CHAN_WIDTH_20_NOHT;
+
+ chanctx_conf->min_def = chanctx_conf->def;
+
+ vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width;
+
+ changed = IEEE80211_CHANCTX_CHANGE_MIN_WIDTH;
+ changed |= IEEE80211_CHANCTX_CHANGE_WIDTH;
+ lkpi_80211_mo_change_chanctx(hw, chanctx_conf, changed);
+}
+
#if defined(LKPI_80211_HT)
static void
-lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni)
+lkpi_sta_sync_ht_from_ni(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
+ struct ieee80211_node *ni)
{
struct ieee80211vap *vap;
uint8_t *ie;
@@ -399,7 +471,8 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni)
sta->deflink.ht_cap.cap = htcap->cap_info;
sta->deflink.ht_cap.mcs = htcap->mcs;
- if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0)
+ if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0 &&
+ IEEE80211_IS_CHAN_HT40(ni->ni_chan))
sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40;
else
sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20;
@@ -435,14 +508,16 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni)
#if defined(LKPI_80211_VHT)
static void
-lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni)
+lkpi_sta_sync_vht_from_ni(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
+ struct ieee80211_node *ni)
{
uint32_t width;
int rx_nss;
uint16_t rx_mcs_map;
uint8_t mcs;
- if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) {
+ if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0 ||
+ !IEEE80211_IS_CHAN_VHT_5GHZ(ni->ni_chan)) {
sta->deflink.vht_cap.vht_supported = false;
return;
}
@@ -507,15 +582,25 @@ skip_bw:
#endif
static void
-lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni)
+lkpi_sta_sync_from_ni(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, struct ieee80211_node *ni, bool updchnctx)
{
#if defined(LKPI_80211_HT)
- lkpi_sta_sync_ht_from_ni(sta, ni);
+ lkpi_sta_sync_ht_from_ni(vif, sta, ni);
#endif
#if defined(LKPI_80211_VHT)
- lkpi_sta_sync_vht_from_ni(sta, ni);
+ lkpi_sta_sync_vht_from_ni(vif, sta, ni);
#endif
+ /*
+ * We are also called from node allocation which net80211
+ * can do even on `ifconfig down`; in that case the chanctx
+ * may still be valid and we get a discrepancy between
+ * sta and chanctx. Thus do not try to update the chanctx
+ * when called from lkpi_lsta_alloc().
+ */
+ if (updchnctx)
+ lkpi_sync_chanctx_cw_from_rx_bw(hw, vif, sta);
}
static uint8_t
@@ -570,12 +655,11 @@ static void
lkpi_lsta_remove(struct lkpi_sta *lsta, struct lkpi_vif *lvif)
{
+ lockdep_assert_wiphy(lsta->hw->wiphy);
- wiphy_lock(lsta->hw->wiphy);
KASSERT(!list_empty(&lsta->lsta_list),
("%s: lsta %p ni %p\n", __func__, lsta, lsta->ni));
list_del_init(&lsta->lsta_list);
- wiphy_unlock(lsta->hw->wiphy);
}
static struct lkpi_sta *
@@ -686,7 +770,9 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN],
sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20;
sta->deflink.rx_nss = 1;
- lkpi_sta_sync_from_ni(sta, ni);
+ wiphy_lock(hw->wiphy);
+ lkpi_sta_sync_from_ni(hw, vif, sta, ni, false);
+ wiphy_unlock(hw->wiphy);
IMPROVE("he, eht, bw_320, ... smps_mode, ..");
@@ -1341,7 +1427,7 @@ lkpi_iv_key_update_begin(struct ieee80211vap *vap)
struct lkpi_hw *lhw;
struct ieee80211_hw *hw;
struct lkpi_vif *lvif;
- bool islocked;
+ bool icislocked, ntislocked;
ic = vap->iv_ic;
lhw = ic->ic_softc;
@@ -1349,28 +1435,35 @@ lkpi_iv_key_update_begin(struct ieee80211vap *vap)
lvif = VAP_TO_LVIF(vap);
nt = &ic->ic_sta;
- islocked = IEEE80211_NODE_IS_LOCKED(nt);
+ icislocked = IEEE80211_IS_LOCKED(ic);
+ ntislocked = IEEE80211_NODE_IS_LOCKED(nt);
#ifdef LINUXKPI_DEBUG_80211
if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO)
- ic_printf(vap->iv_ic, "%s: tid %d vap %p nt %p %slocked "
- "lvif nt_unlocked %d\n", __func__, curthread->td_tid,
- vap, nt, islocked ? "" : "un", lvif->nt_unlocked);
+ ic_printf(ic, "%s: tid %d vap %p ic %p %slocked nt %p %slocked "
+ "lvif ic_unlocked %d nt_unlocked %d\n", __func__,
+ curthread->td_tid, vap,
+ ic, icislocked ? "" : "un", nt, ntislocked ? "" : "un",
+ lvif->ic_unlocked, lvif->nt_unlocked);
#endif
/* This is inconsistent net80211 locking to be fixed one day. */
- if (islocked)
+ if (icislocked)
+ IEEE80211_UNLOCK(ic);
+ if (ntislocked)
IEEE80211_NODE_UNLOCK(nt);
wiphy_lock(hw->wiphy);
/*
- * nt_unlocked could be a bool given we are under the lock and there
+ * ic/nt_unlocked could be a bool given we are under the lock and there
* must only be a single thread.
* In case anything in the future disturbs the order the refcnt will
* help us catching problems a lot easier.
*/
- if (islocked)
+ if (icislocked)
+ refcount_acquire(&lvif->ic_unlocked);
+ if (ntislocked)
refcount_acquire(&lvif->nt_unlocked);
}
@@ -1382,7 +1475,7 @@ lkpi_iv_key_update_end(struct ieee80211vap *vap)
struct lkpi_hw *lhw;
struct ieee80211_hw *hw;
struct lkpi_vif *lvif;
- bool islocked;
+ bool icislocked, ntislocked;
ic = vap->iv_ic;
lhw = ic->ic_softc;
@@ -1390,14 +1483,18 @@ lkpi_iv_key_update_end(struct ieee80211vap *vap)
lvif = VAP_TO_LVIF(vap);
nt = &ic->ic_sta;
- islocked = IEEE80211_NODE_IS_LOCKED(nt);
- MPASS(!islocked);
+ icislocked = IEEE80211_IS_LOCKED(ic);
+ MPASS(!icislocked);
+ ntislocked = IEEE80211_NODE_IS_LOCKED(nt);
+ MPASS(!ntislocked);
#ifdef LINUXKPI_DEBUG_80211
if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO)
- ic_printf(vap->iv_ic, "%s: tid %d vap %p nt %p %slocked "
- "lvif nt_unlocked %d\n", __func__, curthread->td_tid,
- vap, nt, islocked ? "" : "un", lvif->nt_unlocked);
+ ic_printf(ic, "%s: tid %d vap %p ic %p %slocked nt %p %slocked "
+ "lvif ic_unlocked %d nt_unlocked %d\n", __func__,
+ curthread->td_tid, vap,
+ ic, icislocked ? "" : "un", nt, ntislocked ? "" : "un",
+ lvif->ic_unlocked, lvif->nt_unlocked);
#endif
/*
@@ -1405,11 +1502,17 @@ lkpi_iv_key_update_end(struct ieee80211vap *vap)
* In case the refcnt gets out of sync locking in net80211 will
* quickly barf as well (trying to unlock a lock not held).
*/
- islocked = refcount_release_if_last(&lvif->nt_unlocked);
+ icislocked = refcount_release_if_last(&lvif->ic_unlocked);
+ ntislocked = refcount_release_if_last(&lvif->nt_unlocked);
wiphy_unlock(hw->wiphy);
- /* This is inconsistent net80211 locking to be fixed one day. */
- if (islocked)
+ /*
+ * This is inconsistent net80211 locking to be fixed one day.
+ * ic before nt to avoid a LOR.
+ */
+ if (icislocked)
+ IEEE80211_LOCK(ic);
+ if (ntislocked)
IEEE80211_NODE_LOCK(nt);
}
#endif
@@ -1579,10 +1682,10 @@ lkpi_stop_hw_scan(struct lkpi_hw *lhw, struct ieee80211_vif *vif)
hw = LHW_TO_HW(lhw);
IEEE80211_UNLOCK(lhw->ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
/* Need to cancel the scan. */
lkpi_80211_mo_cancel_hw_scan(hw, vif);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
/* Need to make sure we see ieee80211_scan_completed. */
LKPI_80211_LHW_SCAN_LOCK(lhw);
@@ -1699,11 +1802,14 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
static void
lkpi_80211_flush_tx(struct lkpi_hw *lhw, struct lkpi_sta *lsta)
{
+ struct ieee80211_hw *hw;
struct mbufq mq;
struct mbuf *m;
int len;
- LKPI_80211_LHW_UNLOCK_ASSERT(lhw);
+ /* There is no lockdep_assert_not_held_wiphy(). */
+ hw = LHW_TO_HW(lhw);
+ lockdep_assert_not_held(&hw->wiphy->mtx);
/* Do not accept any new packets until scan_to_auth or lsta_free(). */
LKPI_80211_LSTA_TXQ_LOCK(lsta);
@@ -1731,6 +1837,35 @@ lkpi_80211_flush_tx(struct lkpi_hw *lhw, struct lkpi_sta *lsta)
}
}
+
+static void
+lkpi_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
+{
+ struct ieee80211_chanctx_conf *chanctx_conf;
+ struct lkpi_chanctx *lchanctx;
+
+ chanctx_conf = rcu_dereference_protected(vif->bss_conf.chanctx_conf,
+ lockdep_is_held(&hw->wiphy->mtx));
+
+ if (chanctx_conf == NULL)
+ return;
+
+ /* Remove vif context. */
+ lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->bss_conf, chanctx_conf);
+
+ lkpi_hw_conf_idle(hw, true);
+
+ /* Remove chan ctx. */
+ lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
+
+ /* Cleanup. */
+ rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL);
+ lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
+ list_del(&lchanctx->entry);
+ free(lchanctx, M_LKPI80211);
+}
+
+
/* -------------------------------------------------------------------------- */
static int
@@ -1812,11 +1947,12 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
LKPI_80211_LVIF_UNLOCK(lvif);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
/* Add chanctx (or if exists, change it). */
- if (vif->chanctx_conf != NULL) {
- chanctx_conf = vif->chanctx_conf;
+ chanctx_conf = rcu_dereference_protected(vif->bss_conf.chanctx_conf,
+ lockdep_is_held(&hw->wiphy->mtx));
+ if (chanctx_conf != NULL) {
lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
IMPROVE("diff changes for changed, working on live copy, rcu");
} else {
@@ -1837,6 +1973,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
IMPROVE("Check vht_cap from band not just chan?");
KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC,
("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan));
+
#ifdef LKPI_80211_HT
if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {
if (IEEE80211_IS_CHAN_HT40(ni->ni_chan))
@@ -1846,7 +1983,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
}
#endif
#ifdef LKPI_80211_VHT
- if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) {
+ if (IEEE80211_IS_CHAN_VHT_5GHZ(ni->ni_chan)) {
#ifdef __notyet__
if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan))
chanctx_conf->def.width = NL80211_CHAN_WIDTH_80P80;
@@ -1891,7 +2028,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
bss_changed |= lkpi_update_dtim_tsf(vif, ni, vap, __func__, __LINE__);
error = 0;
- if (vif->chanctx_conf != NULL) {
+ if (vif->bss_conf.chanctx_conf == chanctx_conf) {
changed = IEEE80211_CHANCTX_CHANGE_MIN_WIDTH;
changed |= IEEE80211_CHANCTX_CHANGE_RADAR;
changed |= IEEE80211_CHANCTX_CHANGE_RX_CHAINS;
@@ -1912,7 +2049,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
goto out;
}
- vif->bss_conf.chanctx_conf = chanctx_conf;
+ list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list);
+ rcu_assign_pointer(vif->bss_conf.chanctx_conf, chanctx_conf);
/* Assign vif chanctx. */
if (error == 0)
@@ -1924,7 +2062,9 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
ic_printf(vap->iv_ic, "%s:%d: mo_assign_vif_chanctx "
"failed: %d\n", __func__, __LINE__, error);
lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
+ rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL);
lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
+ list_del(&lchanctx->entry);
free(lchanctx, M_LKPI80211);
goto out;
}
@@ -1952,10 +2092,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta->txq_ready = true;
LKPI_80211_LSTA_TXQ_UNLOCK(lsta);
- wiphy_lock(hw->wiphy);
/* Insert the [l]sta into the list of known stations. */
list_add_tail(&lsta->lsta_list, &lvif->lsta_list);
- wiphy_unlock(hw->wiphy);
/* Add (or adjust) sta and change state (from NOTEXIST) to NONE. */
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
@@ -2001,7 +2139,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
* (ideally we'd do that on a callback for something else ...)
*/
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
LKPI_80211_LVIF_LOCK(lvif);
@@ -2046,7 +2184,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
goto out_relocked;
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
out_relocked:
/*
@@ -2098,7 +2236,7 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
/* flush, drop. */
lkpi_80211_mo_flush(hw, vif, nitems(sta->txq), true);
@@ -2157,26 +2295,10 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int
/* conf_tx */
- /* Take the chan ctx down. */
- if (vif->chanctx_conf != NULL) {
- struct lkpi_chanctx *lchanctx;
- struct ieee80211_chanctx_conf *chanctx_conf;
-
- chanctx_conf = vif->chanctx_conf;
- /* Remove vif context. */
- lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->bss_conf, &vif->chanctx_conf);
- /* NB: vif->chanctx_conf is NULL now. */
-
- lkpi_hw_conf_idle(hw, true);
-
- /* Remove chan ctx. */
- lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
- lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
- free(lchanctx, M_LKPI80211);
- }
+ lkpi_remove_chanctx(hw, vif);
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
return (error);
}
@@ -2209,7 +2331,7 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in
vif = LVIF_TO_VIF(lvif);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
LKPI_80211_LVIF_LOCK(lvif);
/* XXX-BZ KASSERT later? */
@@ -2275,7 +2397,7 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in
*/
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
return (error);
}
@@ -2298,7 +2420,7 @@ lkpi_sta_a_to_a(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
vif = LVIF_TO_VIF(lvif);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
LKPI_80211_LVIF_LOCK(lvif);
/* XXX-BZ KASSERT later? */
@@ -2342,7 +2464,7 @@ lkpi_sta_a_to_a(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
error = 0;
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
return (error);
@@ -2368,7 +2490,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
vif = LVIF_TO_VIF(lvif);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
LKPI_80211_LVIF_LOCK(lvif);
#ifdef LINUXKPI_DEBUG_80211
@@ -2404,7 +2526,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
lsta->in_mgd = true;
}
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
/* Call iv_newstate first so we get potential DEAUTH packet out. */
@@ -2420,7 +2542,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
/* Ensure the packets get out. */
lkpi_80211_flush_tx(lhw, lsta);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
@@ -2501,27 +2623,11 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
/* conf_tx */
- /* Take the chan ctx down. */
- if (vif->chanctx_conf != NULL) {
- struct lkpi_chanctx *lchanctx;
- struct ieee80211_chanctx_conf *chanctx_conf;
-
- chanctx_conf = vif->chanctx_conf;
- /* Remove vif context. */
- lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->bss_conf, &vif->chanctx_conf);
- /* NB: vif->chanctx_conf is NULL now. */
-
- lkpi_hw_conf_idle(hw, true);
-
- /* Remove chan ctx. */
- lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
- lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
- free(lchanctx, M_LKPI80211);
- }
+ lkpi_remove_chanctx(hw, vif);
error = EALREADY;
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
outni:
return (error);
@@ -2580,7 +2686,7 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int
vif = LVIF_TO_VIF(lvif);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
LKPI_80211_LVIF_LOCK(lvif);
/* XXX-BZ KASSERT later? */
@@ -2656,7 +2762,6 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int
}
bss_changed |= lkpi_update_dtim_tsf(vif, ni, vap, __func__, __LINE__);
-
lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed);
/* - change_chanctx (if needed)
@@ -2691,7 +2796,7 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int
sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss);
IMPROVE("Is this the right spot, has net80211 done all updates already?");
- lkpi_sta_sync_from_ni(sta, ni);
+ lkpi_sta_sync_from_ni(hw, vif, sta, ni, true);
/* Update sta_state (ASSOC to AUTHORIZED). */
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
@@ -2718,7 +2823,7 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed);
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
return (error);
}
@@ -2777,7 +2882,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
/* flush, drop. */
lkpi_80211_mo_flush(hw, vif, nitems(sta->txq), true);
@@ -2792,7 +2897,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta->in_mgd = true;
}
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
/* Call iv_newstate first so we get potential DISASSOC packet out. */
@@ -2808,7 +2913,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
/* Ensure the packets get out. */
lkpi_80211_flush_tx(lhw, lsta);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
@@ -2852,9 +2957,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
#ifdef LKPI_80211_HW_CRYPTO
if (lkpi_hwcrypto) {
- wiphy_lock(hw->wiphy);
error = lkpi_sta_del_keys(hw, vif, lsta);
- wiphy_unlock(hw->wiphy);
if (error != 0) {
ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys "
"failed: %d\n", __func__, __LINE__, error);
@@ -2888,7 +2991,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
error = EALREADY;
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
outni:
return (error);
@@ -2914,7 +3017,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
vif = LVIF_TO_VIF(lvif);
IEEE80211_UNLOCK(vap->iv_ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
LKPI_80211_LVIF_LOCK(lvif);
#ifdef LINUXKPI_DEBUG_80211
@@ -2950,7 +3053,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta->in_mgd = true;
}
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
/* Call iv_newstate first so we get potential DISASSOC packet out. */
@@ -2966,7 +3069,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
/* Ensure the packets get out. */
lkpi_80211_flush_tx(lhw, lsta);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
@@ -3008,9 +3111,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
#ifdef LKPI_80211_HW_CRYPTO
if (lkpi_hwcrypto) {
- wiphy_lock(hw->wiphy);
error = lkpi_sta_del_keys(hw, vif, lsta);
- wiphy_unlock(hw->wiphy);
if (error != 0) {
ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys "
"failed: %d\n", __func__, __LINE__, error);
@@ -3117,27 +3218,11 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
/* conf_tx */
- /* Take the chan ctx down. */
- if (vif->chanctx_conf != NULL) {
- struct lkpi_chanctx *lchanctx;
- struct ieee80211_chanctx_conf *chanctx_conf;
-
- chanctx_conf = vif->chanctx_conf;
- /* Remove vif context. */
- lkpi_80211_mo_unassign_vif_chanctx(hw, vif, &vif->bss_conf, &vif->chanctx_conf);
- /* NB: vif->chanctx_conf is NULL now. */
-
- lkpi_hw_conf_idle(hw, true);
-
- /* Remove chan ctx. */
- lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
- lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf);
- free(lchanctx, M_LKPI80211);
- }
+ lkpi_remove_chanctx(hw, vif);
error = EALREADY;
out:
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(vap->iv_ic);
outni:
return (error);
@@ -3341,6 +3426,9 @@ lkpi_wme_update(struct lkpi_hw *lhw, struct ieee80211vap *vap, bool planned)
int error;
uint16_t ac;
+ hw = LHW_TO_HW(lhw);
+ lockdep_assert_wiphy(hw->wiphy);
+
IMPROVE();
KASSERT(WME_NUM_AC == IEEE80211_NUM_ACS, ("%s: WME_NUM_AC %d != "
"IEEE80211_NUM_ACS %d\n", __func__, WME_NUM_AC, IEEE80211_NUM_ACS));
@@ -3367,12 +3455,10 @@ lkpi_wme_update(struct lkpi_hw *lhw, struct ieee80211vap *vap, bool planned)
wmeparr[ac] = chp.cap_wmeParams[ac];
IEEE80211_UNLOCK(ic);
- hw = LHW_TO_HW(lhw);
lvif = VAP_TO_LVIF(vap);
vif = LVIF_TO_VIF(lvif);
/* Configure tx queues (conf_tx) & send BSS_CHANGED_QOS. */
- LKPI_80211_LHW_LOCK(lhw);
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
struct wmeParams *wmep;
@@ -3387,7 +3473,6 @@ lkpi_wme_update(struct lkpi_hw *lhw, struct ieee80211vap *vap, bool planned)
ic_printf(ic, "%s: conf_tx ac %u failed %d\n",
__func__, ac, error);
}
- LKPI_80211_LHW_UNLOCK(lhw);
changed = BSS_CHANGED_QOS;
if (!planned)
lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, changed);
@@ -3402,6 +3487,7 @@ lkpi_ic_wme_update(struct ieee80211com *ic)
#ifdef LKPI_80211_WME
struct ieee80211vap *vap;
struct lkpi_hw *lhw;
+ struct ieee80211_hw *hw;
IMPROVE("Use the per-VAP callback in net80211.");
vap = TAILQ_FIRST(&ic->ic_vaps);
@@ -3409,8 +3495,11 @@ lkpi_ic_wme_update(struct ieee80211com *ic)
return (0);
lhw = ic->ic_softc;
+ hw = LHW_TO_HW(lhw);
+ wiphy_lock(hw->wiphy);
lkpi_wme_update(lhw, vap, false);
+ wiphy_unlock(hw->wiphy);
#endif
return (0); /* unused */
}
@@ -3492,7 +3581,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
/* XXX-BZ hardcoded for now! */
#if 1
- vif->chanctx_conf = NULL;
+ RCU_INIT_POINTER(vif->bss_conf.chanctx_conf, NULL);
vif->bss_conf.vif = vif;
/* vap->iv_myaddr is not set until net80211::vap_setup or vap_attach. */
IEEE80211_ADDR_COPY(vif->bss_conf.addr, mac);
@@ -3575,7 +3664,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
/* Configure tx queues (conf_tx), default WME & send BSS_CHANGED_QOS. */
IMPROVE("Hardcoded values; to fix see 802.11-2016, 9.4.2.29 EDCA Parameter Set element");
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
bzero(&txqp, sizeof(txqp));
@@ -3588,7 +3677,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
ic_printf(ic, "%s: conf_tx ac %u failed %d\n",
__func__, ac, error);
}
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
changed = BSS_CHANGED_QOS;
lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, changed);
@@ -3750,8 +3839,8 @@ static void
lkpi_ic_parent(struct ieee80211com *ic)
{
struct lkpi_hw *lhw;
-#ifdef HW_START_STOP
struct ieee80211_hw *hw;
+#ifdef HW_START_STOP
int error;
#endif
bool start_all;
@@ -3759,13 +3848,11 @@ lkpi_ic_parent(struct ieee80211com *ic)
IMPROVE();
lhw = ic->ic_softc;
-#ifdef HW_START_STOP
hw = LHW_TO_HW(lhw);
-#endif
start_all = false;
/* IEEE80211_UNLOCK(ic); */
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
if (ic->ic_nrunning > 0) {
#ifdef HW_START_STOP
error = lkpi_80211_mo_start(hw);
@@ -3777,7 +3864,7 @@ lkpi_ic_parent(struct ieee80211com *ic)
lkpi_80211_mo_stop(hw, false); /* XXX SUSPEND */
#endif
}
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
/* IEEE80211_LOCK(ic); */
if (start_all)
@@ -3877,7 +3964,8 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies,
}
#endif
#if defined(LKPI_80211_VHT)
- if ((vap->iv_vht_flags & IEEE80211_FVHT_VHT) != 0) {
+ if (band == NL80211_BAND_5GHZ &&
+ (vap->iv_vht_flags & IEEE80211_FVHT_VHT) != 0) {
struct ieee80211_channel *c;
c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan,
@@ -4742,9 +4830,9 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m)
ltxq->txq.tid, ac, skb->priority, skb->qmap);
#endif
LKPI_80211_LTXQ_UNLOCK(ltxq);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
lkpi_80211_mo_wake_tx_queue(hw, &ltxq->txq);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
return;
ops_tx:
@@ -4757,9 +4845,9 @@ ops_tx:
#endif
memset(&control, 0, sizeof(control));
control.sta = sta;
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
lkpi_80211_mo_tx(hw, &control, skb);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
}
static void
@@ -4920,9 +5008,9 @@ lkpi_ic_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
params.amsdu = false;
IEEE80211_UNLOCK(ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
error = lkpi_80211_mo_ampdu_action(hw, vif, &params);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(ic);
if (error != 0) {
ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n",
@@ -4998,9 +5086,9 @@ lkpi_ic_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap
}
IEEE80211_UNLOCK(ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
error = lkpi_80211_mo_ampdu_action(hw, vif, &params);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(ic);
if (error != 0) {
ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n",
@@ -5057,9 +5145,9 @@ lkpi_ic_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
params.amsdu = false;
IEEE80211_UNLOCK(ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
error = lkpi_80211_mo_ampdu_action(hw, vif, &params);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
IEEE80211_LOCK(ic);
if (error != 0) {
ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n",
@@ -5155,9 +5243,9 @@ lkpi_ic_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap
else
params.amsdu = false;
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
error = lkpi_80211_mo_ampdu_action(hw, vif, &params);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
if (error != 0) {
ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n",
__func__, error, ni, rap);
@@ -5229,9 +5317,9 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
ic_locked = IEEE80211_IS_LOCKED(ic);
if (ic_locked)
IEEE80211_UNLOCK(ic);
- LKPI_80211_LHW_LOCK(lhw);
+ wiphy_lock(hw->wiphy);
error = lkpi_80211_mo_ampdu_action(hw, vif, &params);
- LKPI_80211_LHW_UNLOCK(lhw);
+ wiphy_unlock(hw->wiphy);
if (ic_locked)
IEEE80211_LOCK(ic);
if (error != 0)
@@ -5379,7 +5467,7 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan,
NL80211_BAND_5GHZ);
#ifdef LKPI_80211_VHT
- if (hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.vht_supported){
+ if (hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.vht_supported) {
ic->ic_flags_ext |= IEEE80211_FEXT_VHT;
ic->ic_vht_cap.vht_cap_info =
@@ -5469,7 +5557,6 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops)
lhw = wiphy_priv(wiphy);
lhw->ops = ops;
- LKPI_80211_LHW_LOCK_INIT(lhw);
LKPI_80211_LHW_SCAN_LOCK_INIT(lhw);
LKPI_80211_LHW_TXQ_LOCK_INIT(lhw);
sx_init_flags(&lhw->lvif_sx, "lhw-lvif", SX_RECURSE | SX_DUPOK);
@@ -5479,6 +5566,9 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops)
TAILQ_INIT(&lhw->scheduled_txqs[ac]);
}
+ /* Chanctx_conf */
+ INIT_LIST_HEAD(&lhw->lchanctx_list);
+
/* Deferred RX path. */
LKPI_80211_LHW_RXQ_LOCK_INIT(lhw);
TASK_INIT(&lhw->rxq_task, 0, lkpi_80211_lhw_rxq_task, lhw);
@@ -5542,10 +5632,25 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw)
__func__, lhw, mbufq_len(&lhw->rxq)));
LKPI_80211_LHW_RXQ_LOCK_DESTROY(lhw);
+ /* Chanctx_conf. */
+ if (!list_empty_careful(&lhw->lchanctx_list)) {
+ struct lkpi_chanctx *lchanctx, *next;
+ struct ieee80211_chanctx_conf *chanctx_conf;
+
+ list_for_each_entry_safe(lchanctx, next, &lhw->lchanctx_list, entry) {
+ if (lchanctx->added_to_drv) {
+ /* In reality we should panic? */
+ chanctx_conf = &lchanctx->chanctx_conf;
+ lkpi_80211_mo_remove_chanctx(hw, chanctx_conf);
+ }
+ list_del(&lchanctx->entry);
+ free(lchanctx, M_LKPI80211);
+ }
+ }
+
/* Cleanup more of lhw here or in wiphy_free()? */
LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw);
LKPI_80211_LHW_SCAN_LOCK_DESTROY(lhw);
- LKPI_80211_LHW_LOCK_DESTROY(lhw);
sx_destroy(&lhw->lvif_sx);
IMPROVE();
}
@@ -5654,6 +5759,10 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw)
lhw->scan_flags |= LKPI_LHW_SCAN_HW;
}
+ /* Does HW support Fragmentation offload? */
+ if (ieee80211_hw_check(hw, SUPPORTS_TX_FRAG))
+ ic->ic_flags_ext |= IEEE80211_FEXT_FRAG_OFFLOAD;
+
/*
* The wiphy variables report bitmasks of avail antennas.
* (*get_antenna) get the current bitmask sets which can be
@@ -5977,8 +6086,6 @@ linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *hw,
void *arg)
{
struct lkpi_hw *lhw;
- struct lkpi_vif *lvif;
- struct ieee80211_vif *vif;
struct lkpi_chanctx *lchanctx;
KASSERT(hw != NULL && iterfunc != NULL,
@@ -5986,22 +6093,13 @@ linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *hw,
lhw = HW_TO_LHW(hw);
- IMPROVE("lchanctx should be its own list somewhere");
-
- LKPI_80211_LHW_LVIF_LOCK(lhw);
- TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {
-
- vif = LVIF_TO_VIF(lvif);
- if (vif->chanctx_conf == NULL)
- continue;
-
- lchanctx = CHANCTX_CONF_TO_LCHANCTX(vif->chanctx_conf);
+ rcu_read_lock();
+ list_for_each_entry_rcu(lchanctx, &lhw->lchanctx_list, entry) {
if (!lchanctx->added_to_drv)
continue;
-
iterfunc(hw, &lchanctx->chanctx_conf, arg);
}
- LKPI_80211_LHW_LVIF_UNLOCK(lhw);
+ rcu_read_unlock();
}
void
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h
index c2d29b2dcc4b..ebf02994af47 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.h
+++ b/sys/compat/linuxkpi/common/src/linux_80211.h
@@ -187,6 +187,7 @@ struct lkpi_vif {
struct lkpi_sta *lvif_bss;
+ int ic_unlocked; /* Count of ic unlocks pending (*mo_set_key) */
int nt_unlocked; /* Count of nt unlocks pending (*mo_set_key) */
bool lvif_bss_synched;
bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */
@@ -216,7 +217,7 @@ struct lkpi_hw { /* name it mac80211_sc? */
TAILQ_HEAD(, lkpi_vif) lvif_head;
struct sx lvif_sx;
- struct sx sx; /* XXX-BZ Can this be wiphy->mtx in the future? */
+ struct list_head lchanctx_list;
struct mtx txq_mtx;
uint32_t txq_generation[IEEE80211_NUM_ACS];
@@ -284,7 +285,10 @@ struct lkpi_hw { /* name it mac80211_sc? */
#define HW_TO_LHW(_hw) container_of(_hw, struct lkpi_hw, hw)
struct lkpi_chanctx {
+ struct list_head entry;
+
bool added_to_drv; /* Managed by MO */
+
struct ieee80211_chanctx_conf chanctx_conf __aligned(CACHE_LINE_SIZE);
};
#define LCHANCTX_TO_CHANCTX_CONF(_lchanctx) \
@@ -318,19 +322,6 @@ struct lkpi_wiphy {
#define LKPI_80211_LWIPHY_WORK_UNLOCK_ASSERT(_lwiphy) \
mtx_assert(&(_lwiphy)->wwk_mtx, MA_NOTOWNED)
-#define LKPI_80211_LHW_LOCK_INIT(_lhw) \
- sx_init_flags(&(_lhw)->sx, "lhw", SX_RECURSE);
-#define LKPI_80211_LHW_LOCK_DESTROY(_lhw) \
- sx_destroy(&(_lhw)->sx);
-#define LKPI_80211_LHW_LOCK(_lhw) \
- sx_xlock(&(_lhw)->sx)
-#define LKPI_80211_LHW_UNLOCK(_lhw) \
- sx_xunlock(&(_lhw)->sx)
-#define LKPI_80211_LHW_LOCK_ASSERT(_lhw) \
- sx_assert(&(_lhw)->sx, SA_LOCKED)
-#define LKPI_80211_LHW_UNLOCK_ASSERT(_lhw) \
- sx_assert(&(_lhw)->sx, SA_UNLOCKED)
-
#define LKPI_80211_LHW_SCAN_LOCK_INIT(_lhw) \
mtx_init(&(_lhw)->scan_mtx, "lhw-scan", NULL, MTX_DEF | MTX_RECURSE);
#define LKPI_80211_LHW_SCAN_LOCK_DESTROY(_lhw) \
@@ -425,7 +416,7 @@ int lkpi_80211_mo_config(struct ieee80211_hw *, uint32_t);
int lkpi_80211_mo_assign_vif_chanctx(struct ieee80211_hw *, struct ieee80211_vif *,
struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *);
void lkpi_80211_mo_unassign_vif_chanctx(struct ieee80211_hw *, struct ieee80211_vif *,
- struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf **);
+ struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *);
int lkpi_80211_mo_add_chanctx(struct ieee80211_hw *, struct ieee80211_chanctx_conf *);
void lkpi_80211_mo_change_chanctx(struct ieee80211_hw *,
struct ieee80211_chanctx_conf *, uint32_t);
diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
index fde23d02af5e..d7bd26a3d0e3 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
@@ -458,7 +458,7 @@ lkpi_80211_mo_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *
hw, vif, conf, chanctx_conf);
error = lhw->ops->assign_vif_chanctx(hw, vif, conf, chanctx_conf);
if (error == 0)
- vif->chanctx_conf = chanctx_conf;
+ vif->bss_conf.chanctx_conf = chanctx_conf;
out:
return (error);
@@ -466,21 +466,23 @@ out:
void
lkpi_80211_mo_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_bss_conf *conf, struct ieee80211_chanctx_conf **chanctx_conf)
+ struct ieee80211_bss_conf *conf, struct ieee80211_chanctx_conf *chanctx_conf)
{
struct lkpi_hw *lhw;
+ might_sleep();
+ lockdep_assert_wiphy(hw->wiphy);
+
lhw = HW_TO_LHW(hw);
if (lhw->ops->unassign_vif_chanctx == NULL)
return;
- if (*chanctx_conf == NULL)
+ if (chanctx_conf == NULL)
return;
LKPI_80211_TRACE_MO("hw %p vif %p bss_conf %p chanctx_conf %p",
- hw, vif, conf, *chanctx_conf);
- lhw->ops->unassign_vif_chanctx(hw, vif, conf, *chanctx_conf);
- *chanctx_conf = NULL;
+ hw, vif, conf, chanctx_conf);
+ lhw->ops->unassign_vif_chanctx(hw, vif, conf, chanctx_conf);
}
@@ -551,6 +553,9 @@ lkpi_80211_mo_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vi
lhw->ops->bss_info_changed == NULL)
return;
+ if (changed == 0)
+ return;
+
LKPI_80211_TRACE_MO("hw %p vif %p conf %p changed %#jx", hw, vif, conf, (uintmax_t)changed);
if (lhw->ops->link_info_changed != NULL)
lhw->ops->link_info_changed(hw, vif, conf, changed);
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
index af6cc01d8020..30acd1b54e9c 100644
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -96,6 +96,8 @@
#include <linux/rcupdate.h>
#include <linux/interval_tree.h>
#include <linux/interval_tree_generic.h>
+#include <linux/printk.h>
+#include <linux/seq_file.h>
#if defined(__i386__) || defined(__amd64__)
#include <asm/smp.h>
@@ -1969,6 +1971,84 @@ kasprintf(gfp_t gfp, const char *fmt, ...)
return (p);
}
+int
+__lkpi_hexdump_printf(void *arg1 __unused, const char *fmt, ...)
+{
+ va_list ap;
+ int result;
+
+ va_start(ap, fmt);
+ result = vprintf(fmt, ap);
+ va_end(ap);
+ return (result);
+}
+
+int
+__lkpi_hexdump_sbuf_printf(void *arg1, const char *fmt, ...)
+{
+ va_list ap;
+ int result;
+
+ va_start(ap, fmt);
+ result = sbuf_vprintf(arg1, fmt, ap);
+ va_end(ap);
+ return (result);
+}
+
+void
+lkpi_hex_dump(int(*_fpf)(void *, const char *, ...), void *arg1,
+ const char *level, const char *prefix_str,
+ const int prefix_type, const int rowsize, const int groupsize,
+ const void *buf, size_t len, const bool ascii)
+{
+ typedef const struct { long long value; } __packed *print_64p_t;
+ typedef const struct { uint32_t value; } __packed *print_32p_t;
+ typedef const struct { uint16_t value; } __packed *print_16p_t;
+ const void *buf_old = buf;
+ int row;
+
+ while (len > 0) {
+ if (level != NULL)
+ _fpf(arg1, "%s", level);
+ if (prefix_str != NULL)
+ _fpf(arg1, "%s ", prefix_str);
+
+ switch (prefix_type) {
+ case DUMP_PREFIX_ADDRESS:
+ _fpf(arg1, "[%p] ", buf);
+ break;
+ case DUMP_PREFIX_OFFSET:
+ _fpf(arg1, "[%#tx] ", ((const char *)buf -
+ (const char *)buf_old));
+ break;
+ default:
+ break;
+ }
+ for (row = 0; row != rowsize; row++) {
+ if (groupsize == 8 && len > 7) {
+ _fpf(arg1, "%016llx ", ((print_64p_t)buf)->value);
+ buf = (const uint8_t *)buf + 8;
+ len -= 8;
+ } else if (groupsize == 4 && len > 3) {
+ _fpf(arg1, "%08x ", ((print_32p_t)buf)->value);
+ buf = (const uint8_t *)buf + 4;
+ len -= 4;
+ } else if (groupsize == 2 && len > 1) {
+ _fpf(arg1, "%04x ", ((print_16p_t)buf)->value);
+ buf = (const uint8_t *)buf + 2;
+ len -= 2;
+ } else if (len > 0) {
+ _fpf(arg1, "%02x ", *(const uint8_t *)buf);
+ buf = (const uint8_t *)buf + 1;
+ len--;
+ } else {
+ break;
+ }
+ }
+ _fpf(arg1, "\n");
+ }
+}
+
static void
linux_timer_callback_wrapper(void *context)
{
@@ -2767,8 +2847,8 @@ linux_compat_init(void *arg)
boot_cpu_data.x86_model = CPUID_TO_MODEL(cpu_id);
boot_cpu_data.x86_vendor = x86_vendor;
- __cpu_data = mallocarray(mp_maxid + 1,
- sizeof(*__cpu_data), M_KMALLOC, M_WAITOK | M_ZERO);
+ __cpu_data = kmalloc_array(mp_maxid + 1,
+ sizeof(*__cpu_data), M_WAITOK | M_ZERO);
CPU_FOREACH(i) {
__cpu_data[i].x86_clflush_size = cpu_clflush_line_size;
__cpu_data[i].x86_max_cores = mp_ncpus;
@@ -2810,8 +2890,8 @@ linux_compat_init(void *arg)
* This is used by cpumask_of() (and possibly others in the future) for,
* e.g., drivers to pass hints to irq_set_affinity_hint().
*/
- static_single_cpu_mask = mallocarray(mp_maxid + 1,
- sizeof(static_single_cpu_mask), M_KMALLOC, M_WAITOK | M_ZERO);
+ static_single_cpu_mask = kmalloc_array(mp_maxid + 1,
+ sizeof(static_single_cpu_mask), M_WAITOK | M_ZERO);
/*
* When the number of CPUs reach a threshold, we start to save memory
@@ -2830,9 +2910,9 @@ linux_compat_init(void *arg)
* (_BITSET_BITS / 8)' bytes (for comparison with the
* overlapping scheme).
*/
- static_single_cpu_mask_lcs = mallocarray(mp_ncpus,
+ static_single_cpu_mask_lcs = kmalloc_array(mp_ncpus,
sizeof(*static_single_cpu_mask_lcs),
- M_KMALLOC, M_WAITOK | M_ZERO);
+ M_WAITOK | M_ZERO);
sscm_ptr = static_single_cpu_mask_lcs;
CPU_FOREACH(i) {
diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c
index bc780ab3f609..3d75ca480661 100644
--- a/sys/compat/linuxkpi/common/src/linux_slab.c
+++ b/sys/compat/linuxkpi/common/src/linux_slab.c
@@ -1,6 +1,10 @@
/*-
* Copyright (c) 2017 Mellanox Technologies, Ltd.
* All rights reserved.
+ * Copyright (c) 2024-2025 The FreeBSD Foundation
+ *
+ * Portions of this software were developed by Björn Zeeb
+ * under sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -208,6 +212,18 @@ linux_kmem_cache_destroy(struct linux_kmem_cache *c)
}
void *
+lkpi___kmalloc_node(size_t size, gfp_t flags, int node)
+{
+ if (size <= PAGE_SIZE)
+ return (malloc_domainset(size, M_KMALLOC,
+ linux_get_vm_domain_set(node), linux_check_m_flags(flags)));
+ else
+ return (contigmalloc_domainset(size, M_KMALLOC,
+ linux_get_vm_domain_set(node), linux_check_m_flags(flags),
+ 0, -1UL, PAGE_SIZE, 0));
+}
+
+void *
lkpi___kmalloc(size_t size, gfp_t flags)
{
size_t _s;
@@ -222,6 +238,41 @@ lkpi___kmalloc(size_t size, gfp_t flags)
0, -1UL, PAGE_SIZE, 0));
}
+void *
+lkpi_krealloc(void *ptr, size_t size, gfp_t flags)
+{
+ void *nptr;
+ size_t osize;
+
+ /*
+ * First handle invariants based on function arguments.
+ */
+ if (ptr == NULL)
+ return (kmalloc(size, flags));
+
+ osize = ksize(ptr);
+ if (size <= osize)
+ return (ptr);
+
+ /*
+ * We know the new size > original size. realloc(9) does not (and cannot)
+ * know about our requirements for physically contiguous memory, so we can
+ * only call it for sizes up to and including PAGE_SIZE, and otherwise have
+ * to replicate its functionality using kmalloc to get the contigmalloc(9)
+ * backing.
+ */
+ if (size <= PAGE_SIZE)
+ return (realloc(ptr, size, M_KMALLOC, linux_check_m_flags(flags)));
+
+ nptr = kmalloc(size, flags);
+ if (nptr == NULL)
+ return (NULL);
+
+ memcpy(nptr, ptr, osize);
+ kfree(ptr);
+ return (nptr);
+}
+
struct lkpi_kmalloc_ctx {
size_t size;
gfp_t flags;
@@ -256,7 +307,7 @@ linux_kfree_async_fn(void *context, int pending)
static struct task linux_kfree_async_task =
TASK_INITIALIZER(0, linux_kfree_async_fn, &linux_kfree_async_task);
-void
+static void
linux_kfree_async(void *addr)
{
if (addr == NULL)
@@ -264,3 +315,16 @@ linux_kfree_async(void *addr)
llist_add(addr, &linux_kfree_async_list);
taskqueue_enqueue(linux_irq_work_tq, &linux_kfree_async_task);
}
+
+void
+lkpi_kfree(const void *ptr)
+{
+ if (ZERO_OR_NULL_PTR(ptr))
+ return;
+
+ if (curthread->td_critnest != 0)
+ linux_kfree_async(__DECONST(void *, ptr));
+ else
+ free(__DECONST(void *, ptr), M_KMALLOC);
+}
+
diff --git a/sys/conf/files b/sys/conf/files
index 2f4b7126a9cd..d3ee52399291 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -2412,11 +2412,11 @@ dev/mii/ukphy.c optional miibus | mii
dev/mii/ukphy_subr.c optional miibus | mii
dev/mii/vscphy.c optional miibus | vscphy
dev/mii/xmphy.c optional miibus | xmphy
-dev/mlxfw/mlxfw_fsm.c optional mlxfw \
+dev/mlxfw/mlxfw_fsm.c optional mlxfw compat_linuxkpi \
compile-with "${MLXFW_C}"
-dev/mlxfw/mlxfw_mfa2.c optional mlxfw \
+dev/mlxfw/mlxfw_mfa2.c optional mlxfw compat_linuxkpi \
compile-with "${MLXFW_C}"
-dev/mlxfw/mlxfw_mfa2_tlv_multi.c optional mlxfw \
+dev/mlxfw/mlxfw_mfa2_tlv_multi.c optional mlxfw compat_linuxkpi \
compile-with "${MLXFW_C}"
dev/mlx/mlx.c optional mlx
dev/mlx/mlx_disk.c optional mlx
@@ -2427,6 +2427,7 @@ dev/mmc/mmc.c optional mmc !mmccam
dev/mmc/mmcbr_if.m standard
dev/mmc/mmcbus_if.m standard
dev/mmc/mmcsd.c optional mmcsd !mmccam
+dev/mmc/mmcspi.c optional mmcsd spibus !mmccam fdt
dev/mmc/mmc_fdt_helpers.c optional mmc regulator clk fdt | mmccam regulator clk fdt
dev/mmc/mmc_helpers.c optional mmc gpio regulator clk | mmccam gpio regulator clk
dev/mmc/mmc_pwrseq.c optional mmc clk regulator fdt | mmccam clk regulator fdt
@@ -4906,137 +4907,137 @@ dev/mlx4/mlx4_en/mlx4_en_rx.c optional mlx4en pci inet inet6 \
dev/mlx4/mlx4_en/mlx4_en_tx.c optional mlx4en pci inet inet6 \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_ah.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_ah.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_cong.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_cong.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_cq.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_cq.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_devx.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_devx.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_gsi.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_gsi.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_mad.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_mad.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_main.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_main.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_mem.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_mem.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_mr.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_mr.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_qp.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_qp.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_srq.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_srq.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_ib/mlx5_ib_virt.c optional mlx5ib pci ofed \
+dev/mlx5/mlx5_ib/mlx5_ib_virt.c optional mlx5ib pci ofed compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_alloc.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_alloc.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_crypto.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_crypto.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_diag_cnt.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_diag_cnt.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_eswitch.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_eswitch.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fs_chains.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fs_chains.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fs_cmd.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fs_cmd.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fs_core.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fs_core.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fs_counters.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fs_counters.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fs_ft_pool.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fs_ft_pool.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fs_tcp.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fs_tcp.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fw.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fw.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_fwdump.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_fwdump.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_health.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_health.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_mad.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_mad.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_main.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_main.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_mcg.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_mcg.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_mpfs.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_mpfs.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_mr.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_mr.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_pagealloc.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_pagealloc.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_pd.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_pd.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_port.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_port.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_qp.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_qp.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_rl.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_rl.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_srq.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_srq.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_tls.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_tls.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_transobj.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_transobj.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_uar.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_uar.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_vport.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_vport.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_vsc.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_vsc.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_core/mlx5_wq.c optional mlx5 pci \
+dev/mlx5/mlx5_core/mlx5_wq.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_lib/mlx5_aso.c optional mlx5 pci \
+dev/mlx5/mlx5_lib/mlx5_aso.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_lib/mlx5_gid.c optional mlx5 pci \
+dev/mlx5/mlx5_lib/mlx5_gid.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c optional mlx5 pci \
+dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_accel/mlx5_ipsec_offload.c optional mlx5 pci \
+dev/mlx5/mlx5_accel/mlx5_ipsec_offload.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_accel/mlx5_ipsec.c optional mlx5 pci \
+dev/mlx5/mlx5_accel/mlx5_ipsec.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c optional mlx5 pci \
+dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c optional mlx5 pci compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_dim.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_dim.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_ethtool.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_ethtool.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_main.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_main.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_tx.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_tx.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_flow_table.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_flow_table.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_hw_tls.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_hw_tls.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_iq.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_iq.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_rx.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_rx.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_rl.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_rl.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_txrx.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_txrx.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
-dev/mlx5/mlx5_en/mlx5_en_port_buffer.c optional mlx5en pci inet inet6 \
+dev/mlx5/mlx5_en/mlx5_en_port_buffer.c optional mlx5en pci inet inet6 compat_linuxkpi \
compile-with "${OFED_C}"
# crypto support
diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt
index 5130ba82057d..435540b254f1 100644
--- a/sys/contrib/dev/acpica/changes.txt
+++ b/sys/contrib/dev/acpica/changes.txt
@@ -1,4 +1,20 @@
----------------------------------------
+4 April 2025. Summary of changes for version 20250404:
+
+Major changes:
+
+Update all the copyright continuation year to 2025 in the license header of all files
+
+Add complete support for 3 new ACPI tables ? MRRM,ERDT and RIMT (Tony Luck & V L Sunil)
+
+Add a license file to the project which is a great improvement (Dionna Glaze)
+
+Update DMAR and TPM2 tables to support their latest versions (Alexey Neyman and Stuart Yoder)
+
+A few fixes including local cache allocation, FFixedHW Region, attribute packing, string vs. non-string char array, vsnprintf()etc. along with some comments, spelling errors and code alignment (multiple awesome contributors)
+
+
+----------------------------------------
12 December 2024. Summary of changes for version 20241212:
Major changes:
diff --git a/sys/contrib/dev/acpica/common/acfileio.c b/sys/contrib/dev/acpica/common/acfileio.c
index c8666a18384b..19274cb4bdd3 100644
--- a/sys/contrib/dev/acpica/common/acfileio.c
+++ b/sys/contrib/dev/acpica/common/acfileio.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/acgetline.c b/sys/contrib/dev/acpica/common/acgetline.c
index 6aa66412722f..2793f26077bb 100644
--- a/sys/contrib/dev/acpica/common/acgetline.c
+++ b/sys/contrib/dev/acpica/common/acgetline.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/adfile.c b/sys/contrib/dev/acpica/common/adfile.c
index 54c88ce149dc..f87b329d918d 100644
--- a/sys/contrib/dev/acpica/common/adfile.c
+++ b/sys/contrib/dev/acpica/common/adfile.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/adisasm.c b/sys/contrib/dev/acpica/common/adisasm.c
index c329093901f7..96cd6c7f5d3c 100644
--- a/sys/contrib/dev/acpica/common/adisasm.c
+++ b/sys/contrib/dev/acpica/common/adisasm.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -458,7 +458,7 @@ AdDisassembleOneTable (
*/
if (AcpiGbl_CaptureComments)
{
- strncpy (Table->Signature, AcpiGbl_TableSig, ACPI_NAMESEG_SIZE);
+ memcpy (Table->Signature, AcpiGbl_TableSig, ACPI_NAMESEG_SIZE);
}
#endif
diff --git a/sys/contrib/dev/acpica/common/adwalk.c b/sys/contrib/dev/acpica/common/adwalk.c
index bb6f7e21c08a..b7484315fe51 100644
--- a/sys/contrib/dev/acpica/common/adwalk.c
+++ b/sys/contrib/dev/acpica/common/adwalk.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/ahids.c b/sys/contrib/dev/acpica/common/ahids.c
index a50a4d51a2a3..07b69b45c641 100644
--- a/sys/contrib/dev/acpica/common/ahids.c
+++ b/sys/contrib/dev/acpica/common/ahids.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/ahpredef.c b/sys/contrib/dev/acpica/common/ahpredef.c
index e1e71b9c0c4d..e6c3f2758760 100644
--- a/sys/contrib/dev/acpica/common/ahpredef.c
+++ b/sys/contrib/dev/acpica/common/ahpredef.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/ahtable.c b/sys/contrib/dev/acpica/common/ahtable.c
index 7a95e5f3198d..898b2d09f609 100644
--- a/sys/contrib/dev/acpica/common/ahtable.c
+++ b/sys/contrib/dev/acpica/common/ahtable.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -219,6 +219,7 @@ const AH_TABLE AcpiGbl_SupportedTables[] =
{ACPI_SIG_DSDT, "Differentiated System Description Table (AML table)"},
{ACPI_SIG_ECDT, "Embedded Controller Boot Resources Table"},
{ACPI_SIG_EINJ, "Error Injection Table"},
+ {ACPI_SIG_ERDT, "Enhanced Resource Director Technology Table"},
{ACPI_SIG_ERST, "Error Record Serialization Table"},
{ACPI_SIG_FACS, "Firmware ACPI Control Structure"},
{ACPI_SIG_FADT, "Fixed ACPI Description Table (FADT)"},
@@ -235,6 +236,7 @@ const AH_TABLE AcpiGbl_SupportedTables[] =
{ACPI_SIG_MCHI, "Management Controller Host Interface Table"},
{ACPI_SIG_MPAM, "Memory System Resource Partitioning and Monitoring Table"},
{ACPI_SIG_MPST, "Memory Power State Table"},
+ {ACPI_SIG_MRRM, "Memory Range and Region Mapping Table"},
{ACPI_SIG_MSCT, "Maximum System Characteristics Table"},
{ACPI_SIG_MSDM, "Microsoft Data Management Table"},
{ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"},
diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c
index cb29f05f1059..f7056fdf9363 100644
--- a/sys/contrib/dev/acpica/common/ahuuids.c
+++ b/sys/contrib/dev/acpica/common/ahuuids.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/cmfsize.c b/sys/contrib/dev/acpica/common/cmfsize.c
index 8b4b00909714..c6cedf9a0866 100644
--- a/sys/contrib/dev/acpica/common/cmfsize.c
+++ b/sys/contrib/dev/acpica/common/cmfsize.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/dmextern.c b/sys/contrib/dev/acpica/common/dmextern.c
index 3c5ba89a762f..d2eeffdfe02e 100644
--- a/sys/contrib/dev/acpica/common/dmextern.c
+++ b/sys/contrib/dev/acpica/common/dmextern.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/dmrestag.c b/sys/contrib/dev/acpica/common/dmrestag.c
index aca96acffcf4..8c7cc4b9ef7c 100644
--- a/sys/contrib/dev/acpica/common/dmrestag.c
+++ b/sys/contrib/dev/acpica/common/dmrestag.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -894,7 +894,7 @@ static void
AcpiDmUpdateResourceName (
ACPI_NAMESPACE_NODE *ResourceNode)
{
- char Name[ACPI_NAMESEG_SIZE];
+ char Name[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
/* Ignore if a unique name has already been assigned */
diff --git a/sys/contrib/dev/acpica/common/dmswitch.c b/sys/contrib/dev/acpica/common/dmswitch.c
index a2f20bab281a..8d5ca2e016a7 100644
--- a/sys/contrib/dev/acpica/common/dmswitch.c
+++ b/sys/contrib/dev/acpica/common/dmswitch.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c
index c40abb20703a..fcff97a304ae 100644
--- a/sys/contrib/dev/acpica/common/dmtable.c
+++ b/sys/contrib/dev/acpica/common/dmtable.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -272,6 +272,7 @@ static const char *AcpiDmDmarSubnames[] =
"Remapping Hardware Static Affinity",
"ACPI Namespace Device Declaration",
"SoC Integrated Address Translation Cache",
+ "SoC Integrated Device Property",
"Unknown Subtable Type" /* Reserved */
};
@@ -312,6 +313,22 @@ static const char *AcpiDmEinjInstructions[] =
"Unknown Instruction"
};
+static const char *AcpiDmErdtSubnames[] =
+{
+ "RMDD",
+ "CACD",
+ "DACD",
+ "CMRC",
+ "MMRC",
+ "MARC",
+ "CARC",
+ "CMRD",
+ "IBRD",
+ "IBAD",
+ "CARD",
+ "RESERVED"
+};
+
static const char *AcpiDmErstActions[] =
{
"Begin Write Operation",
@@ -660,6 +677,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_DRTM, NULL, AcpiDmDumpDrtm, DtCompileDrtm, TemplateDrtm},
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt},
{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj},
+ {ACPI_SIG_ERDT, NULL, AcpiDmDumpErdt, DtCompileErdt, TemplateErdt},
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst},
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt},
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt},
@@ -675,6 +693,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi},
{ACPI_SIG_MPAM, NULL, AcpiDmDumpMpam, DtCompileMpam, TemplateMpam},
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst},
+ {ACPI_SIG_MRRM, NULL, AcpiDmDumpMrrm, DtCompileMrrm, TemplateMrrm},
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct},
{ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm},
{ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit},
@@ -689,6 +708,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_RAS2, AcpiDmTableInfoRas2, AcpiDmDumpRas2, DtCompileRas2, TemplateRas2},
{ACPI_SIG_RGRT, NULL, AcpiDmDumpRgrt, DtCompileRgrt, TemplateRgrt},
{ACPI_SIG_RHCT, NULL, AcpiDmDumpRhct, DtCompileRhct, TemplateRhct},
+ {ACPI_SIG_RIMT, NULL, AcpiDmDumpRimt, DtCompileRimt, TemplateRimt},
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt},
{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt},
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst},
@@ -1132,6 +1152,7 @@ AcpiDmDumpTable (
case ACPI_DMT_ASPT:
case ACPI_DMT_UINT16:
case ACPI_DMT_DMAR:
+ case ACPI_DMT_ERDT:
case ACPI_DMT_HEST:
case ACPI_DMT_HMAT:
case ACPI_DMT_NFIT:
@@ -1185,6 +1206,11 @@ AcpiDmDumpTable (
ByteLength = 10;
break;
+ case ACPI_DMT_BUF11:
+
+ ByteLength = 11;
+ break;
+
case ACPI_DMT_BUF12:
ByteLength = 12;
@@ -1201,6 +1227,16 @@ AcpiDmDumpTable (
ByteLength = 18;
break;
+ case ACPI_DMT_BUF24:
+
+ ByteLength = 24;
+ break;
+
+ case ACPI_DMT_BUF26:
+
+ ByteLength = 26;
+ break;
+
case ACPI_DMT_BUF32:
ByteLength = 32;
@@ -1419,9 +1455,12 @@ AcpiDmDumpTable (
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF10:
+ case ACPI_DMT_BUF11:
case ACPI_DMT_BUF12:
case ACPI_DMT_BUF16:
case ACPI_DMT_BUF18:
+ case ACPI_DMT_BUF24:
+ case ACPI_DMT_BUF26:
case ACPI_DMT_BUF32:
case ACPI_DMT_BUF112:
case ACPI_DMT_BUF128:
@@ -1767,6 +1806,20 @@ AcpiDmDumpTable (
AcpiDmErstActions[Temp8]);
break;
+ case ACPI_DMT_ERDT:
+
+ /* ERDT subtable types */
+
+ Temp16 = *Target;
+ if (Temp16 > ACPI_ERDT_TYPE_RESERVED)
+ {
+ Temp16 = ACPI_ERDT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmErdtSubnames[Temp16]);
+ break;
+
case ACPI_DMT_ERSTINST:
/* ERST Instruction types */
diff --git a/sys/contrib/dev/acpica/common/dmtables.c b/sys/contrib/dev/acpica/common/dmtables.c
index 227d6ae335ed..c72f6451154c 100644
--- a/sys/contrib/dev/acpica/common/dmtables.c
+++ b/sys/contrib/dev/acpica/common/dmtables.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c
index 47173d8e31fc..aa8b5aa76892 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/dmtbdump1.c b/sys/contrib/dev/acpica/common/dmtbdump1.c
index edf366039edb..3453ed479a22 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump1.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump1.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -1480,6 +1480,12 @@ AcpiDmDumpDmar (
ScopeOffset = sizeof (ACPI_DMAR_SATC);
break;
+ case ACPI_DMAR_TYPE_SIDP:
+
+ InfoTable = AcpiDmTableInfoDmar6;
+ ScopeOffset = sizeof (ACPI_DMAR_SIDP);
+ break;
+
default:
AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
@@ -1719,6 +1725,233 @@ AcpiDmDumpEinj (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpErdt
+ *
+ * PARAMETERS: Table - A ERDT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a ERDT. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpErdt (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_SUBTBL_HDR_16 *Subtable, *Subsubtable;
+ ACPI_ERDT_DACD_PATHS *ScopeTable;
+ UINT32 Offset = sizeof (ACPI_TABLE_ERDT);
+ UINT32 Suboffset;
+ UINT32 ScopeOffset;
+ UINT32 SubsubtableLength = 0;
+ ACPI_DMTABLE_INFO *InfoTable, *TrailEntries, *DacdEntries;
+ UINT32 NumTrailers = 0;
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoErdt);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Subtables */
+ Subtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Table, Offset);
+ while (Offset < Table->Length)
+ {
+
+ /* Dump common header */
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Subtable->Length, AcpiDmTableInfoErdtHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Subtable->Length, AcpiDmTableInfoErdtRmdd);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Subtables of this RMDD table */
+
+ Suboffset = Offset + sizeof(ACPI_ERDT_RMDD);
+ Subsubtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Table, Suboffset);
+ while (Suboffset < Offset + Subtable->Length)
+ {
+ AcpiOsPrintf ("\n");
+
+ TrailEntries = NULL;
+ DacdEntries = NULL;
+ switch (Subsubtable->Type)
+ {
+ case ACPI_ERDT_TYPE_CACD:
+ InfoTable = AcpiDmTableInfoErdtCacd;
+ TrailEntries = AcpiDmTableInfoErdtCacdX2apic;
+ SubsubtableLength = sizeof(ACPI_ERDT_CACD);
+ break;
+
+ case ACPI_ERDT_TYPE_DACD:
+ InfoTable = AcpiDmTableInfoErdtDacd;
+ DacdEntries = AcpiDmTableInfoErdtDacdScope;
+ SubsubtableLength = sizeof(ACPI_ERDT_DACD);
+ break;
+
+ case ACPI_ERDT_TYPE_CMRC:
+ InfoTable = AcpiDmTableInfoErdtCmrc;
+ break;
+
+ case ACPI_ERDT_TYPE_MMRC:
+ InfoTable = AcpiDmTableInfoErdtMmrc;
+ TrailEntries = AcpiDmTableInfoErdtMmrcCorrFactor;
+ SubsubtableLength = sizeof(ACPI_ERDT_MMRC);
+ break;
+
+ case ACPI_ERDT_TYPE_MARC:
+ InfoTable = AcpiDmTableInfoErdtMarc;
+ break;
+
+ case ACPI_ERDT_TYPE_CARC:
+ InfoTable = AcpiDmTableInfoErdtCarc;
+ break;
+
+ case ACPI_ERDT_TYPE_CMRD:
+ InfoTable = AcpiDmTableInfoErdtCmrd;
+ break;
+
+ case ACPI_ERDT_TYPE_IBRD:
+ InfoTable = AcpiDmTableInfoErdtIbrd;
+ TrailEntries = AcpiDmTableInfoErdtIbrdCorrFactor;
+ SubsubtableLength = sizeof(ACPI_ERDT_IBRD);
+ break;
+
+ case ACPI_ERDT_TYPE_IBAD:
+ InfoTable = AcpiDmTableInfoErdtIbad;
+ break;
+
+ case ACPI_ERDT_TYPE_CARD:
+ InfoTable = AcpiDmTableInfoErdtCard;
+ break;
+
+ default:
+ AcpiOsPrintf ("\n**** Unknown RMDD subtable type 0x%X\n",
+ Subsubtable->Type);
+
+ /* Attempt to continue */
+
+ if (!Subsubtable->Length)
+ {
+ AcpiOsPrintf ("Invalid zero length subtable\n");
+ return;
+ }
+ goto NextSubsubtable;
+ }
+
+ /* Dump subtable header */
+
+ Status = AcpiDmDumpTable (Table->Length, Suboffset, Subsubtable,
+ Subsubtable->Length, AcpiDmTableInfoErdtHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Dump subtable body */
+
+ Status = AcpiDmDumpTable (Table->Length, Suboffset, Subsubtable,
+ Subsubtable->Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* CACD, MMRC, and IBRD subtables have simple flex array at end */
+
+ if (TrailEntries)
+ {
+ NumTrailers = 0;
+ while (NumTrailers < Subsubtable->Length - SubsubtableLength)
+ {
+
+ /* Dump one flex array element */
+
+ Status = AcpiDmDumpTable (Table->Length, Suboffset +
+ SubsubtableLength + NumTrailers,
+ ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Subsubtable,
+ SubsubtableLength + NumTrailers),
+ sizeof(UINT32), TrailEntries);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ NumTrailers += sizeof(UINT32);
+ }
+ }
+
+ /* DACD subtable has flex array of device agent structures */
+
+ if (DacdEntries) {
+ ScopeOffset = Suboffset + SubsubtableLength;
+ ScopeTable = ACPI_ADD_PTR (ACPI_ERDT_DACD_PATHS,
+ Subsubtable, SubsubtableLength);
+ while (ScopeOffset < Suboffset + Subsubtable->Length)
+ {
+ /* Dump one device agent structure */
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Table->Length, ScopeOffset,
+ ScopeTable, ScopeTable->Header.Length, DacdEntries);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Flex array of UINT8 for device path */
+
+ NumTrailers = 0;
+ while (NumTrailers < ScopeTable->Header.Length - sizeof(ACPI_ERDT_DACD_PATHS))
+ {
+ /* Dump one UINT8 of the device path */
+
+ Status = AcpiDmDumpTable (Table->Length, ScopeOffset +
+ sizeof(ACPI_ERDT_DACD_PATHS) + NumTrailers,
+ ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, ScopeTable,
+ sizeof(*ScopeTable) + NumTrailers),
+ sizeof(UINT32), AcpiDmTableInfoErdtDacdPath);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ NumTrailers++;
+ }
+
+ ScopeOffset += ScopeTable->Header.Length;
+ ScopeTable = ACPI_ADD_PTR (ACPI_ERDT_DACD_PATHS,
+ ScopeTable, ScopeTable->Header.Length);
+ }
+ }
+NextSubsubtable:
+ Suboffset += Subsubtable->Length;
+ Subsubtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Table, Suboffset);
+ }
+
+ Offset += Subtable->Length;
+ Subtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Subtable,
+ Subtable->Length);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpErst
*
* PARAMETERS: Table - A ERST table
diff --git a/sys/contrib/dev/acpica/common/dmtbdump2.c b/sys/contrib/dev/acpica/common/dmtbdump2.c
index 4aded63afdc3..822920d2ea94 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump2.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump2.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -1473,6 +1473,54 @@ AcpiDmDumpMpst (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpMrrm
+ *
+ * PARAMETERS: Table - A MRRM table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a MRRM
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpMrrm (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_MRRM_MEM_RANGE_ENTRY *Subtable;
+ UINT16 Offset = sizeof (ACPI_TABLE_MRRM);
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMrrm);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Subtables (all are same type) */
+
+ Subtable = ACPI_ADD_PTR (ACPI_MRRM_MEM_RANGE_ENTRY, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Subtable->Header.Length, AcpiDmTableInfoMrrm0);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ Offset += Subtable->Header.Length;
+ Subtable = ACPI_ADD_PTR (ACPI_MRRM_MEM_RANGE_ENTRY, Subtable,
+ Subtable->Header.Length);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpMsct
*
* PARAMETERS: Table - A MSCT table
@@ -2618,6 +2666,138 @@ AcpiDmDumpRhct (
}
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmDumpRimt
+ *
+ * PARAMETERS: Table - A RIMT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a RIMT.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpRimt (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_RIMT_PLATFORM_DEVICE *PlatNode;
+ ACPI_RIMT_PCIE_RC *PcieNode;
+ ACPI_RIMT_NODE *Subtable;
+ ACPI_STATUS Status;
+ UINT32 Length = Table->Length;
+ UINT16 SubtableOffset;
+ UINT32 NodeOffset;
+ UINT16 i;
+ UINT32 Offset = sizeof (ACPI_TABLE_RIMT);
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRimt);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Subtables */
+
+ while (Offset < Table->Length)
+ {
+ AcpiOsPrintf ("\n");
+
+ /* Common subtable header */
+
+ Subtable = ACPI_ADD_PTR (ACPI_RIMT_NODE, Table, Offset);
+ if (Subtable->Length < sizeof (ACPI_RIMT_NODE))
+ {
+ AcpiOsPrintf ("Invalid subtable length\n");
+ return;
+ }
+ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Subtable->Length, AcpiDmTableInfoRimtNodeHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ Length = sizeof (ACPI_RIMT_NODE);
+
+ if (Subtable->Length < Length)
+ {
+ AcpiOsPrintf ("Invalid subtable length\n");
+ return;
+ }
+ SubtableOffset = (UINT16) Length;
+
+ switch (Subtable->Type)
+ {
+ case ACPI_RIMT_NODE_TYPE_IOMMU:
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ ACPI_ADD_PTR (ACPI_RIMT_IOMMU, Subtable, SubtableOffset),
+ sizeof (ACPI_RIMT_IOMMU), AcpiDmTableInfoRimtIommu);
+
+ break;
+
+ case ACPI_RIMT_NODE_TYPE_PCIE_ROOT_COMPLEX:
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ ACPI_ADD_PTR (ACPI_RIMT_PCIE_RC, Subtable, SubtableOffset),
+ sizeof (ACPI_RIMT_PCIE_RC), AcpiDmTableInfoRimtPcieRc);
+
+ PcieNode = ACPI_ADD_PTR (ACPI_RIMT_PCIE_RC, Subtable, SubtableOffset);
+
+ /* Dump the ID mappings */
+ NodeOffset = PcieNode->IdMappingOffset;
+ for (i = 0; i < PcieNode->NumIdMappings; i++)
+ {
+ AcpiOsPrintf ("\n");
+ Length = sizeof (ACPI_RIMT_ID_MAPPING);
+ Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ ACPI_ADD_PTR (ACPI_RIMT_ID_MAPPING, Subtable, NodeOffset),
+ Length, AcpiDmTableInfoRimtIdMapping);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ NodeOffset += Length;
+ }
+ break;
+
+ case ACPI_RIMT_NODE_TYPE_PLAT_DEVICE:
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
+ ACPI_ADD_PTR (ACPI_RIMT_PLATFORM_DEVICE, Subtable, SubtableOffset),
+ sizeof (ACPI_RIMT_PLATFORM_DEVICE), AcpiDmTableInfoRimtPlatDev);
+ PlatNode = ACPI_ADD_PTR (ACPI_RIMT_PLATFORM_DEVICE, Subtable, SubtableOffset);
+
+ /* Dump the ID mappings */
+ NodeOffset = PlatNode->IdMappingOffset;
+ for (i = 0; i < PlatNode->NumIdMappings; i++)
+ {
+ AcpiOsPrintf ("\n");
+ Length = sizeof (ACPI_RIMT_ID_MAPPING);
+ Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
+ ACPI_ADD_PTR (ACPI_RIMT_ID_MAPPING, Subtable, NodeOffset),
+ Length, AcpiDmTableInfoRimtIdMapping);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ NodeOffset += Length;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /* Point to next subtable */
+
+ Offset += Subtable->Length;
+ }
+}
+
/*******************************************************************************
*
diff --git a/sys/contrib/dev/acpica/common/dmtbdump3.c b/sys/contrib/dev/acpica/common/dmtbdump3.c
index c162c4c004f7..41ae6a9887bf 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump3.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump3.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo.c b/sys/contrib/dev/acpica/common/dmtbinfo.c
index 634db685859f..937ad013f079 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo1.c b/sys/contrib/dev/acpica/common/dmtbinfo1.c
index 4cf3d3e21a76..49c0f6f2a31c 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo1.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo1.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -1011,7 +1011,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
{
{ACPI_DMT_DMAR_SCOPE, ACPI_DMARS_OFFSET (EntryType), "Device Scope Type", 0},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length", DT_LENGTH},
- {ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID", 0},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Bus), "PCI Bus Number", 0},
ACPI_DMT_TERMINATOR
@@ -1024,7 +1025,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[] =
{
{ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Flags), "Flags", 0},
- {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Size), "Size (decoded below)", 0},
+ {ACPI_DMT_FLAGS4_0, ACPI_DMAR0_FLAG_OFFSET (Size,0), "Size (pages, log2)", 0},
{ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Segment), "PCI Segment Number", 0},
{ACPI_DMT_UINT64, ACPI_DMAR0_OFFSET (Address), "Register Base Address", 0},
ACPI_DMT_TERMINATOR
@@ -1071,7 +1073,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] =
ACPI_DMT_TERMINATOR
};
-/* 5: Hardware Unit Definition */
+/* 5: SoC Integrated Address Translation Cache */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar5[] =
{
@@ -1081,6 +1083,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar5[] =
ACPI_DMT_TERMINATOR
};
+/* 6: SoC Integrated Device Property */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDmar6[] =
+{
+ {ACPI_DMT_UINT16, ACPI_DMAR6_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_DMAR6_OFFSET (Segment), "PCI Segment Number", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
/*******************************************************************************
*
* DRTM - Dynamic Root of Trust for Measurement table
@@ -1190,6 +1202,276 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[] =
/*******************************************************************************
*
+ * ERDT - Enhanced Resource Director Technology table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdt[] =
+{
+ {ACPI_DMT_UINT32, ACPI_ERDT_OFFSET (MaxClos), "Maximum supported CLOSID", 0},
+ {ACPI_DMT_BUF24, ACPI_ERDT_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * ERDT - Common Subtable Header
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtHdr[] =
+{
+ {ACPI_DMT_ERDT, ACPI_ERDT_HDR_OFFSET (Type), "Type", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_HDR_OFFSET (Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - ERDT Resource Management Domain Description subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtRmdd[] =
+{
+ {ACPI_DMT_UINT16, ACPI_ERDT_RMDD_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_ERDT_RMDD_FLAG_OFFSET (Flags,0), "L3 Domain", 0},
+ {ACPI_DMT_FLAG1, ACPI_ERDT_RMDD_FLAG_OFFSET (Flags,0), "I/O L3 Domain", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_RMDD_OFFSET (IO_l3_Slices), "I/O L3 Slices", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_RMDD_OFFSET (IO_l3_Sets), "I/O L3 Sets", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_RMDD_OFFSET (IO_l3_Ways), "I/O L3 Ways", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_RMDD_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_RMDD_OFFSET (DomainId), "Domain ID", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_RMDD_OFFSET (MaxRmid), "Maximum supported RMID", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_RMDD_OFFSET (CregBase), "Control Register Base Address", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_RMDD_OFFSET (CregSize), "Control Register Base Size", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - CACD CPU Agent Collection Description subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCacd[] =
+{
+ {ACPI_DMT_UINT16, ACPI_ERDT_CACD_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_CACD_OFFSET (DomainId), "Domain ID", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCacdX2apic[] =
+{
+ {ACPI_DMT_UINT32, 0, "X2ApicID", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - DACD Device Agent Collection Description subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtDacd[] =
+{
+ {ACPI_DMT_UINT16, ACPI_ERDT_DACD_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_DACD_OFFSET (DomainId), "Domain ID", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtDacdScope[] =
+{
+ {ACPI_DMT_UINT8, ACPI_ERDT_DACD_PATH_OFFSET (Header.Type), "PCIType", DT_OPTIONAL},
+ {ACPI_DMT_UINT8, ACPI_ERDT_DACD_PATH_OFFSET (Header.Length), "Length", DT_OPTIONAL},
+ {ACPI_DMT_UINT16, ACPI_ERDT_DACD_PATH_OFFSET (Segment), "Segment", DT_OPTIONAL},
+ {ACPI_DMT_UINT8, ACPI_ERDT_DACD_PATH_OFFSET (Reserved), "Reserved", DT_OPTIONAL},
+ {ACPI_DMT_UINT8, ACPI_ERDT_DACD_PATH_OFFSET (StartBus), "StartBus", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtDacdPath[] =
+{
+ {ACPI_DMT_UINT8, 0, "Path", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - Cache Monitoring Registers for CPU Agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCmrc[] =
+{
+ {ACPI_DMT_UINT32, ACPI_ERDT_CMRC_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_CMRC_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_CMRC_OFFSET (IndexFn), "Register Index Function", 0},
+ {ACPI_DMT_BUF11, ACPI_ERDT_CMRC_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_CMRC_OFFSET (CmtRegBase), "CMT Register Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_CMRC_OFFSET (CmtRegSize), "CMT Register Size", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_CMRC_OFFSET (ClumpSize), "Clump Size", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_CMRC_OFFSET (ClumpStride), "Clump Stride", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_CMRC_OFFSET (UpScale), "Upscale factor", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - Memory-bandwidth Monitoring Registers for CPU agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtMmrc[] =
+{
+ {ACPI_DMT_UINT32, ACPI_ERDT_MMRC_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_MMRC_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_MMRC_OFFSET (IndexFn), "Register Index Function", 0},
+ {ACPI_DMT_BUF11, ACPI_ERDT_MMRC_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_MMRC_OFFSET (RegBase), "MBM Register Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_MMRC_OFFSET (RegSize), "MBM Register Size", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_MMRC_OFFSET (CounterWidth), "MBM Counter Width", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_MMRC_OFFSET (UpScale), "Upscale factor", 0},
+ {ACPI_DMT_UINT56, ACPI_ERDT_MMRC_OFFSET (Reserved3), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_MMRC_OFFSET (CorrFactorListLen), "Corr Factor List Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtMmrcCorrFactor[] =
+{
+ {ACPI_DMT_UINT32, 0, "CorrFactor", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - Memory-bandwidth Allocation Registers for CPU agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtMarc[] =
+{
+ {ACPI_DMT_UINT16, ACPI_ERDT_MARC_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_MARC_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_MARC_OFFSET (IndexFn), "Register Index Function", 0},
+ {ACPI_DMT_UINT56, ACPI_ERDT_MARC_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_MARC_OFFSET (RegBaseOpt), "MBA Register Opt Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_MARC_OFFSET (RegBaseMin), "MBA Register Min Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_MARC_OFFSET (RegBaseMax), "MBA Register Max Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_MARC_OFFSET (MbaRegSize), "MBA Register Size", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_MARC_OFFSET (MbaCtrlRange), "MBA Control Range", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - Cache Allocation Registers for CPU Agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCarc[] =
+{
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - Cache Monitoring Registers for Device Agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCmrd[] =
+{
+ {ACPI_DMT_UINT32, ACPI_ERDT_CMRD_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_CMRD_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_CMRD_OFFSET (IndexFn), "Register Index Function", 0},
+ {ACPI_DMT_BUF11, ACPI_ERDT_CMRD_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_CMRD_OFFSET (RegBase), "CMRD Register Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_CMRD_OFFSET (RegSize), "CMRD Register Size", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_CMRD_OFFSET (CmtRegOff), "Register Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_CMRD_OFFSET (CmtClumpSize), "Clump Size", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_CMRD_OFFSET (UpScale), "Upscale factor", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - O Bandwidth Monitoring Registers for Device Agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtIbrd[] =
+{
+ {ACPI_DMT_UINT32, ACPI_ERDT_IBRD_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_IBRD_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_IBRD_OFFSET (IndexFn), "Register Index Function", 0},
+ {ACPI_DMT_BUF11, ACPI_ERDT_IBRD_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_IBRD_OFFSET (RegBase), "IBRD Register Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_IBRD_OFFSET (RegSize), "IBRD Register Size", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_IBRD_OFFSET (TotalBwOffset), "TotalBw Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_IBRD_OFFSET (IOMissBwOffset), "IO Miss Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_IBRD_OFFSET (TotalBwClump), "TotalBw Clump", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_IBRD_OFFSET (IOMissBwClump), "IO Miss Clump", 0},
+ {ACPI_DMT_UINT56, ACPI_ERDT_IBRD_OFFSET (Reserved3), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_IBRD_OFFSET (CounterWidth), "Counter Width", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_IBRD_OFFSET (UpScale), "Upscale factor", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_IBRD_OFFSET (CorrFactorListLen), "Corr Factor List Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtIbrdCorrFactor[] =
+{
+ {ACPI_DMT_UINT32, 0, "CorrFactor", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - O bandwidth Allocation Registers for Device Agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtIbad[] =
+{
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * RMDD - Cache Allocation Registers for Device Agents subtable
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCard[] =
+{
+ {ACPI_DMT_UINT32, ACPI_ERDT_CARD_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_CARD_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_CARD_OFFSET (ContentionMask), "ContentionMask", 0},
+ {ACPI_DMT_UINT8, ACPI_ERDT_CARD_OFFSET (IndexFn), "Register Index Function", 0},
+ {ACPI_DMT_UINT56, ACPI_ERDT_CARD_OFFSET (Reserved2), "Register Index Function", 0},
+ {ACPI_DMT_UINT64, ACPI_ERDT_CARD_OFFSET (RegBase), "CARD Register Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_ERDT_CARD_OFFSET (RegSize), "CARD Register Size", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_CARD_OFFSET (CatRegOffset), "CARD Register Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_ERDT_CARD_OFFSET (CatRegBlockSize), "CARD Register Block Size", 0},
+
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* ERST - Error Record Serialization table
*
******************************************************************************/
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo2.c b/sys/contrib/dev/acpica/common/dmtbinfo2.c
index 620124e3b47f..9ecf877fcfb0 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo2.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo2.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -1420,6 +1420,39 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[] =
/*******************************************************************************
*
+ * MRRM - Memory Range and Region Mapping Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoMrrm[] =
+{
+ {ACPI_DMT_UINT8, ACPI_MRRM_OFFSET (MaxMemRegion), "Max Memory Regions", 0},
+ {ACPI_DMT_UINT8, ACPI_MRRM_OFFSET (Flags), "Region Assignment Type", 0},
+ {ACPI_DMT_BUF26, ACPI_MRRM_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* MRRM Subtable */
+
+/* 0: Memory Range entry */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoMrrm0[] =
+{
+ {ACPI_DMT_UINT16, ACPI_MRRM0_OFFSET (Header.Type), "Memory Range", 0},
+ {ACPI_DMT_UINT16, ACPI_MRRM0_OFFSET (Header.Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT32, ACPI_MRRM0_OFFSET (Reserved0), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_MRRM0_OFFSET (AddrBase), "System Address Base", 0},
+ {ACPI_DMT_UINT64, ACPI_MRRM0_OFFSET (AddrLen), "System Address Length", 0},
+ {ACPI_DMT_UINT16, ACPI_MRRM0_OFFSET (RegionIdFlags), "Region Valid Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_MRRM0_OFFSET (LocalRegionId), "Static Local Region ID", 0},
+ {ACPI_DMT_UINT8, ACPI_MRRM0_OFFSET (RemoteRegionId), "Static Remote Region ID", 0},
+ {ACPI_DMT_UINT32, ACPI_MRRM0_OFFSET (Reserved1), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* MSCT - Maximum System Characteristics Table (ACPI 4.0)
*
******************************************************************************/
@@ -2209,6 +2242,97 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo2[] =
/*******************************************************************************
*
+ * RIMT - RISC-V IO Mapping Table
+ *
+ * https://github.com/riscv-non-isa/riscv-acpi-rimt
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimt[] =
+{
+ {ACPI_DMT_UINT32, ACPI_RIMT_OFFSET (NumNodes), "Number of RIMT Nodes", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMT_OFFSET (NodeOffset), "Offset to RIMT Node Array", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMT_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimtNodeHdr[] =
+{
+ {ACPI_DMT_UINT8, ACPI_RIMTH_OFFSET (Type), "Type", 0},
+ {ACPI_DMT_UINT8, ACPI_RIMTH_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTH_OFFSET (Length), "Length", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTH_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTH_OFFSET (Id), "ID", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 0: IOMMU Node type */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimtIommu[] =
+{
+ {ACPI_DMT_NAME8, ACPI_RIMTI_OFFSET (HardwareId), "Hardware ID", 0},
+ {ACPI_DMT_UINT64, ACPI_RIMTI_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMTI_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMTI_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTI_OFFSET (PcieSegmentNumber), "PCIe Segment number", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTI_OFFSET (PcieBdf), "PCIe B/D/F", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTI_OFFSET (NumInterruptWires), "Number of interrupt wires", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTI_OFFSET (InterruptWireOffset), "Interrupt wire array offset", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimtIommuWire[] =
+{
+ {ACPI_DMT_UINT32, ACPI_RIMTW_OFFSET (IrqNum), "Interrupt Number", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMTW_OFFSET (Flags), "Flags", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 1: PCIE Root Complex Node type */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimtPcieRc[] =
+{
+ {ACPI_DMT_UINT32, ACPI_RIMTP_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTP_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTP_OFFSET (PcieSegmentNumber), "PCIe Segment number", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTP_OFFSET (IdMappingOffset), "ID mapping array offset", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTP_OFFSET (NumIdMappings), "Number of ID mappings", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimtIdMapping[] =
+{
+ {ACPI_DMT_UINT32, ACPI_RIMTM_OFFSET (SourceIdBase), "Source ID Base", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMTM_OFFSET (NumIds), "Number of IDs", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMTM_OFFSET (DestIdBase), "Destination Device ID Base", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMTM_OFFSET (DestOffset), "Destination IOMMU Offset", 0},
+ {ACPI_DMT_UINT32, ACPI_RIMTM_OFFSET (Flags), "Flags", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 2: Platform Device Node type */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimtPlatDev[] =
+{
+ {ACPI_DMT_UINT16, ACPI_RIMTN_OFFSET (IdMappingOffset), "ID mapping array offset", 0},
+ {ACPI_DMT_UINT16, ACPI_RIMTN_OFFSET (NumIdMappings), "Number of ID mappings", 0},
+ {ACPI_DMT_STRING, ACPI_RIMTN_OFFSET (DeviceName[0]), "Device Object Name", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoRimtPlatDevPad[] =
+{
+ {ACPI_DMT_RAW_BUFFER, 0, "Padding", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* S3PT - S3 Performance Table
*
******************************************************************************/
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo3.c b/sys/contrib/dev/acpica/common/dmtbinfo3.c
index db4d46f2adfb..75b580e0d890 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo3.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo3.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/common/getopt.c b/sys/contrib/dev/acpica/common/getopt.c
index 9792304df75e..535e7a00bc8f 100644
--- a/sys/contrib/dev/acpica/common/getopt.c
+++ b/sys/contrib/dev/acpica/common/getopt.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslallocate.c b/sys/contrib/dev/acpica/compiler/aslallocate.c
index b3f6b5ce1da8..57e538b534e5 100644
--- a/sys/contrib/dev/acpica/compiler/aslallocate.c
+++ b/sys/contrib/dev/acpica/compiler/aslallocate.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c
index b72ac2deee66..17e2674817a9 100644
--- a/sys/contrib/dev/acpica/compiler/aslanalyze.c
+++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslascii.c b/sys/contrib/dev/acpica/compiler/aslascii.c
index fd52a1dfa4e1..1de3d763c765 100644
--- a/sys/contrib/dev/acpica/compiler/aslascii.c
+++ b/sys/contrib/dev/acpica/compiler/aslascii.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslbtypes.c b/sys/contrib/dev/acpica/compiler/aslbtypes.c
index 9f5db559c09b..539cd7977b4e 100644
--- a/sys/contrib/dev/acpica/compiler/aslbtypes.c
+++ b/sys/contrib/dev/acpica/compiler/aslbtypes.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslcache.c b/sys/contrib/dev/acpica/compiler/aslcache.c
index c9e1af585d15..9f917ff32945 100644
--- a/sys/contrib/dev/acpica/compiler/aslcache.c
+++ b/sys/contrib/dev/acpica/compiler/aslcache.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -210,7 +210,8 @@ UtLocalCacheCalloc (
}
}
- if ((AslGbl_StringCacheNext + Length) >= AslGbl_StringCacheLast)
+ if ((!AslGbl_StringCacheNext) ||
+ ((AslGbl_StringCacheNext + Length) >= AslGbl_StringCacheLast))
{
/* Allocate a new buffer */
diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c
index e7dbe7fdf8ee..684c59f802e9 100644
--- a/sys/contrib/dev/acpica/compiler/aslcodegen.c
+++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c
index b4e35cb5eae1..6e8ce6aae2c9 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompile.c
+++ b/sys/contrib/dev/acpica/compiler/aslcompile.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.h b/sys/contrib/dev/acpica/compiler/aslcompiler.h
index da7a2956ac9a..d131b949252a 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l
index d505633d45e3..5e94f9626018 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.l
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslcstyle.y b/sys/contrib/dev/acpica/compiler/aslcstyle.y
index c13d35a6fd48..59a1abea1bee 100644
--- a/sys/contrib/dev/acpica/compiler/aslcstyle.y
+++ b/sys/contrib/dev/acpica/compiler/aslcstyle.y
@@ -9,7 +9,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asldebug.c b/sys/contrib/dev/acpica/compiler/asldebug.c
index 49289e1d633e..18b68dea6de0 100644
--- a/sys/contrib/dev/acpica/compiler/asldebug.c
+++ b/sys/contrib/dev/acpica/compiler/asldebug.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asldefine.h b/sys/contrib/dev/acpica/compiler/asldefine.h
index ab08c5f4c1a5..89b6b8a69956 100644
--- a/sys/contrib/dev/acpica/compiler/asldefine.h
+++ b/sys/contrib/dev/acpica/compiler/asldefine.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c
index caaeda5a4d81..ff01bef7b4b7 100644
--- a/sys/contrib/dev/acpica/compiler/aslerror.c
+++ b/sys/contrib/dev/acpica/compiler/aslerror.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslexternal.c b/sys/contrib/dev/acpica/compiler/aslexternal.c
index 09e02a8ca55e..e2f082593c5d 100644
--- a/sys/contrib/dev/acpica/compiler/aslexternal.c
+++ b/sys/contrib/dev/acpica/compiler/aslexternal.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslfileio.c b/sys/contrib/dev/acpica/compiler/aslfileio.c
index 743f314e0b3c..4bf18404b1f5 100644
--- a/sys/contrib/dev/acpica/compiler/aslfileio.c
+++ b/sys/contrib/dev/acpica/compiler/aslfileio.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslfiles.c b/sys/contrib/dev/acpica/compiler/aslfiles.c
index 04a883d1df6d..0cad8eff47e8 100644
--- a/sys/contrib/dev/acpica/compiler/aslfiles.c
+++ b/sys/contrib/dev/acpica/compiler/aslfiles.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslfold.c b/sys/contrib/dev/acpica/compiler/aslfold.c
index 385a6831ed0f..89107297588b 100644
--- a/sys/contrib/dev/acpica/compiler/aslfold.c
+++ b/sys/contrib/dev/acpica/compiler/aslfold.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslglobal.h b/sys/contrib/dev/acpica/compiler/aslglobal.h
index 78527fd96940..c79758919f6f 100644
--- a/sys/contrib/dev/acpica/compiler/aslglobal.h
+++ b/sys/contrib/dev/acpica/compiler/aslglobal.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslhelp.c b/sys/contrib/dev/acpica/compiler/aslhelp.c
index 357ae8a23ff5..fcec07e67e70 100644
--- a/sys/contrib/dev/acpica/compiler/aslhelp.c
+++ b/sys/contrib/dev/acpica/compiler/aslhelp.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslhelpers.y b/sys/contrib/dev/acpica/compiler/aslhelpers.y
index 931f29870728..cb13d1ebcfe7 100644
--- a/sys/contrib/dev/acpica/compiler/aslhelpers.y
+++ b/sys/contrib/dev/acpica/compiler/aslhelpers.y
@@ -9,7 +9,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslhex.c b/sys/contrib/dev/acpica/compiler/aslhex.c
index 77b8e88cc206..927e50f24c1d 100644
--- a/sys/contrib/dev/acpica/compiler/aslhex.c
+++ b/sys/contrib/dev/acpica/compiler/aslhex.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslkeywords.y b/sys/contrib/dev/acpica/compiler/aslkeywords.y
index ab924c30630a..7cb670e61bfb 100644
--- a/sys/contrib/dev/acpica/compiler/aslkeywords.y
+++ b/sys/contrib/dev/acpica/compiler/aslkeywords.y
@@ -9,7 +9,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asllength.c b/sys/contrib/dev/acpica/compiler/asllength.c
index 73044c784950..136ca5823001 100644
--- a/sys/contrib/dev/acpica/compiler/asllength.c
+++ b/sys/contrib/dev/acpica/compiler/asllength.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asllisting.c b/sys/contrib/dev/acpica/compiler/asllisting.c
index 833926dbfc39..2a6341bb59e1 100644
--- a/sys/contrib/dev/acpica/compiler/asllisting.c
+++ b/sys/contrib/dev/acpica/compiler/asllisting.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asllistsup.c b/sys/contrib/dev/acpica/compiler/asllistsup.c
index 49f5feedc69c..3458e28062de 100644
--- a/sys/contrib/dev/acpica/compiler/asllistsup.c
+++ b/sys/contrib/dev/acpica/compiler/asllistsup.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslload.c b/sys/contrib/dev/acpica/compiler/aslload.c
index d27b1da848a3..c88fb13aba78 100644
--- a/sys/contrib/dev/acpica/compiler/aslload.c
+++ b/sys/contrib/dev/acpica/compiler/aslload.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asllookup.c b/sys/contrib/dev/acpica/compiler/asllookup.c
index f8be4fae04c2..3dfdb1fce21e 100644
--- a/sys/contrib/dev/acpica/compiler/asllookup.c
+++ b/sys/contrib/dev/acpica/compiler/asllookup.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmain.c b/sys/contrib/dev/acpica/compiler/aslmain.c
index cb5672fa0bb6..ff22dec73369 100644
--- a/sys/contrib/dev/acpica/compiler/aslmain.c
+++ b/sys/contrib/dev/acpica/compiler/aslmain.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmap.c b/sys/contrib/dev/acpica/compiler/aslmap.c
index 3b8d66fcb146..4711b884a57c 100644
--- a/sys/contrib/dev/acpica/compiler/aslmap.c
+++ b/sys/contrib/dev/acpica/compiler/aslmap.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmapenter.c b/sys/contrib/dev/acpica/compiler/aslmapenter.c
index dbd55b7eda69..81b57cb3f13d 100644
--- a/sys/contrib/dev/acpica/compiler/aslmapenter.c
+++ b/sys/contrib/dev/acpica/compiler/aslmapenter.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmapoutput.c b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
index 70b9a7103056..a009f64bc98d 100644
--- a/sys/contrib/dev/acpica/compiler/aslmapoutput.c
+++ b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmaputils.c b/sys/contrib/dev/acpica/compiler/aslmaputils.c
index 554537080900..f978e6a940b3 100644
--- a/sys/contrib/dev/acpica/compiler/aslmaputils.c
+++ b/sys/contrib/dev/acpica/compiler/aslmaputils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.c b/sys/contrib/dev/acpica/compiler/aslmessages.c
index c5146dbc622c..1e363236a149 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.c
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.h b/sys/contrib/dev/acpica/compiler/aslmessages.h
index b7e670dc1a55..dc0bbe10bd0d 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.h
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c
index a64049d3d88d..75096d38999e 100644
--- a/sys/contrib/dev/acpica/compiler/aslmethod.c
+++ b/sys/contrib/dev/acpica/compiler/aslmethod.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -546,9 +546,9 @@ MtMethodAnalysisWalkBegin (
else if (HidExists && AdrExists)
{
/*
- * According to the ACPI spec, "A device object must contain
- * either an _HID object or an _ADR object, but should not contain
- * both".
+ * "A device object must contain either an _HID object or
+ * an _ADR object, but must not contain both".
+ * (ACPI spec 6.3, Errata A Section 6.1, page 327)
*/
AslError (ASL_WARNING, ASL_MSG_MULTIPLE_TYPES, Op,
"Device object requires either a _HID or _ADR, but not both");
diff --git a/sys/contrib/dev/acpica/compiler/aslnamesp.c b/sys/contrib/dev/acpica/compiler/aslnamesp.c
index 748e0fb338fc..9388d7428db6 100644
--- a/sys/contrib/dev/acpica/compiler/aslnamesp.c
+++ b/sys/contrib/dev/acpica/compiler/aslnamesp.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asloffset.c b/sys/contrib/dev/acpica/compiler/asloffset.c
index cb67d2f53afd..d60c4c4ec367 100644
--- a/sys/contrib/dev/acpica/compiler/asloffset.c
+++ b/sys/contrib/dev/acpica/compiler/asloffset.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslopcodes.c b/sys/contrib/dev/acpica/compiler/aslopcodes.c
index 3ce0b3ba5ea0..8bef46b0d7ae 100644
--- a/sys/contrib/dev/acpica/compiler/aslopcodes.c
+++ b/sys/contrib/dev/acpica/compiler/aslopcodes.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asloperands.c b/sys/contrib/dev/acpica/compiler/asloperands.c
index cb065d1ece8b..1978b38b1cff 100644
--- a/sys/contrib/dev/acpica/compiler/asloperands.c
+++ b/sys/contrib/dev/acpica/compiler/asloperands.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslopt.c b/sys/contrib/dev/acpica/compiler/aslopt.c
index d02bdf229e37..02d46458d6ac 100644
--- a/sys/contrib/dev/acpica/compiler/aslopt.c
+++ b/sys/contrib/dev/acpica/compiler/aslopt.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asloptions.c b/sys/contrib/dev/acpica/compiler/asloptions.c
index 325080630601..a46ce96f5dbd 100644
--- a/sys/contrib/dev/acpica/compiler/asloptions.c
+++ b/sys/contrib/dev/acpica/compiler/asloptions.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslparseop.c b/sys/contrib/dev/acpica/compiler/aslparseop.c
index 5bb192291ea0..65e5b5b3ea59 100644
--- a/sys/contrib/dev/acpica/compiler/aslparseop.c
+++ b/sys/contrib/dev/acpica/compiler/aslparseop.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslparser.y b/sys/contrib/dev/acpica/compiler/aslparser.y
index be406bcefe8f..65a75af9763c 100644
--- a/sys/contrib/dev/acpica/compiler/aslparser.y
+++ b/sys/contrib/dev/acpica/compiler/aslparser.y
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslpld.c b/sys/contrib/dev/acpica/compiler/aslpld.c
index 5c5d8aaa2e6a..b1d9a05a7bdc 100644
--- a/sys/contrib/dev/acpica/compiler/aslpld.c
+++ b/sys/contrib/dev/acpica/compiler/aslpld.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c
index 92e37cca6a69..4125c51c6895 100644
--- a/sys/contrib/dev/acpica/compiler/aslpredef.c
+++ b/sys/contrib/dev/acpica/compiler/aslpredef.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslprepkg.c b/sys/contrib/dev/acpica/compiler/aslprepkg.c
index 2c1004de61c7..9d0e861a0ff9 100644
--- a/sys/contrib/dev/acpica/compiler/aslprepkg.c
+++ b/sys/contrib/dev/acpica/compiler/aslprepkg.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslprimaries.y b/sys/contrib/dev/acpica/compiler/aslprimaries.y
index b3f9b3dd160a..608009d30da3 100644
--- a/sys/contrib/dev/acpica/compiler/aslprimaries.y
+++ b/sys/contrib/dev/acpica/compiler/aslprimaries.y
@@ -11,7 +11,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslprintf.c b/sys/contrib/dev/acpica/compiler/aslprintf.c
index ebbdbe3fcba1..819a498f2b7d 100644
--- a/sys/contrib/dev/acpica/compiler/aslprintf.c
+++ b/sys/contrib/dev/acpica/compiler/aslprintf.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -294,7 +294,7 @@ OpcParsePrintf (
if (StringToProcess)
{
NewString = UtLocalCacheCalloc (StringLength + 1);
- strncpy (NewString, StartPosition, StringLength);
+ memcpy (NewString, StartPosition, StringLength);
NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = NewString;
@@ -383,7 +383,7 @@ OpcParsePrintf (
if (StringToProcess)
{
NewString = UtLocalCacheCalloc (StringLength + 1);
- strncpy (NewString, StartPosition, StringLength);
+ memcpy (NewString, StartPosition, StringLength);
NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = NewString;
diff --git a/sys/contrib/dev/acpica/compiler/aslprune.c b/sys/contrib/dev/acpica/compiler/aslprune.c
index 32a00b8ecd25..4fc3c063f1d6 100644
--- a/sys/contrib/dev/acpica/compiler/aslprune.c
+++ b/sys/contrib/dev/acpica/compiler/aslprune.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslresource.c b/sys/contrib/dev/acpica/compiler/aslresource.c
index c796c0df62d6..8250e84fd783 100644
--- a/sys/contrib/dev/acpica/compiler/aslresource.c
+++ b/sys/contrib/dev/acpica/compiler/aslresource.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslresources.y b/sys/contrib/dev/acpica/compiler/aslresources.y
index 16a70b900297..fd8a33d3c0d6 100644
--- a/sys/contrib/dev/acpica/compiler/aslresources.y
+++ b/sys/contrib/dev/acpica/compiler/aslresources.y
@@ -11,7 +11,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1.c b/sys/contrib/dev/acpica/compiler/aslrestype1.c
index 07198d42b6ed..3f873da0e703 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1i.c b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
index 56cd6ca5cc06..02f4958d6d51 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1i.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2.c b/sys/contrib/dev/acpica/compiler/aslrestype2.c
index 09b7fa3ea4b8..6fb613370691 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2d.c b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
index 2f2a6252b01e..3a7ca9189aff 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2d.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2e.c b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
index f06f1ae8ab63..4e6293617b94 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2e.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2q.c b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
index 72f1cad39b11..6ebe149a3c14 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2q.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2s.c b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
index 4535860099a7..096862290384 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2s.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2w.c b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
index f967c421e08e..cc8a31804977 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2w.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslrules.y b/sys/contrib/dev/acpica/compiler/aslrules.y
index 65a293b5201b..c96d4cc75db6 100644
--- a/sys/contrib/dev/acpica/compiler/aslrules.y
+++ b/sys/contrib/dev/acpica/compiler/aslrules.y
@@ -11,7 +11,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c
index bbbd5711a536..628a5c1ada2d 100644
--- a/sys/contrib/dev/acpica/compiler/aslstartup.c
+++ b/sys/contrib/dev/acpica/compiler/aslstartup.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslstubs.c b/sys/contrib/dev/acpica/compiler/aslstubs.c
index bd640eebfd21..50bda4b83fe1 100644
--- a/sys/contrib/dev/acpica/compiler/aslstubs.c
+++ b/sys/contrib/dev/acpica/compiler/aslstubs.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.l b/sys/contrib/dev/acpica/compiler/aslsupport.l
index 6fee71949ec3..74ac78d8c4ef 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.l
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.l
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.y b/sys/contrib/dev/acpica/compiler/aslsupport.y
index 1d033e304315..3bd09a55e704 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.y
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.y
@@ -9,7 +9,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asltokens.y b/sys/contrib/dev/acpica/compiler/asltokens.y
index b7a4c2d96144..50d6031e5ed0 100644
--- a/sys/contrib/dev/acpica/compiler/asltokens.y
+++ b/sys/contrib/dev/acpica/compiler/asltokens.y
@@ -9,7 +9,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asltransform.c b/sys/contrib/dev/acpica/compiler/asltransform.c
index ec5ccafcf76a..c58f771354f1 100644
--- a/sys/contrib/dev/acpica/compiler/asltransform.c
+++ b/sys/contrib/dev/acpica/compiler/asltransform.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asltree.c b/sys/contrib/dev/acpica/compiler/asltree.c
index b39a8ffe9b83..9237176c94b5 100644
--- a/sys/contrib/dev/acpica/compiler/asltree.c
+++ b/sys/contrib/dev/acpica/compiler/asltree.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.h b/sys/contrib/dev/acpica/compiler/asltypes.h
index c3ac17cbf6dd..50234d71f0a7 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.h
+++ b/sys/contrib/dev/acpica/compiler/asltypes.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.y b/sys/contrib/dev/acpica/compiler/asltypes.y
index 5e104d828334..2c2669559585 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.y
+++ b/sys/contrib/dev/acpica/compiler/asltypes.y
@@ -9,7 +9,7 @@ NoEcho('
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslutils.c b/sys/contrib/dev/acpica/compiler/aslutils.c
index 8abdb14bc2a1..267ad8b77e13 100644
--- a/sys/contrib/dev/acpica/compiler/aslutils.c
+++ b/sys/contrib/dev/acpica/compiler/aslutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/asluuid.c b/sys/contrib/dev/acpica/compiler/asluuid.c
index f6430fefed6a..712a06fda951 100644
--- a/sys/contrib/dev/acpica/compiler/asluuid.c
+++ b/sys/contrib/dev/acpica/compiler/asluuid.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslwalks.c b/sys/contrib/dev/acpica/compiler/aslwalks.c
index 7c03a6017e20..db2c9daa455e 100644
--- a/sys/contrib/dev/acpica/compiler/aslwalks.c
+++ b/sys/contrib/dev/acpica/compiler/aslwalks.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslxref.c b/sys/contrib/dev/acpica/compiler/aslxref.c
index eb45f14e591c..eb61b1d461cd 100644
--- a/sys/contrib/dev/acpica/compiler/aslxref.c
+++ b/sys/contrib/dev/acpica/compiler/aslxref.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/aslxrefout.c b/sys/contrib/dev/acpica/compiler/aslxrefout.c
index b64323ff14ab..67e26b3e69de 100644
--- a/sys/contrib/dev/acpica/compiler/aslxrefout.c
+++ b/sys/contrib/dev/acpica/compiler/aslxrefout.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/cvcompiler.c b/sys/contrib/dev/acpica/compiler/cvcompiler.c
index 8af385d8213c..e42dfa8066ac 100644
--- a/sys/contrib/dev/acpica/compiler/cvcompiler.c
+++ b/sys/contrib/dev/acpica/compiler/cvcompiler.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/cvdisasm.c b/sys/contrib/dev/acpica/compiler/cvdisasm.c
index 90caa3e001e0..ebc93a0bd194 100644
--- a/sys/contrib/dev/acpica/compiler/cvdisasm.c
+++ b/sys/contrib/dev/acpica/compiler/cvdisasm.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/cvparser.c b/sys/contrib/dev/acpica/compiler/cvparser.c
index 64ca1b0d2183..724daa0dea67 100644
--- a/sys/contrib/dev/acpica/compiler/cvparser.c
+++ b/sys/contrib/dev/acpica/compiler/cvparser.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtcompile.c b/sys/contrib/dev/acpica/compiler/dtcompile.c
index 57a8ccc747a8..873baf397e47 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompile.c
+++ b/sys/contrib/dev/acpica/compiler/dtcompile.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h
index b2d153b26e95..2a066936b41e 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -614,6 +614,10 @@ DtCompileEinj (
void **PFieldList);
ACPI_STATUS
+DtCompileErdt (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileErst (
void **PFieldList);
@@ -666,6 +670,10 @@ DtCompileMpst (
void **PFieldList);
ACPI_STATUS
+DtCompileMrrm (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileMsct (
void **PFieldList);
@@ -710,6 +718,10 @@ DtCompileRhct (
void **PFieldList);
ACPI_STATUS
+DtCompileRimt (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileRsdt (
void **PFieldList);
@@ -801,6 +813,7 @@ extern const unsigned char TemplateDmar[];
extern const unsigned char TemplateDrtm[];
extern const unsigned char TemplateEcdt[];
extern const unsigned char TemplateEinj[];
+extern const unsigned char TemplateErdt[];
extern const unsigned char TemplateErst[];
extern const unsigned char TemplateFadt[];
extern const unsigned char TemplateFpdt[];
@@ -816,6 +829,7 @@ extern const unsigned char TemplateMcfg[];
extern const unsigned char TemplateMchi[];
extern const unsigned char TemplateMpam[];
extern const unsigned char TemplateMpst[];
+extern const unsigned char TemplateMrrm[];
extern const unsigned char TemplateMsct[];
extern const unsigned char TemplateMsdm[];
extern const unsigned char TemplateNfit[];
@@ -829,6 +843,7 @@ extern const unsigned char TemplateRasf[];
extern const unsigned char TemplateRas2[];
extern const unsigned char TemplateRgrt[];
extern const unsigned char TemplateRhct[];
+extern const unsigned char TemplateRimt[];
extern const unsigned char TemplateRsdt[];
extern const unsigned char TemplateS3pt[];
extern const unsigned char TemplateSbst[];
diff --git a/sys/contrib/dev/acpica/compiler/dtcompilerparser.l b/sys/contrib/dev/acpica/compiler/dtcompilerparser.l
index cd5c77db6dcf..322ee225a60d 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompilerparser.l
+++ b/sys/contrib/dev/acpica/compiler/dtcompilerparser.l
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtcompilerparser.y b/sys/contrib/dev/acpica/compiler/dtcompilerparser.y
index d1f53cdf80de..f160434e0959 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompilerparser.y
+++ b/sys/contrib/dev/acpica/compiler/dtcompilerparser.y
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtexpress.c b/sys/contrib/dev/acpica/compiler/dtexpress.c
index 61a8efb24b05..65f10aac9f00 100644
--- a/sys/contrib/dev/acpica/compiler/dtexpress.c
+++ b/sys/contrib/dev/acpica/compiler/dtexpress.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtfield.c b/sys/contrib/dev/acpica/compiler/dtfield.c
index e25cfed6820c..ded7315aaa3f 100644
--- a/sys/contrib/dev/acpica/compiler/dtfield.c
+++ b/sys/contrib/dev/acpica/compiler/dtfield.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c
index 190704384a09..7bcf16b8f9d1 100644
--- a/sys/contrib/dev/acpica/compiler/dtio.c
+++ b/sys/contrib/dev/acpica/compiler/dtio.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -285,7 +285,7 @@ DtTrim (
ReturnString = UtLocalCacheCalloc (Length + 1);
if (strlen (Start))
{
- strncpy (ReturnString, Start, Length);
+ memcpy (ReturnString, Start, Length);
}
ReturnString[Length] = 0;
@@ -377,7 +377,7 @@ DtParseLine (
Length = ACPI_PTR_DIFF (End, Start);
TmpName = UtLocalCalloc (Length + 1);
- strncpy (TmpName, Start, Length);
+ memcpy (TmpName, Start, Length);
Name = DtTrim (TmpName);
ACPI_FREE (TmpName);
@@ -425,7 +425,7 @@ DtParseLine (
Length = ACPI_PTR_DIFF (End, Start);
TmpValue = UtLocalCalloc (Length + 1);
- strncpy (TmpValue, Start, Length);
+ memcpy (TmpValue, Start, Length);
Value = DtTrim (TmpValue);
ACPI_FREE (TmpValue);
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.l b/sys/contrib/dev/acpica/compiler/dtparser.l
index e47217d283c0..90fc39d8c66a 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.l
+++ b/sys/contrib/dev/acpica/compiler/dtparser.l
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.y b/sys/contrib/dev/acpica/compiler/dtparser.y
index 1f81ee1a009f..d6d584b2c6e9 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.y
+++ b/sys/contrib/dev/acpica/compiler/dtparser.y
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dtsubtable.c b/sys/contrib/dev/acpica/compiler/dtsubtable.c
index c34045a622ad..0c660b7ab8bb 100644
--- a/sys/contrib/dev/acpica/compiler/dtsubtable.c
+++ b/sys/contrib/dev/acpica/compiler/dtsubtable.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dttable.c b/sys/contrib/dev/acpica/compiler/dttable.c
index 6f1cf5ad0818..effcf6d65e1c 100644
--- a/sys/contrib/dev/acpica/compiler/dttable.c
+++ b/sys/contrib/dev/acpica/compiler/dttable.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dttable1.c b/sys/contrib/dev/acpica/compiler/dttable1.c
index 74cd2819b7cf..391bff98210d 100644
--- a/sys/contrib/dev/acpica/compiler/dttable1.c
+++ b/sys/contrib/dev/acpica/compiler/dttable1.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -1507,6 +1507,11 @@ DtCompileDmar (
InfoTable = AcpiDmTableInfoDmar5;
break;
+ case ACPI_DMAR_TYPE_SIDP:
+
+ InfoTable = AcpiDmTableInfoDmar6;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
@@ -1748,6 +1753,265 @@ DtCompileEinj (
/******************************************************************************
*
+ * FUNCTION: DtCompileErdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile ERST. Complex table with subtables and subsubtables.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileErdt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable, *RmddSubtable = NULL, *Subsubtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTBL_HDR_16 *ErdtHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_ERDT_MMRC *Mmrc;
+ ACPI_ERDT_IBRD *Ibrd;
+ UINT32 NumEntries;
+ BOOLEAN SeenRmdd = FALSE;
+ BOOLEAN SeenSubtable = FALSE;
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoErdt,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoErdtHdr,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ErdtHeader = ACPI_CAST_PTR (ACPI_SUBTBL_HDR_16, Subtable->Buffer);
+
+ /* RMDD tables at top level. All others are subtables of preceeding RMDD */
+ if (ErdtHeader->Type == ACPI_ERDT_TYPE_RMDD)
+ {
+ if (SeenRmdd && SeenSubtable)
+ DtPopSubtable ();
+ SeenRmdd = TRUE;
+ SeenSubtable = FALSE;
+ RmddSubtable = Subtable;
+ }
+ else
+ {
+ if (!SeenSubtable)
+ {
+ DtPushSubtable (RmddSubtable);
+ SeenSubtable = TRUE;
+ }
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ switch (ErdtHeader->Type)
+ {
+ case ACPI_ERDT_TYPE_RMDD:
+ InfoTable = AcpiDmTableInfoErdtRmdd;
+ break;
+
+ case ACPI_ERDT_TYPE_CACD:
+ InfoTable = AcpiDmTableInfoErdtCacd;
+ break;
+
+ case ACPI_ERDT_TYPE_DACD:
+ InfoTable = AcpiDmTableInfoErdtDacd;
+ break;
+
+ case ACPI_ERDT_TYPE_CMRC:
+ InfoTable = AcpiDmTableInfoErdtCmrc;
+ break;
+
+ case ACPI_ERDT_TYPE_MMRC:
+ InfoTable = AcpiDmTableInfoErdtMmrc;
+ break;
+
+ case ACPI_ERDT_TYPE_MARC:
+ InfoTable = AcpiDmTableInfoErdtMarc;
+ break;
+
+ case ACPI_ERDT_TYPE_CARC:
+ InfoTable = AcpiDmTableInfoErdtCarc;
+ break;
+
+ case ACPI_ERDT_TYPE_CMRD:
+ InfoTable = AcpiDmTableInfoErdtCmrd;
+ break;
+
+ case ACPI_ERDT_TYPE_IBRD:
+ InfoTable = AcpiDmTableInfoErdtIbrd;
+ break;
+
+ case ACPI_ERDT_TYPE_IBAD:
+ InfoTable = AcpiDmTableInfoErdtIbad;
+ break;
+
+ case ACPI_ERDT_TYPE_CARD:
+ InfoTable = AcpiDmTableInfoErdtCard;
+ break;
+
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ERDT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Some subtable types end with flex arrays */
+
+ switch (ErdtHeader->Type)
+ {
+ case ACPI_ERDT_TYPE_CACD:
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoErdtCacdX2apic, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ break;
+
+ case ACPI_ERDT_TYPE_DACD:
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoErdtDacdScope, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtPushSubtable (Subtable);
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoErdtDacdPath, &Subsubtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subsubtable)
+ {
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subsubtable);
+ }
+ DtPopSubtable ();
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ break;
+
+ case ACPI_ERDT_TYPE_MMRC:
+ Mmrc = ACPI_SUB_PTR (ACPI_ERDT_MMRC, Subtable->Buffer,
+ sizeof(ACPI_SUBTBL_HDR_16));
+ NumEntries = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoErdtMmrcCorrFactor, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ NumEntries++;
+ }
+ Mmrc->CorrFactorListLen = NumEntries;
+ break;
+
+ case ACPI_ERDT_TYPE_IBRD:
+ Ibrd = ACPI_SUB_PTR (ACPI_ERDT_IBRD, Subtable->Buffer,
+ sizeof(ACPI_SUBTBL_HDR_16));
+ NumEntries = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoErdtIbrdCorrFactor, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ NumEntries++;
+ }
+ Ibrd->CorrFactorListLen = NumEntries;
+ break;
+
+ default:
+ /* Already checked for valid subtable type above */
+
+ break;
+ }
+ DtPopSubtable ();
+ }
+
+ if (SeenSubtable)
+ {
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileErst
*
* PARAMETERS: List - Current field list pointer
@@ -3079,3 +3343,254 @@ DtCompileIvrs (
return (AE_OK);
}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileRimt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile RIMT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileRimt (
+ void **List)
+{
+ ACPI_RIMT_PLATFORM_DEVICE *PlatDevNode;
+ ACPI_RIMT_PCIE_RC *PcieRcNode;
+ ACPI_TABLE_RIMT *Rimt;
+ ACPI_RIMT_IOMMU *IommuNode;
+ ACPI_RIMT_NODE *RimtNode;
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ UINT32 NodeNumber;
+ UINT32 NodeLength;
+ UINT16 IdMappingNumber;
+ UINT32 i;
+
+
+ ParentTable = DtPeekSubtable ();
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRimt, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Using ACPI_SUB_PTR, We needn't define a separate structure. Care
+ * should be taken to avoid accessing ACPI_TABLE_HEADER fields.
+ */
+ Rimt = ACPI_SUB_PTR (ACPI_TABLE_RIMT, Subtable->Buffer,
+ sizeof (ACPI_TABLE_HEADER));
+
+ NodeNumber = 0;
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRimtNodeHdr, &Subtable);
+
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ RimtNode = ACPI_CAST_PTR (ACPI_RIMT_NODE, Subtable->Buffer);
+ NodeLength = ACPI_OFFSET (ACPI_RIMT_NODE, NodeData);
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+
+ switch (RimtNode->Type)
+ {
+ case ACPI_RIMT_NODE_TYPE_IOMMU:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRimtIommu,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ IommuNode = ACPI_CAST_PTR (ACPI_RIMT_IOMMU, Subtable->Buffer);
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+
+ for (i = 0; i < IommuNode->NumInterruptWires; i++)
+ {
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoRimtIommuWire,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ }
+ }
+
+ break;
+
+ case ACPI_RIMT_NODE_TYPE_PCIE_ROOT_COMPLEX:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRimtPcieRc,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ PcieRcNode = ACPI_CAST_PTR (ACPI_RIMT_PCIE_RC, Subtable->Buffer);
+ NodeLength += Subtable->Length;
+
+ /* Compile Array of ID mappings */
+
+ PcieRcNode->IdMappingOffset = (UINT16) NodeLength;
+ IdMappingNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoRimtIdMapping,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += sizeof (ACPI_RIMT_ID_MAPPING);
+ IdMappingNumber++;
+ }
+
+ PcieRcNode->NumIdMappings = IdMappingNumber;
+ if (!IdMappingNumber)
+ {
+ PcieRcNode->IdMappingOffset = 0;
+ }
+
+ break;
+
+ case ACPI_RIMT_NODE_TYPE_PLAT_DEVICE:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRimtPlatDev,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ PlatDevNode = ACPI_CAST_PTR (ACPI_RIMT_PLATFORM_DEVICE, Subtable->Buffer);
+ NodeLength += Subtable->Length;
+
+ /*
+ * Padding - Variable-length data
+ * Optionally allows the offset of the ID mappings to be used
+ * for filling this field.
+ */
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRimtPlatDevPad,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (Subtable)
+ {
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ }
+ else
+ {
+ if (NodeLength > PlatDevNode->IdMappingOffset)
+ {
+ return (AE_BAD_DATA);
+ }
+
+ if (NodeLength < PlatDevNode->IdMappingOffset)
+ {
+ Status = DtCompilePadding (
+ PlatDevNode->IdMappingOffset - (UINT16) NodeLength,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength = PlatDevNode->IdMappingOffset;
+ }
+ }
+
+ /* Compile Array of ID mappings */
+
+ PlatDevNode->IdMappingOffset = (UINT16) NodeLength;
+ IdMappingNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoRimtIdMapping,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += sizeof (ACPI_RIMT_ID_MAPPING);
+ IdMappingNumber++;
+ }
+
+ PlatDevNode->NumIdMappings = IdMappingNumber;
+ if (!IdMappingNumber)
+ {
+ PlatDevNode->IdMappingOffset = 0;
+ }
+
+ break;
+
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "RIMT");
+ return (AE_ERROR);
+ }
+
+ DtPopSubtable ();
+ ParentTable = DtPeekSubtable ();
+ NodeNumber++;
+ }
+
+ Rimt->NumNodes = NodeNumber;
+ return (AE_OK);
+}
diff --git a/sys/contrib/dev/acpica/compiler/dttable2.c b/sys/contrib/dev/acpica/compiler/dttable2.c
index 607f4b34644c..6203a382ad62 100644
--- a/sys/contrib/dev/acpica/compiler/dttable2.c
+++ b/sys/contrib/dev/acpica/compiler/dttable2.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -790,6 +790,57 @@ DtCompileMpst (
/******************************************************************************
*
+ * FUNCTION: DtCompileMrrm
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MRRM.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMrrm (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMrrm,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Subtables (all are same type) */
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMrrm0,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileMsct
*
* PARAMETERS: List - Current field list pointer
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.c b/sys/contrib/dev/acpica/compiler/dttemplate.c
index e17390384721..67b13bb82d1b 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.c
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h
index 9e1a8cca3229..0fdd90f73a23 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.h
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -583,8 +583,8 @@ const unsigned char TemplateDbgp[] =
const unsigned char TemplateDmar[] =
{
- 0x44,0x4D,0x41,0x52,0x9C,0x00,0x00,0x00, /* 00000000 "DMAR...." */
- 0x01,0xB8,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x44,0x4D,0x41,0x52,0xAC,0x00,0x00,0x00, /* 00000000 "DMAR...." */
+ 0x01,0x87,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x17,0x12,0x21,0x20,0x2F,0x01,0x00,0x00, /* 00000020 "..! /..." */
@@ -602,7 +602,9 @@ const unsigned char TemplateDmar[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x00,0x05,0x00,0x10,0x00, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 00000090 "........" */
- 0x00,0x00,0x00,0x02 /* 00000098 "...." */
+ 0x00,0x00,0x00,0x02,0x06,0x00,0x10,0x00, /* 00000098 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x00,0x02 /* 000000A8 "...." */
};
const unsigned char TemplateDrtm[] =
@@ -683,6 +685,211 @@ const unsigned char TemplateEinj[] =
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000128 "........" */
};
+const unsigned char TemplateErdt[] =
+{
+ 0x45,0x52,0x44,0x54,0x44,0x06,0x00,0x00, /* 00000000 "ERDTD..." */
+ 0x01,0x78,0x49,0x4e,0x54,0x45,0x4c,0x00, /* 00000008 ".xINTEL." */
+ 0x49,0x4e,0x54,0x45,0x4c,0x20,0x49,0x44, /* 00000010 "INTEL ID" */
+ 0x02,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
+ 0x28,0x06,0x23,0x20,0x0f,0x00,0x00,0x00, /* 00000020 "(.# ...." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0xd2,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0x00,0x0f,0x01,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0xfc,0xf7,0xff,0x1f,0x00,0x00, /* 00000058 "........" */
+ 0x01,0x00,0x01,0x00,0x18,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00, /* 00000068 "........" */
+ 0x00,0x00,0x08,0x00,0x00,0x00,0x0a,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x03,0x00,0x30,0x00,0x00,0x00, /* 00000078 "....0..." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x10,0xfb,0xf7,0xff,0x1f, /* 00000090 "........" */
+ 0x00,0x00,0x04,0x00,0x00,0x00,0x08,0x00, /* 00000098 "........" */
+ 0x00,0x02,0x00,0x10,0x01,0x00,0x00,0x00, /* 000000a0 "........" */
+ 0x00,0x00,0x04,0x00,0x38,0x00,0x00,0x00, /* 000000a8 "....8..." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 000000b0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */
+ 0x00,0x00,0x00,0x80,0xfc,0xf7,0xff,0x1f, /* 000000c0 "........" */
+ 0x00,0x00,0x10,0x00,0x00,0x00,0x18,0x00, /* 000000c8 "........" */
+ 0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */
+ 0x00,0x00,0x05,0x00,0x30,0x00,0x00,0x00, /* 000000e0 "....0..." */
+ 0x07,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000e8 "........" */
+ 0x00,0x00,0x00,0x10,0xfc,0xf7,0xff,0x1f, /* 000000f0 "........" */
+ 0x00,0x00,0x00,0x30,0xfc,0xf7,0xff,0x1f, /* 000000f8 "...0...." */
+ 0x00,0x00,0x00,0x20,0xfc,0xf7,0xff,0x1f, /* 00000100 "... ...." */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00, /* 00000108 "........" */
+ 0x00,0x00,0x00,0x00,0xd2,0x00,0x01,0x00, /* 00000110 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x0f,0x01, /* 00000120 "........" */
+ 0x00,0x00,0x00,0x00,0xec,0xf7,0xff,0x1f, /* 00000128 "........" */
+ 0x00,0x00,0x01,0x00,0x01,0x00,0x18,0x00, /* 00000130 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00, /* 00000138 "........" */
+ 0x02,0x01,0x00,0x00,0x08,0x01,0x00,0x00, /* 00000140 "........" */
+ 0x0a,0x01,0x00,0x00,0x03,0x00,0x30,0x00, /* 00000148 "......0." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x10,0xeb,0xf7, /* 00000160 "........" */
+ 0xff,0x1f,0x00,0x00,0x04,0x00,0x00,0x00, /* 00000168 "........" */
+ 0x08,0x00,0x00,0x02,0x00,0x10,0x01,0x00, /* 00000170 "........" */
+ 0x00,0x00,0x00,0x00,0x04,0x00,0x38,0x00, /* 00000178 "......8." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xec,0xf7, /* 00000190 "........" */
+ 0xff,0x1f,0x00,0x00,0x10,0x00,0x00,0x00, /* 00000198 "........" */
+ 0x18,0x00,0x10,0x01,0x00,0x00,0x00,0x00, /* 000001a0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001a8 "........" */
+ 0x00,0x00,0x00,0x00,0x05,0x00,0x30,0x00, /* 000001b0 "......0." */
+ 0x00,0x00,0x07,0x00,0x01,0x00,0x00,0x00, /* 000001b8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x10,0xec,0xf7, /* 000001c0 "........" */
+ 0xff,0x1f,0x00,0x00,0x00,0x30,0xec,0xf7, /* 000001c8 ".....0.." */
+ 0xff,0x1f,0x00,0x00,0x00,0x20,0xec,0xf7, /* 000001d0 "..... .." */
+ 0xff,0x1f,0x00,0x00,0x01,0x00,0x00,0x00, /* 000001d8 "........" */
+ 0x08,0x00,0x00,0x00,0x00,0x00,0xd2,0x00, /* 000001e0 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001e8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00, /* 000001f0 "........" */
+ 0x0f,0x01,0x00,0x00,0x00,0x00,0xdc,0xf7, /* 000001f8 "........" */
+ 0xff,0x1f,0x00,0x00,0x01,0x00,0x01,0x00, /* 00000200 "........" */
+ 0x18,0x00,0x00,0x00,0x02,0x00,0x00,0x02, /* 00000208 "........" */
+ 0x00,0x00,0x02,0x02,0x00,0x00,0x08,0x02, /* 00000210 "........" */
+ 0x00,0x00,0x0a,0x02,0x00,0x00,0x03,0x00, /* 00000218 "........" */
+ 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "0......." */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000228 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10, /* 00000230 "........" */
+ 0xdb,0xf7,0xff,0x1f,0x00,0x00,0x04,0x00, /* 00000238 "........" */
+ 0x00,0x00,0x08,0x00,0x00,0x02,0x00,0x10, /* 00000240 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x04,0x00, /* 00000248 "........" */
+ 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000250 "8......." */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000258 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, /* 00000260 "........" */
+ 0xdc,0xf7,0xff,0x1f,0x00,0x00,0x10,0x00, /* 00000268 "........" */
+ 0x00,0x00,0x18,0x00,0x10,0x01,0x00,0x00, /* 00000270 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000278 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00, /* 00000280 "........" */
+ 0x30,0x00,0x00,0x00,0x07,0x00,0x01,0x00, /* 00000288 "0......." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10, /* 00000290 "........" */
+ 0xdc,0xf7,0xff,0x1f,0x00,0x00,0x00,0x30, /* 00000298 ".......0" */
+ 0xdc,0xf7,0xff,0x1f,0x00,0x00,0x00,0x20, /* 000002a0 "....... " */
+ 0xdc,0xf7,0xff,0x1f,0x00,0x00,0x01,0x00, /* 000002a8 "........" */
+ 0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00, /* 000002b0 "........" */
+ 0xd2,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000002b8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000002c0 "........" */
+ 0x03,0x00,0x0f,0x01,0x00,0x00,0x00,0x00, /* 000002c8 "........" */
+ 0xcc,0xf7,0xff,0x1f,0x00,0x00,0x01,0x00, /* 000002d0 "........" */
+ 0x01,0x00,0x18,0x00,0x00,0x00,0x03,0x00, /* 000002d8 "........" */
+ 0x00,0x03,0x00,0x00,0x02,0x03,0x00,0x00, /* 000002e0 "........" */
+ 0x08,0x03,0x00,0x00,0x0a,0x03,0x00,0x00, /* 000002e8 "........" */
+ 0x03,0x00,0x30,0x00,0x00,0x00,0x00,0x00, /* 000002f0 "..0....." */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000002f8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000300 "........" */
+ 0x00,0x10,0xcb,0xf7,0xff,0x1f,0x00,0x00, /* 00000308 "........" */
+ 0x04,0x00,0x00,0x00,0x08,0x00,0x00,0x02, /* 00000310 "........" */
+ 0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000318 "........" */
+ 0x04,0x00,0x38,0x00,0x00,0x00,0x00,0x00, /* 00000320 "..8....." */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000328 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000330 "........" */
+ 0x00,0x80,0xcc,0xf7,0xff,0x1f,0x00,0x00, /* 00000338 "........" */
+ 0x10,0x00,0x00,0x00,0x18,0x00,0x10,0x01, /* 00000340 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000348 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000350 "........" */
+ 0x05,0x00,0x30,0x00,0x00,0x00,0x07,0x00, /* 00000358 "..0....." */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000360 "........" */
+ 0x00,0x10,0xcc,0xf7,0xff,0x1f,0x00,0x00, /* 00000368 "........" */
+ 0x00,0x30,0xcc,0xf7,0xff,0x1f,0x00,0x00, /* 00000370 ".0......" */
+ 0x00,0x20,0xcc,0xf7,0xff,0x1f,0x00,0x00, /* 00000378 ". ......" */
+ 0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00, /* 00000380 "........" */
+ 0x00,0x00,0x92,0x01,0x02,0x00,0x10,0x00, /* 00000388 "........" */
+ 0x0b,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000390 "........" */
+ 0x00,0x00,0x10,0x00,0x7f,0x00,0x00,0x00, /* 00000398 "........" */
+ 0x00,0xb0,0xb8,0xf6,0xff,0x1f,0x00,0x00, /* 000003a0 "........" */
+ 0x01,0x00,0x02,0x00,0xd8,0x00,0x00,0x00, /* 000003a8 "........" */
+ 0x10,0x00,0x01,0x08,0x00,0x00,0x00,0x00, /* 000003b0 "........" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x00, /* 000003b8 "........" */
+ 0x00,0x04,0x01,0x08,0x00,0x00,0x00,0x00, /* 000003c0 "........" */
+ 0x02,0x00,0x01,0x08,0x00,0x00,0x00,0x00, /* 000003c8 "........" */
+ 0x02,0x01,0x01,0x08,0x00,0x00,0x00,0x00, /* 000003d0 "........" */
+ 0x03,0x00,0x02,0x08,0x00,0x00,0x00,0x00, /* 000003d8 "........" */
+ 0x04,0x00,0x01,0x0a,0x00,0x00,0x00,0x00, /* 000003e0 "........" */
+ 0x04,0x00,0x00,0x00,0x02,0x08,0x00,0x00, /* 000003e8 "........" */
+ 0x00,0x00,0x05,0x00,0x01,0x0a,0x00,0x00, /* 000003f0 "........" */
+ 0x00,0x00,0x05,0x00,0x00,0x00,0x02,0x08, /* 000003f8 "........" */
+ 0x00,0x00,0x00,0x00,0x06,0x00,0x01,0x0a, /* 00000400 "........" */
+ 0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00, /* 00000408 "........" */
+ 0x02,0x08,0x00,0x00,0x00,0x00,0x07,0x00, /* 00000410 "........" */
+ 0x01,0x0a,0x00,0x00,0x00,0x00,0x07,0x00, /* 00000418 "........" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x00, /* 00000420 "........" */
+ 0x1f,0x00,0x01,0x08,0x00,0x00,0x00,0x00, /* 00000428 "........" */
+ 0x1f,0x04,0x01,0x08,0x00,0x00,0x00,0x00, /* 00000430 "........" */
+ 0x1f,0x05,0x01,0x08,0x00,0x00,0x00,0x0d, /* 00000438 "........" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x0e, /* 00000440 "........" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x0f, /* 00000448 "........" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x10, /* 00000450 "........" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x10, /* 00000458 "........" */
+ 0x00,0x04,0x01,0x08,0x00,0x00,0x00,0x60, /* 00000460 ".......`" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x60, /* 00000468 ".......`" */
+ 0x00,0x04,0x01,0x08,0x00,0x00,0x00,0xb0, /* 00000470 "........" */
+ 0x00,0x00,0x01,0x08,0x00,0x00,0x00,0xb0, /* 00000478 "........" */
+ 0x00,0x04,0x07,0x00,0x30,0x00,0x00,0x00, /* 00000480 "....0..." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000488 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000490 "........" */
+ 0x00,0x00,0x00,0xb0,0xb8,0xf6,0xff,0x1f, /* 00000498 "........" */
+ 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x05, /* 000004a0 "........" */
+ 0x08,0x00,0xf8,0xff,0x07,0x00,0x00,0x00, /* 000004a8 "........" */
+ 0x00,0x00,0x08,0x00,0x40,0x00,0x00,0x00, /* 000004b0 "....@..." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 000004b8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000004c0 "........" */
+ 0x00,0x00,0x00,0xb0,0xb8,0xf6,0xff,0x1f, /* 000004c8 "........" */
+ 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x03, /* 000004d0 "........" */
+ 0x00,0x04,0x08,0x00,0x08,0x00,0x00,0x00, /* 000004d8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x28,0xf8,0xff, /* 000004e0 ".....(.." */
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000004e8 "........" */
+ 0x00,0x00,0x0a,0x00,0x28,0x00,0x00,0x00, /* 000004f0 "....(..." */
+ 0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00, /* 000004f8 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000500 "........" */
+ 0x00,0x00,0x00,0xb0,0xb8,0xf6,0xff,0x1f, /* 00000508 "........" */
+ 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x02, /* 00000510 "........" */
+ 0x10,0x00,0x00,0x00,0x2a,0x01,0x02,0x00, /* 00000518 "....*..." */
+ 0x10,0x00,0x0b,0x08,0x00,0x00,0x00,0x00, /* 00000520 "........" */
+ 0x00,0x00,0x00,0x00,0x11,0x00,0x7f,0x00, /* 00000528 "........" */
+ 0x00,0x00,0x00,0xb0,0x38,0xf6,0xff,0x1f, /* 00000530 "....8..." */
+ 0x00,0x00,0x01,0x00,0x02,0x00,0x70,0x00, /* 00000538 "......p." */
+ 0x00,0x00,0x11,0x00,0x01,0x08,0x01,0x00, /* 00000540 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x08,0x01,0x00, /* 00000548 "........" */
+ 0x00,0x00,0x00,0x04,0x01,0x08,0x01,0x00, /* 00000550 "........" */
+ 0x00,0x00,0x02,0x00,0x01,0x08,0x01,0x00, /* 00000558 "........" */
+ 0x00,0x00,0x02,0x01,0x01,0x08,0x01,0x00, /* 00000560 "........" */
+ 0x00,0x0d,0x00,0x00,0x01,0x08,0x01,0x00, /* 00000568 "........" */
+ 0x00,0x0e,0x00,0x00,0x01,0x08,0x01,0x00, /* 00000570 "........" */
+ 0x00,0x0f,0x00,0x00,0x01,0x08,0x01,0x00, /* 00000578 "........" */
+ 0x00,0x10,0x00,0x00,0x01,0x08,0x01,0x00, /* 00000580 "........" */
+ 0x00,0x10,0x00,0x04,0x01,0x08,0x01,0x00, /* 00000588 "........" */
+ 0x00,0x60,0x00,0x00,0x01,0x08,0x01,0x00, /* 00000590 ".`......" */
+ 0x00,0x60,0x00,0x04,0x01,0x08,0x01,0x00, /* 00000598 ".`......" */
+ 0x00,0xb0,0x00,0x00,0x01,0x08,0x01,0x00, /* 000005a0 "........" */
+ 0x00,0xb0,0x00,0x04,0x07,0x00,0x30,0x00, /* 000005a8 "......0." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000005b0 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000005b8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0xb0,0x38,0xf6, /* 000005c0 "......8." */
+ 0xff,0x1f,0x00,0x00,0x10,0x00,0x00,0x00, /* 000005c8 "........" */
+ 0x00,0x05,0x08,0x00,0xf8,0xff,0x07,0x00, /* 000005d0 "........" */
+ 0x00,0x00,0x00,0x00,0x08,0x00,0x40,0x00, /* 000005d8 "......@." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000005e0 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000005e8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0xb0,0x38,0xf6, /* 000005f0 "......8." */
+ 0xff,0x1f,0x00,0x00,0x10,0x00,0x00,0x00, /* 000005f8 "........" */
+ 0x00,0x03,0x00,0x04,0x08,0x00,0x08,0x00, /* 00000600 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28, /* 00000608 ".......(" */
+ 0xf8,0xff,0x07,0x00,0x00,0x00,0x00,0x00, /* 00000610 "........" */
+ 0x00,0x00,0x00,0x00,0x0a,0x00,0x28,0x00, /* 00000618 "......(." */
+ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000620 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000628 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0xb0,0x38,0xf6, /* 00000630 "......8." */
+ 0xff,0x1f,0x00,0x00,0x10,0x00,0x00,0x00, /* 00000638 "........" */
+ 0x00,0x02,0x10,0x00, /* 00000640 "...." */
+};
+
const unsigned char TemplateErst[] =
{
0x45,0x52,0x53,0x54,0x30,0x02,0x00,0x00, /* 00000000 "ERST0..." */
@@ -1336,6 +1543,38 @@ const unsigned char TemplateMpst[] =
0x00,0x00,0x00,0x00,0x00,0x00 /* 000000B0 "......" */
};
+const unsigned char TemplateMrrm[] =
+{
+ 0x4D,0x52,0x52,0x4D,0xE0,0x00,0x00,0x00, /* 00000000 "MRRM...." */
+ 0x01,0x6F,0x49,0x4E,0x54,0x45,0x4C,0x00, /* 00000008 ".oINTEL." */
+ 0x49,0x4E,0x54,0x45,0x4C,0x20,0x49,0x44, /* 00000010 "INTEL ID" */
+ 0x02,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x28,0x06,0x23,0x20,0x02,0x00,0x00,0x00, /* 00000020 "(.# ...." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000040 ".. ....." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000060 ".. ....." */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000068 "........" */
+ 0x00,0x00,0x00,0x00,0xFF,0x03,0x00,0x00, /* 00000070 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000080 ".. ....." */
+ 0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00, /* 00000090 "........" */
+ 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 000000A0 ".. ....." */
+ 0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00, /* 000000A8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00, /* 000000B0 "........" */
+ 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 000000C0 ".. ....." */
+ 0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 000000C8 "........" */
+ 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* 000000D0 "........" */
+ 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00 /* 000000D8 "........" */
+};
+
const unsigned char TemplateMsct[] =
{
0x4D,0x53,0x43,0x54,0x90,0x00,0x00,0x00, /* 00000000 "MSCT...." */
@@ -1733,6 +1972,26 @@ const unsigned char TemplateRhct[] =
0x08,0x00,0x01,0x00,0x00,0x02 /* 00000090 "........" */
};
+const unsigned char TemplateRimt[] =
+{
+ 0x52,0x49,0x4d,0x54,0x80,0x00,0x00,0x00, /* 00000000 "RIMT...." */
+ 0x01,0xe1,0x42,0x4f,0x43,0x48,0x53,0x20, /* 00000008 ".pBOCHS " */
+ 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */
+ 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....INTL" */
+ 0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000020 "..$ ...." */
+ 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "0......." */
+ 0x00,0x01,0x28,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..(....." */
+ 0x52,0x53,0x43,0x56,0x30,0x30,0x30,0x34, /* 00000038 "RSCV0004" */
+ 0x00,0x00,0x01,0x03,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00, /* 00000050 "......(." */
+ 0x01,0x01,0x28,0x00,0x00,0x00,0x01,0x00, /* 00000058 "..(....." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x14,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "0......." */
+};
+
const unsigned char TemplateRsdp[] =
{
0x52,0x53,0x44,0x20,0x50,0x54,0x52,0x20, /* 00000000 "RSD PTR " */
diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c
index a6eeb0d51bce..f2463f74b8fc 100644
--- a/sys/contrib/dev/acpica/compiler/dtutils.c
+++ b/sys/contrib/dev/acpica/compiler/dtutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -436,9 +436,12 @@ DtGetFieldType (
case ACPI_DMT_RAW_BUFFER:
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF10:
+ case ACPI_DMT_BUF11:
case ACPI_DMT_BUF12:
case ACPI_DMT_BUF16:
case ACPI_DMT_BUF18:
+ case ACPI_DMT_BUF24:
+ case ACPI_DMT_BUF26:
case ACPI_DMT_BUF32:
case ACPI_DMT_BUF112:
case ACPI_DMT_BUF128:
@@ -614,6 +617,7 @@ DtGetFieldLength (
case ACPI_DMT_ASPT:
case ACPI_DMT_UINT16:
case ACPI_DMT_DMAR:
+ case ACPI_DMT_ERDT:
case ACPI_DMT_HEST:
case ACPI_DMT_HMAT:
case ACPI_DMT_NFIT:
@@ -732,6 +736,11 @@ DtGetFieldLength (
ByteLength = 10;
break;
+ case ACPI_DMT_BUF11:
+
+ ByteLength = 11;
+ break;
+
case ACPI_DMT_BUF12:
ByteLength = 12;
@@ -748,6 +757,16 @@ DtGetFieldLength (
ByteLength = 18;
break;
+ case ACPI_DMT_BUF24:
+
+ ByteLength = 24;
+ break;
+
+ case ACPI_DMT_BUF26:
+
+ ByteLength = 26;
+ break;
+
case ACPI_DMT_BUF32:
ByteLength = 32;
diff --git a/sys/contrib/dev/acpica/compiler/preprocess.h b/sys/contrib/dev/acpica/compiler/preprocess.h
index f34d24f2fa33..26a11f573402 100644
--- a/sys/contrib/dev/acpica/compiler/preprocess.h
+++ b/sys/contrib/dev/acpica/compiler/preprocess.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/prexpress.c b/sys/contrib/dev/acpica/compiler/prexpress.c
index 8396a09ae531..b2e7b785c5e9 100644
--- a/sys/contrib/dev/acpica/compiler/prexpress.c
+++ b/sys/contrib/dev/acpica/compiler/prexpress.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/prmacros.c b/sys/contrib/dev/acpica/compiler/prmacros.c
index 69f81895db0c..6d2acf52b980 100644
--- a/sys/contrib/dev/acpica/compiler/prmacros.c
+++ b/sys/contrib/dev/acpica/compiler/prmacros.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/prparser.l b/sys/contrib/dev/acpica/compiler/prparser.l
index 511357837dcb..fe0495121911 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.l
+++ b/sys/contrib/dev/acpica/compiler/prparser.l
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/prparser.y b/sys/contrib/dev/acpica/compiler/prparser.y
index 22d984f8e277..47edb20dcba8 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.y
+++ b/sys/contrib/dev/acpica/compiler/prparser.y
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/prscan.c b/sys/contrib/dev/acpica/compiler/prscan.c
index 3207cfe15455..81b703cfb081 100644
--- a/sys/contrib/dev/acpica/compiler/prscan.c
+++ b/sys/contrib/dev/acpica/compiler/prscan.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/compiler/prutils.c b/sys/contrib/dev/acpica/compiler/prutils.c
index 4601f57eeb26..902baed833c8 100644
--- a/sys/contrib/dev/acpica/compiler/prutils.c
+++ b/sys/contrib/dev/acpica/compiler/prutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -474,7 +474,7 @@ ResetHere2:
* at the correct offset value which is resetted every iteration
*/
JumpHere2:
- strncpy (AslGbl_MacroTokenReplaceBuffer, AslGbl_MacroTokenBuffer, Args->Offset[i]);
+ memcpy (AslGbl_MacroTokenReplaceBuffer, AslGbl_MacroTokenBuffer, Args->Offset[i]);
strcat (AslGbl_MacroTokenReplaceBuffer, Token);
strcat (AslGbl_MacroTokenReplaceBuffer, (AslGbl_MacroTokenBuffer +
(Args->Offset[i] + strlen (Args->Name))));
diff --git a/sys/contrib/dev/acpica/components/debugger/dbcmds.c b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
index 8d75760ad172..17ec5f342618 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbcmds.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbconvert.c b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
index 1088f2510efb..ed464e25bdbe 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbconvert.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbdisply.c b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
index 8b31c68ac444..c57a19d0dbdb 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbdisply.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbexec.c b/sys/contrib/dev/acpica/components/debugger/dbexec.c
index c57dd9665f2e..38c7496ebba1 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbexec.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbexec.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbfileio.c b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
index ea8b4b54507b..b006ac9d330b 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbfileio.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbhistry.c b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
index 15891888217a..45d44d11f315 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbhistry.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbinput.c b/sys/contrib/dev/acpica/components/debugger/dbinput.c
index e852f23bfab7..e38364448885 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbinput.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbinput.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbmethod.c b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
index 6a15d1c5a3e7..27e572d5ad17 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbmethod.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbnames.c b/sys/contrib/dev/acpica/components/debugger/dbnames.c
index 30e34b4154d6..fc6a26fe9cdc 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbnames.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbnames.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbobject.c b/sys/contrib/dev/acpica/components/debugger/dbobject.c
index 6095d1e429ca..0033b61ccab8 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbobject.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbobject.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbstats.c b/sys/contrib/dev/acpica/components/debugger/dbstats.c
index c43a08ea7f31..76295cadd337 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbstats.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbstats.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbtest.c b/sys/contrib/dev/acpica/components/debugger/dbtest.c
index 955b40d0dd89..4e0eb486c35b 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbtest.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbtest.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbutils.c b/sys/contrib/dev/acpica/components/debugger/dbutils.c
index 1b53754e16e7..4a39f9aca9e0 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbutils.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/debugger/dbxface.c b/sys/contrib/dev/acpica/components/debugger/dbxface.c
index 274b9239878d..2150abc16100 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbxface.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbxface.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
index 0179cc062f3f..d9e2273712e5 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c b/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
index db8a0f578859..ce3aa09084df 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
index 886892e5df32..3826f194d6fd 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmnames.c b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
index a4cebd8e7728..447618b5bc52 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmnames.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
index d55e4a6e7597..1cb1c81d74eb 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
index 39658ef8320c..e5a859ed47b7 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
index 71d4de1267ea..b50766bcdf20 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
index 778a3dd8ebd5..dd8cf4889885 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
index bd181f095566..1398462cecfc 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmutils.c b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
index 4d04c30f61af..41e26ee4b755 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmutils.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
index 74ebd90f0e56..36f6def2bba5 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
index 90abc4636a90..4a60cde8a15a 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
index c424a71d9deb..fcf10cf4e856 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
index fdcc4f24f86c..feb7f58a95de 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
index d34b1ff12ea0..baa6a2eef262 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
index 1afc00f28749..bcf2d4f112c8 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
index 666f31469090..8b6efc070b1b 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
index 47fa30d6f092..42e1aa505d02 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
index 217385838f79..cd9921e59261 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
index f6399be88d7f..23c7065bec5a 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c b/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
index da8c46996ae1..6365ab4b0f20 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
index 7fbeb244c407..04b65326b51c 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
index b0bcdea33cd1..1e287fae9977 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
index b0f24c299468..8c9969de14f7 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
index 23e73b4ba4d1..8ef7ff4090d1 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
index ca7ced3594cd..faf08bcfb399 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
index df3523049dfc..f353951961b2 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evevent.c b/sys/contrib/dev/acpica/components/events/evevent.c
index 48ce247caec1..da5e633e5909 100644
--- a/sys/contrib/dev/acpica/components/events/evevent.c
+++ b/sys/contrib/dev/acpica/components/events/evevent.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evglock.c b/sys/contrib/dev/acpica/components/events/evglock.c
index 5f6fff6de410..872e7b499a8f 100644
--- a/sys/contrib/dev/acpica/components/events/evglock.c
+++ b/sys/contrib/dev/acpica/components/events/evglock.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evgpe.c b/sys/contrib/dev/acpica/components/events/evgpe.c
index 5c672fb4fcdf..2ce159c46be2 100644
--- a/sys/contrib/dev/acpica/components/events/evgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evgpe.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evgpeblk.c b/sys/contrib/dev/acpica/components/events/evgpeblk.c
index d836c73af6cd..d30f31c641a1 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeblk.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeblk.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evgpeinit.c b/sys/contrib/dev/acpica/components/events/evgpeinit.c
index 12760644d58e..0ae8bb700369 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeinit.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeinit.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evgpeutil.c b/sys/contrib/dev/acpica/components/events/evgpeutil.c
index ef0219736800..0dc2fdf01b52 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeutil.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeutil.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evhandler.c b/sys/contrib/dev/acpica/components/events/evhandler.c
index 704d91500f2d..9c69d69b524a 100644
--- a/sys/contrib/dev/acpica/components/events/evhandler.c
+++ b/sys/contrib/dev/acpica/components/events/evhandler.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evmisc.c b/sys/contrib/dev/acpica/components/events/evmisc.c
index b4a39cb3953d..1b8688dd872d 100644
--- a/sys/contrib/dev/acpica/components/events/evmisc.c
+++ b/sys/contrib/dev/acpica/components/events/evmisc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evregion.c b/sys/contrib/dev/acpica/components/events/evregion.c
index 39f0b919c305..385ac1845da1 100644
--- a/sys/contrib/dev/acpica/components/events/evregion.c
+++ b/sys/contrib/dev/acpica/components/events/evregion.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evrgnini.c b/sys/contrib/dev/acpica/components/events/evrgnini.c
index 2194bc6a8194..1f16655195e1 100644
--- a/sys/contrib/dev/acpica/components/events/evrgnini.c
+++ b/sys/contrib/dev/acpica/components/events/evrgnini.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evsci.c b/sys/contrib/dev/acpica/components/events/evsci.c
index 23c19b352db0..cd1dc4da6317 100644
--- a/sys/contrib/dev/acpica/components/events/evsci.c
+++ b/sys/contrib/dev/acpica/components/events/evsci.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evxface.c b/sys/contrib/dev/acpica/components/events/evxface.c
index a1faa98f6bc4..54634c61e517 100644
--- a/sys/contrib/dev/acpica/components/events/evxface.c
+++ b/sys/contrib/dev/acpica/components/events/evxface.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evxfevnt.c b/sys/contrib/dev/acpica/components/events/evxfevnt.c
index 0bda80e97730..60837084e86f 100644
--- a/sys/contrib/dev/acpica/components/events/evxfevnt.c
+++ b/sys/contrib/dev/acpica/components/events/evxfevnt.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evxfgpe.c b/sys/contrib/dev/acpica/components/events/evxfgpe.c
index 34a72356314f..1ffcff259a2b 100644
--- a/sys/contrib/dev/acpica/components/events/evxfgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evxfgpe.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/events/evxfregn.c b/sys/contrib/dev/acpica/components/events/evxfregn.c
index 74b86cc28e3d..bbdf4352b415 100644
--- a/sys/contrib/dev/acpica/components/events/evxfregn.c
+++ b/sys/contrib/dev/acpica/components/events/evxfregn.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exconcat.c b/sys/contrib/dev/acpica/components/executer/exconcat.c
index e4ae1a3d6c63..060dbf946d87 100644
--- a/sys/contrib/dev/acpica/components/executer/exconcat.c
+++ b/sys/contrib/dev/acpica/components/executer/exconcat.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exconfig.c b/sys/contrib/dev/acpica/components/executer/exconfig.c
index 7113149f1957..6f3f8d24baca 100644
--- a/sys/contrib/dev/acpica/components/executer/exconfig.c
+++ b/sys/contrib/dev/acpica/components/executer/exconfig.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exconvrt.c b/sys/contrib/dev/acpica/components/executer/exconvrt.c
index 7a66d252410c..9c091864d7ef 100644
--- a/sys/contrib/dev/acpica/components/executer/exconvrt.c
+++ b/sys/contrib/dev/acpica/components/executer/exconvrt.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -388,7 +388,7 @@ AcpiExConvertToBuffer (
/* Copy the string to the buffer */
NewBuf = ReturnDesc->Buffer.Pointer;
- strncpy ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
+ memcpy ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
ObjDesc->String.Length);
break;
diff --git a/sys/contrib/dev/acpica/components/executer/excreate.c b/sys/contrib/dev/acpica/components/executer/excreate.c
index 459eb158ece3..75f1d631d110 100644
--- a/sys/contrib/dev/acpica/components/executer/excreate.c
+++ b/sys/contrib/dev/acpica/components/executer/excreate.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exdebug.c b/sys/contrib/dev/acpica/components/executer/exdebug.c
index 64274f2e2f0a..6a927eb26393 100644
--- a/sys/contrib/dev/acpica/components/executer/exdebug.c
+++ b/sys/contrib/dev/acpica/components/executer/exdebug.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exdump.c b/sys/contrib/dev/acpica/components/executer/exdump.c
index 8ea1517a83e8..581d183d919f 100644
--- a/sys/contrib/dev/acpica/components/executer/exdump.c
+++ b/sys/contrib/dev/acpica/components/executer/exdump.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exfield.c b/sys/contrib/dev/acpica/components/executer/exfield.c
index c033e0bec3b7..6c27e7dfcb36 100644
--- a/sys/contrib/dev/acpica/components/executer/exfield.c
+++ b/sys/contrib/dev/acpica/components/executer/exfield.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exfldio.c b/sys/contrib/dev/acpica/components/executer/exfldio.c
index 6c8a0f720dd7..b3d1d73c0960 100644
--- a/sys/contrib/dev/acpica/components/executer/exfldio.c
+++ b/sys/contrib/dev/acpica/components/executer/exfldio.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exmisc.c b/sys/contrib/dev/acpica/components/executer/exmisc.c
index 072ca8f74994..9b9b6b3005c2 100644
--- a/sys/contrib/dev/acpica/components/executer/exmisc.c
+++ b/sys/contrib/dev/acpica/components/executer/exmisc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exmutex.c b/sys/contrib/dev/acpica/components/executer/exmutex.c
index 7dd0b8a6191c..fe1220d6abfb 100644
--- a/sys/contrib/dev/acpica/components/executer/exmutex.c
+++ b/sys/contrib/dev/acpica/components/executer/exmutex.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exnames.c b/sys/contrib/dev/acpica/components/executer/exnames.c
index e03fe6e72225..105103f81f11 100644
--- a/sys/contrib/dev/acpica/components/executer/exnames.c
+++ b/sys/contrib/dev/acpica/components/executer/exnames.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg1.c b/sys/contrib/dev/acpica/components/executer/exoparg1.c
index c3ac3a2efc42..13af957693b4 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg1.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg1.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg2.c b/sys/contrib/dev/acpica/components/executer/exoparg2.c
index ae0d6c92bd7e..4bc3cf79e1eb 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg2.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg2.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg3.c b/sys/contrib/dev/acpica/components/executer/exoparg3.c
index 1c4cb43f0ef4..7c17e2868132 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg3.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg3.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg6.c b/sys/contrib/dev/acpica/components/executer/exoparg6.c
index 5481b7f02158..a9092ba2e4e2 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg6.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg6.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exprep.c b/sys/contrib/dev/acpica/components/executer/exprep.c
index 61bbe077c958..dc04b77b7ea5 100644
--- a/sys/contrib/dev/acpica/components/executer/exprep.c
+++ b/sys/contrib/dev/acpica/components/executer/exprep.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exregion.c b/sys/contrib/dev/acpica/components/executer/exregion.c
index 91bba1444d2f..4e9f535ef9ac 100644
--- a/sys/contrib/dev/acpica/components/executer/exregion.c
+++ b/sys/contrib/dev/acpica/components/executer/exregion.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exresnte.c b/sys/contrib/dev/acpica/components/executer/exresnte.c
index ba041f5d456e..0c66f0b4d4f8 100644
--- a/sys/contrib/dev/acpica/components/executer/exresnte.c
+++ b/sys/contrib/dev/acpica/components/executer/exresnte.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exresolv.c b/sys/contrib/dev/acpica/components/executer/exresolv.c
index 7b965858923a..81d934418983 100644
--- a/sys/contrib/dev/acpica/components/executer/exresolv.c
+++ b/sys/contrib/dev/acpica/components/executer/exresolv.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exresop.c b/sys/contrib/dev/acpica/components/executer/exresop.c
index 623314a41718..0a89bc78d3e3 100644
--- a/sys/contrib/dev/acpica/components/executer/exresop.c
+++ b/sys/contrib/dev/acpica/components/executer/exresop.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exserial.c b/sys/contrib/dev/acpica/components/executer/exserial.c
index 0c0aa7067fa7..6d17c29569e0 100644
--- a/sys/contrib/dev/acpica/components/executer/exserial.c
+++ b/sys/contrib/dev/acpica/components/executer/exserial.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -359,6 +359,12 @@ AcpiExReadSerialBus (
Function = ACPI_READ;
break;
+ case ACPI_ADR_SPACE_FIXED_HARDWARE:
+
+ BufferLength = ACPI_FFH_INPUT_BUFFER_SIZE;
+ Function = ACPI_READ;
+ break;
+
default:
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
diff --git a/sys/contrib/dev/acpica/components/executer/exstore.c b/sys/contrib/dev/acpica/components/executer/exstore.c
index c22fe7bc9584..ebe767abd637 100644
--- a/sys/contrib/dev/acpica/components/executer/exstore.c
+++ b/sys/contrib/dev/acpica/components/executer/exstore.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exstoren.c b/sys/contrib/dev/acpica/components/executer/exstoren.c
index 009029f5264c..ed9fa9a7f13b 100644
--- a/sys/contrib/dev/acpica/components/executer/exstoren.c
+++ b/sys/contrib/dev/acpica/components/executer/exstoren.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exstorob.c b/sys/contrib/dev/acpica/components/executer/exstorob.c
index 887de9c54a39..e9ddabd6c25a 100644
--- a/sys/contrib/dev/acpica/components/executer/exstorob.c
+++ b/sys/contrib/dev/acpica/components/executer/exstorob.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exsystem.c b/sys/contrib/dev/acpica/components/executer/exsystem.c
index 019149b9ffe9..f91d8d04b3ba 100644
--- a/sys/contrib/dev/acpica/components/executer/exsystem.c
+++ b/sys/contrib/dev/acpica/components/executer/exsystem.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/extrace.c b/sys/contrib/dev/acpica/components/executer/extrace.c
index fab1680ebec7..0eceb0ffccb1 100644
--- a/sys/contrib/dev/acpica/components/executer/extrace.c
+++ b/sys/contrib/dev/acpica/components/executer/extrace.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/executer/exutils.c b/sys/contrib/dev/acpica/components/executer/exutils.c
index 6bf26b456611..995edbc5990e 100644
--- a/sys/contrib/dev/acpica/components/executer/exutils.c
+++ b/sys/contrib/dev/acpica/components/executer/exutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwacpi.c b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
index 7be9d2b8511a..74cfecfcc2a2 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwacpi.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwesleep.c b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
index aa6722969824..329d8a20b4b7 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwesleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwgpe.c b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
index e4df7d3186c2..681ca9a1b9de 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwgpe.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwpci.c b/sys/contrib/dev/acpica/components/hardware/hwpci.c
index 521aee92367f..a9fc5cba2fff 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwpci.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwpci.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwregs.c b/sys/contrib/dev/acpica/components/hardware/hwregs.c
index 872aec8516fa..d0f47b874ead 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwregs.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwregs.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwsleep.c b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
index 62cdcb226cd0..210f4ea62dee 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwtimer.c b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
index 250901621971..9a9602e04232 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwtimer.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwvalid.c b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
index b6a448677bcf..5c4df25d2c38 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwvalid.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxface.c b/sys/contrib/dev/acpica/components/hardware/hwxface.c
index d10d600b945d..5f645617cbce 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxface.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxface.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
index f4db0e44f14b..1d79e908cf08 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsaccess.c b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
index cd2d0e7f38b4..35d30ded0a60 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsaccess.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsalloc.c b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
index 3b47ffe0b5f6..69d1d7fa053a 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsalloc.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsarguments.c b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
index ae4bf55bbe6d..8916484053b9 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsarguments.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsconvert.c b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
index 63d5906d50cc..ad4890b591a3 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsconvert.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdump.c b/sys/contrib/dev/acpica/components/namespace/nsdump.c
index 00890089e7aa..bf4aa1455075 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdump.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdump.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
index 352353a3cf24..dc370a6e3018 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nseval.c b/sys/contrib/dev/acpica/components/namespace/nseval.c
index 2bff1c1bdfa3..765b270ad2a1 100644
--- a/sys/contrib/dev/acpica/components/namespace/nseval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nseval.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsinit.c b/sys/contrib/dev/acpica/components/namespace/nsinit.c
index 8af2a17d6797..ed37aee82502 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsinit.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsinit.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsload.c b/sys/contrib/dev/acpica/components/namespace/nsload.c
index c4439519560a..bbd36a8a29a3 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsload.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsload.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsnames.c b/sys/contrib/dev/acpica/components/namespace/nsnames.c
index a9d59b25847d..a5aa1139792d 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsnames.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsnames.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -368,7 +368,7 @@ AcpiNsBuildNormalizedPath (
BOOLEAN NoTrailing)
{
UINT32 Length = 0, i;
- char Name[ACPI_NAMESEG_SIZE];
+ char Name[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
BOOLEAN DoNoTrailing;
char c, *Left, *Right;
ACPI_NAMESPACE_NODE *NextNode;
diff --git a/sys/contrib/dev/acpica/components/namespace/nsobject.c b/sys/contrib/dev/acpica/components/namespace/nsobject.c
index 9319bfb21c92..fd6f0a524699 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsobject.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsobject.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsparse.c b/sys/contrib/dev/acpica/components/namespace/nsparse.c
index 10145a94f95a..c5d35bac831c 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsparse.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsparse.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nspredef.c b/sys/contrib/dev/acpica/components/namespace/nspredef.c
index 873c8d40cdeb..5bb5d5bf67ca 100644
--- a/sys/contrib/dev/acpica/components/namespace/nspredef.c
+++ b/sys/contrib/dev/acpica/components/namespace/nspredef.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
index 96e29ac16e09..6fced55328bf 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair.c b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
index 6795c0b98c0c..8d0e86932e1d 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
index b5b029c5b745..0dddebda980b 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -169,7 +169,7 @@ ACPI_STATUS (*ACPI_REPAIR_FUNCTION) (
typedef struct acpi_repair_info
{
- char Name[ACPI_NAMESEG_SIZE];
+ char Name[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
ACPI_REPAIR_FUNCTION RepairFunction;
} ACPI_REPAIR_INFO;
diff --git a/sys/contrib/dev/acpica/components/namespace/nssearch.c b/sys/contrib/dev/acpica/components/namespace/nssearch.c
index a744d9e94c76..d956358e8e35 100644
--- a/sys/contrib/dev/acpica/components/namespace/nssearch.c
+++ b/sys/contrib/dev/acpica/components/namespace/nssearch.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsutils.c b/sys/contrib/dev/acpica/components/namespace/nsutils.c
index 199561cbe7e1..bf400ed2370d 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsutils.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsutils.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nswalk.c b/sys/contrib/dev/acpica/components/namespace/nswalk.c
index 5b8a15155287..f3c37d7ac231 100644
--- a/sys/contrib/dev/acpica/components/namespace/nswalk.c
+++ b/sys/contrib/dev/acpica/components/namespace/nswalk.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
index 3848ff3a4a9c..f6a1ead7ddd5 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfname.c b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
index ecb1cd732bda..706bb36a4f84 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfname.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
index f7519f580d86..ea0654285a90 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psargs.c b/sys/contrib/dev/acpica/components/parser/psargs.c
index b42154e4958d..d9110c09fcb5 100644
--- a/sys/contrib/dev/acpica/components/parser/psargs.c
+++ b/sys/contrib/dev/acpica/components/parser/psargs.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c
index 85f3dce979a1..f4cac83e6069 100644
--- a/sys/contrib/dev/acpica/components/parser/psloop.c
+++ b/sys/contrib/dev/acpica/components/parser/psloop.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psobject.c b/sys/contrib/dev/acpica/components/parser/psobject.c
index 22a36bc6c952..5457d9d0be7d 100644
--- a/sys/contrib/dev/acpica/components/parser/psobject.c
+++ b/sys/contrib/dev/acpica/components/parser/psobject.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psopcode.c b/sys/contrib/dev/acpica/components/parser/psopcode.c
index a12314ae2cfa..a317fab3005e 100644
--- a/sys/contrib/dev/acpica/components/parser/psopcode.c
+++ b/sys/contrib/dev/acpica/components/parser/psopcode.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psopinfo.c b/sys/contrib/dev/acpica/components/parser/psopinfo.c
index f9fd04942574..21c2b831ef24 100644
--- a/sys/contrib/dev/acpica/components/parser/psopinfo.c
+++ b/sys/contrib/dev/acpica/components/parser/psopinfo.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c
index 7300cc65c14c..f294033a0039 100644
--- a/sys/contrib/dev/acpica/components/parser/psparse.c
+++ b/sys/contrib/dev/acpica/components/parser/psparse.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psscope.c b/sys/contrib/dev/acpica/components/parser/psscope.c
index d9e81a28aa90..4f9f496f5018 100644
--- a/sys/contrib/dev/acpica/components/parser/psscope.c
+++ b/sys/contrib/dev/acpica/components/parser/psscope.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/pstree.c b/sys/contrib/dev/acpica/components/parser/pstree.c
index d01853851982..b561ba4b0721 100644
--- a/sys/contrib/dev/acpica/components/parser/pstree.c
+++ b/sys/contrib/dev/acpica/components/parser/pstree.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psutils.c b/sys/contrib/dev/acpica/components/parser/psutils.c
index 6ae4863fa271..3c647940e287 100644
--- a/sys/contrib/dev/acpica/components/parser/psutils.c
+++ b/sys/contrib/dev/acpica/components/parser/psutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/pswalk.c b/sys/contrib/dev/acpica/components/parser/pswalk.c
index 8590492b43b8..a0941d44cc03 100644
--- a/sys/contrib/dev/acpica/components/parser/pswalk.c
+++ b/sys/contrib/dev/acpica/components/parser/pswalk.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/parser/psxface.c b/sys/contrib/dev/acpica/components/parser/psxface.c
index 7928e27b48e6..08c1c2bb4f0d 100644
--- a/sys/contrib/dev/acpica/components/parser/psxface.c
+++ b/sys/contrib/dev/acpica/components/parser/psxface.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsaddr.c b/sys/contrib/dev/acpica/components/resources/rsaddr.c
index 409754e6f0e2..9074c6dbaa35 100644
--- a/sys/contrib/dev/acpica/components/resources/rsaddr.c
+++ b/sys/contrib/dev/acpica/components/resources/rsaddr.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -431,18 +431,13 @@ AcpiRsGetAddressCommon (
ACPI_RESOURCE *Resource,
AML_RESOURCE *Aml)
{
-
- /* Avoid undefined behavior: member access within misaligned address */
-
- AML_RESOURCE_ADDRESS Address;
- memcpy(&Address, Aml, sizeof(Address));
ACPI_FUNCTION_ENTRY();
/* Validate the Resource Type */
- if ((Address.ResourceType > 2) &&
- (Address.ResourceType < 0xC0) &&
- (Address.ResourceType != 0x0A))
+ if ((Aml->Address.ResourceType > 2) &&
+ (Aml->Address.ResourceType < 0xC0) &&
+ (Aml->Address.ResourceType != 0x0A))
{
return (FALSE);
}
@@ -469,7 +464,7 @@ AcpiRsGetAddressCommon (
/* Generic resource type, just grab the TypeSpecific byte */
Resource->Data.Address.Info.TypeSpecific =
- Address.SpecificFlags;
+ Aml->Address.SpecificFlags;
}
return (TRUE);
@@ -497,7 +492,6 @@ AcpiRsSetAddressCommon (
{
ACPI_FUNCTION_ENTRY ();
-
/* Set the Resource Type and General Flags */
(void) AcpiRsConvertResourceToAml (
diff --git a/sys/contrib/dev/acpica/components/resources/rscalc.c b/sys/contrib/dev/acpica/components/resources/rscalc.c
index db04f9dd7344..fc7575c2ddfb 100644
--- a/sys/contrib/dev/acpica/components/resources/rscalc.c
+++ b/sys/contrib/dev/acpica/components/resources/rscalc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -741,15 +741,11 @@ AcpiRsGetListLength (
break;
case ACPI_RESOURCE_NAME_SERIAL_BUS: {
- /* Avoid undefined behavior: member access within misaligned address */
-
- AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
- memcpy(&CommonSerialBus, AmlResource, sizeof(CommonSerialBus));
MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[
- CommonSerialBus.Type];
+ AmlResource->CommonSerialBus.Type];
ExtraStructBytes +=
- CommonSerialBus.ResourceLength -
+ AmlResource->CommonSerialBus.ResourceLength -
MinimumAmlResourceLength;
break;
}
@@ -821,13 +817,8 @@ AcpiRsGetListLength (
if (AcpiUtGetResourceType (AmlBuffer) ==
ACPI_RESOURCE_NAME_SERIAL_BUS)
{
- /* Avoid undefined behavior: member access within misaligned address */
-
- AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
- memcpy(&CommonSerialBus, AmlResource, sizeof(CommonSerialBus));
-
BufferSize = AcpiGbl_ResourceStructSerialBusSizes[
- CommonSerialBus.Type] + ExtraStructBytes;
+ AmlResource->CommonSerialBus.Type] + ExtraStructBytes;
}
else
{
diff --git a/sys/contrib/dev/acpica/components/resources/rscreate.c b/sys/contrib/dev/acpica/components/resources/rscreate.c
index b7a33a30bbe9..b930ced8396f 100644
--- a/sys/contrib/dev/acpica/components/resources/rscreate.c
+++ b/sys/contrib/dev/acpica/components/resources/rscreate.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsdump.c b/sys/contrib/dev/acpica/components/resources/rsdump.c
index d3178b2bcb4a..2f3e996af9af 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdump.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdump.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
index 8202b9a17550..293eeb596928 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsinfo.c b/sys/contrib/dev/acpica/components/resources/rsinfo.c
index 669cff882099..7a1bb07abb94 100644
--- a/sys/contrib/dev/acpica/components/resources/rsinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsinfo.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsio.c b/sys/contrib/dev/acpica/components/resources/rsio.c
index 387ef9c88ec1..46d9b2f8aa4b 100644
--- a/sys/contrib/dev/acpica/components/resources/rsio.c
+++ b/sys/contrib/dev/acpica/components/resources/rsio.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsirq.c b/sys/contrib/dev/acpica/components/resources/rsirq.c
index 6e0fcc98537c..80482eb097d6 100644
--- a/sys/contrib/dev/acpica/components/resources/rsirq.c
+++ b/sys/contrib/dev/acpica/components/resources/rsirq.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rslist.c b/sys/contrib/dev/acpica/components/resources/rslist.c
index 79d064057422..2de70ad4fc58 100644
--- a/sys/contrib/dev/acpica/components/resources/rslist.c
+++ b/sys/contrib/dev/acpica/components/resources/rslist.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -209,12 +209,7 @@ AcpiRsConvertAmlToResources (
if (AcpiUtGetResourceType (Aml) ==
ACPI_RESOURCE_NAME_SERIAL_BUS)
{
- /* Avoid undefined behavior: member access within misaligned address */
-
- AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
- memcpy(&CommonSerialBus, AmlResource, sizeof(CommonSerialBus));
-
- if (CommonSerialBus.Type >
+ if (AmlResource->CommonSerialBus.Type >
AML_RESOURCE_MAX_SERIALBUSTYPE)
{
ConversionTable = NULL;
@@ -224,7 +219,7 @@ AcpiRsConvertAmlToResources (
/* This is an I2C, SPI, UART, or CSI2 SerialBus descriptor */
ConversionTable = AcpiGbl_ConvertResourceSerialBusDispatch [
- CommonSerialBus.Type];
+ AmlResource->CommonSerialBus.Type];
}
}
else
diff --git a/sys/contrib/dev/acpica/components/resources/rsmemory.c b/sys/contrib/dev/acpica/components/resources/rsmemory.c
index f92cb9afa08d..0430379a0f05 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmemory.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmemory.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsmisc.c b/sys/contrib/dev/acpica/components/resources/rsmisc.c
index 32b033e7ff08..725a130a2cec 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmisc.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmisc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsserial.c b/sys/contrib/dev/acpica/components/resources/rsserial.c
index 324a4c52c8e5..ab09939850c0 100644
--- a/sys/contrib/dev/acpica/components/resources/rsserial.c
+++ b/sys/contrib/dev/acpica/components/resources/rsserial.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsutils.c b/sys/contrib/dev/acpica/components/resources/rsutils.c
index 873a59b7a536..cc89fcfbb356 100644
--- a/sys/contrib/dev/acpica/components/resources/rsutils.c
+++ b/sys/contrib/dev/acpica/components/resources/rsutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/resources/rsxface.c b/sys/contrib/dev/acpica/components/resources/rsxface.c
index 09a9ad4f6171..89cc58864ead 100644
--- a/sys/contrib/dev/acpica/components/resources/rsxface.c
+++ b/sys/contrib/dev/acpica/components/resources/rsxface.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbdata.c b/sys/contrib/dev/acpica/components/tables/tbdata.c
index 0eb3ab0fcda3..46c7724bdda4 100644
--- a/sys/contrib/dev/acpica/components/tables/tbdata.c
+++ b/sys/contrib/dev/acpica/components/tables/tbdata.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbfadt.c b/sys/contrib/dev/acpica/components/tables/tbfadt.c
index 6d066a2f8ed0..70490b5d0e70 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfadt.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfadt.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbfind.c b/sys/contrib/dev/acpica/components/tables/tbfind.c
index 108e52fe5da4..e497cca9b553 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfind.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfind.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -208,8 +208,8 @@ AcpiTbFindTable (
memset (&Header, 0, sizeof (ACPI_TABLE_HEADER));
ACPI_COPY_NAMESEG (Header.Signature, Signature);
- strncpy (Header.OemId, OemId, ACPI_OEM_ID_SIZE);
- strncpy (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE);
+ memcpy (Header.OemId, OemId, ACPI_OEM_ID_SIZE);
+ memcpy (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE);
/* Search for the table */
diff --git a/sys/contrib/dev/acpica/components/tables/tbinstal.c b/sys/contrib/dev/acpica/components/tables/tbinstal.c
index ea3f8842d3d1..309ec5b68472 100644
--- a/sys/contrib/dev/acpica/components/tables/tbinstal.c
+++ b/sys/contrib/dev/acpica/components/tables/tbinstal.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbprint.c b/sys/contrib/dev/acpica/components/tables/tbprint.c
index 5fe6b2149e90..7211673c42a2 100644
--- a/sys/contrib/dev/acpica/components/tables/tbprint.c
+++ b/sys/contrib/dev/acpica/components/tables/tbprint.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbutils.c b/sys/contrib/dev/acpica/components/tables/tbutils.c
index 8e994b018f1e..61d8ac597afa 100644
--- a/sys/contrib/dev/acpica/components/tables/tbutils.c
+++ b/sys/contrib/dev/acpica/components/tables/tbutils.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbxface.c b/sys/contrib/dev/acpica/components/tables/tbxface.c
index 82aed0fea9d6..0b16c0a9ebec 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxface.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxface.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfload.c b/sys/contrib/dev/acpica/components/tables/tbxfload.c
index a8ac5f9c9c77..af49869d626c 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfload.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfload.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfroot.c b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
index f145d5e06bb3..7c444bda9c8c 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfroot.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utaddress.c b/sys/contrib/dev/acpica/components/utilities/utaddress.c
index 3d80c3166545..7ea0ff3e91b7 100644
--- a/sys/contrib/dev/acpica/components/utilities/utaddress.c
+++ b/sys/contrib/dev/acpica/components/utilities/utaddress.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utalloc.c b/sys/contrib/dev/acpica/components/utilities/utalloc.c
index 4e4b44559e98..0dfdec633c2f 100644
--- a/sys/contrib/dev/acpica/components/utilities/utalloc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utalloc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utascii.c b/sys/contrib/dev/acpica/components/utilities/utascii.c
index 2eacdd606f6a..cf64bdee02df 100644
--- a/sys/contrib/dev/acpica/components/utilities/utascii.c
+++ b/sys/contrib/dev/acpica/components/utilities/utascii.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utbuffer.c b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
index f4983ba13e4e..b22530412b2f 100644
--- a/sys/contrib/dev/acpica/components/utilities/utbuffer.c
+++ b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utcache.c b/sys/contrib/dev/acpica/components/utilities/utcache.c
index 6afed09a4ccf..232154696307 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcache.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcache.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -433,9 +433,9 @@ AcpiOsAcquireObject (
{
/* The cache is empty, create a new object */
- ACPI_MEM_TRACKING (Cache->TotalAllocated++);
-
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ ACPI_MEM_TRACKING (Cache->TotalAllocated++);
+
if ((Cache->TotalAllocated - Cache->TotalFreed) > Cache->MaxOccupied)
{
Cache->MaxOccupied = Cache->TotalAllocated - Cache->TotalFreed;
diff --git a/sys/contrib/dev/acpica/components/utilities/utcksum.c b/sys/contrib/dev/acpica/components/utilities/utcksum.c
index 24357be1ff61..50f8f80570ef 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcksum.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcksum.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utcopy.c b/sys/contrib/dev/acpica/components/utilities/utcopy.c
index ab304663ab11..fd4d6922a1f2 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcopy.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcopy.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utdebug.c b/sys/contrib/dev/acpica/components/utilities/utdebug.c
index 8a3014cb4c7e..90b8e246a1a9 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdebug.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdebug.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utdecode.c b/sys/contrib/dev/acpica/components/utilities/utdecode.c
index 3e0acfb2c65d..00a2de9e9a5d 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdecode.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdecode.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utdelete.c b/sys/contrib/dev/acpica/components/utilities/utdelete.c
index e01acb91cd42..e88cc736990b 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdelete.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -574,7 +574,7 @@ AcpiUtUpdateRefCount (
"Obj %p Type %.2X [%s] Refs %.2X [Incremented]\n",
Object, Object->Common.Type,
AcpiUtGetObjectTypeName (Object), NewCount));
- Message = "Incremement";
+ Message = "Increment";
break;
case REF_DECREMENT:
diff --git a/sys/contrib/dev/acpica/components/utilities/uterror.c b/sys/contrib/dev/acpica/components/utilities/uterror.c
index 1853bddd90f6..1537f69a2a2b 100644
--- a/sys/contrib/dev/acpica/components/utilities/uterror.c
+++ b/sys/contrib/dev/acpica/components/utilities/uterror.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/uteval.c b/sys/contrib/dev/acpica/components/utilities/uteval.c
index 530320d811d1..53f843062179 100644
--- a/sys/contrib/dev/acpica/components/utilities/uteval.c
+++ b/sys/contrib/dev/acpica/components/utilities/uteval.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utexcep.c b/sys/contrib/dev/acpica/components/utilities/utexcep.c
index a2f8c877524f..b3e606ceef57 100644
--- a/sys/contrib/dev/acpica/components/utilities/utexcep.c
+++ b/sys/contrib/dev/acpica/components/utilities/utexcep.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utglobal.c b/sys/contrib/dev/acpica/components/utilities/utglobal.c
index acda2842b1ba..95d679a20746 100644
--- a/sys/contrib/dev/acpica/components/utilities/utglobal.c
+++ b/sys/contrib/dev/acpica/components/utilities/utglobal.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/uthex.c b/sys/contrib/dev/acpica/components/utilities/uthex.c
index b271a9bb426e..2806f1c48148 100644
--- a/sys/contrib/dev/acpica/components/utilities/uthex.c
+++ b/sys/contrib/dev/acpica/components/utilities/uthex.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utids.c b/sys/contrib/dev/acpica/components/utilities/utids.c
index fe363dad6acc..3dfb908302c6 100644
--- a/sys/contrib/dev/acpica/components/utilities/utids.c
+++ b/sys/contrib/dev/acpica/components/utilities/utids.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utinit.c b/sys/contrib/dev/acpica/components/utilities/utinit.c
index 75554a1824c1..b5a4b7e7d936 100644
--- a/sys/contrib/dev/acpica/components/utilities/utinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utinit.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utlock.c b/sys/contrib/dev/acpica/components/utilities/utlock.c
index 6cb2235fe7a5..a06b27525cc3 100644
--- a/sys/contrib/dev/acpica/components/utilities/utlock.c
+++ b/sys/contrib/dev/acpica/components/utilities/utlock.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utmath.c b/sys/contrib/dev/acpica/components/utilities/utmath.c
index 446c4af2b803..48bbe8f3d8c8 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmath.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmath.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utmisc.c b/sys/contrib/dev/acpica/components/utilities/utmisc.c
index 14065f6178b5..13dffc6674d3 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmisc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmisc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utmutex.c b/sys/contrib/dev/acpica/components/utilities/utmutex.c
index 46da7bd6dfbd..b0b26458818e 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmutex.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utnonansi.c b/sys/contrib/dev/acpica/components/utilities/utnonansi.c
index 17769077d224..bfbe1194ceae 100644
--- a/sys/contrib/dev/acpica/components/utilities/utnonansi.c
+++ b/sys/contrib/dev/acpica/components/utilities/utnonansi.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -353,7 +353,7 @@ AcpiUtSafeStrncpy (
{
/* Always terminate destination string */
- strncpy (Dest, Source, DestSize);
+ memcpy (Dest, Source, DestSize);
Dest[DestSize - 1] = 0;
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utobject.c b/sys/contrib/dev/acpica/components/utilities/utobject.c
index c7abe24f626d..046b6c2531b6 100644
--- a/sys/contrib/dev/acpica/components/utilities/utobject.c
+++ b/sys/contrib/dev/acpica/components/utilities/utobject.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utosi.c b/sys/contrib/dev/acpica/components/utilities/utosi.c
index c4238235af8b..8a2d5093f563 100644
--- a/sys/contrib/dev/acpica/components/utilities/utosi.c
+++ b/sys/contrib/dev/acpica/components/utilities/utosi.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utownerid.c b/sys/contrib/dev/acpica/components/utilities/utownerid.c
index 12fe9b0d7d2d..7e39b7851af4 100644
--- a/sys/contrib/dev/acpica/components/utilities/utownerid.c
+++ b/sys/contrib/dev/acpica/components/utilities/utownerid.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utpredef.c b/sys/contrib/dev/acpica/components/utilities/utpredef.c
index aba0859534c1..23e6606d167c 100644
--- a/sys/contrib/dev/acpica/components/utilities/utpredef.c
+++ b/sys/contrib/dev/acpica/components/utilities/utpredef.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utresdecode.c b/sys/contrib/dev/acpica/components/utilities/utresdecode.c
index eec3a77c0064..d14259911a07 100644
--- a/sys/contrib/dev/acpica/components/utilities/utresdecode.c
+++ b/sys/contrib/dev/acpica/components/utilities/utresdecode.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utresrc.c b/sys/contrib/dev/acpica/components/utilities/utresrc.c
index e42932c1d5fe..109395435d45 100644
--- a/sys/contrib/dev/acpica/components/utilities/utresrc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utresrc.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -532,21 +532,16 @@ AcpiUtValidateResource (
AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml);
if (ResourceType == ACPI_RESOURCE_NAME_SERIAL_BUS)
{
- /* Avoid undefined behavior: member access within misaligned address */
-
- AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
- memcpy(&CommonSerialBus, AmlResource, sizeof(CommonSerialBus));
-
/* Validate the BusType field */
- if ((CommonSerialBus.Type == 0) ||
- (CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE))
+ if ((AmlResource->CommonSerialBus.Type == 0) ||
+ (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE))
{
if (WalkState)
{
ACPI_ERROR ((AE_INFO,
"Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
- CommonSerialBus.Type));
+ AmlResource->CommonSerialBus.Type));
}
return (AE_AML_INVALID_RESOURCE_TYPE);
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utstate.c b/sys/contrib/dev/acpica/components/utilities/utstate.c
index 83b7eadd4912..02fec7d15bf5 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstate.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstate.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utstring.c b/sys/contrib/dev/acpica/components/utilities/utstring.c
index c6463da208e3..59e34e7c8a79 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstring.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstring.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c
index d3987e4b2022..1537d8a02949 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c b/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
index dc767fab68c8..2683c37c35db 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/uttrack.c b/sys/contrib/dev/acpica/components/utilities/uttrack.c
index e41ef2b1ed7e..2c60c1c7b1f1 100644
--- a/sys/contrib/dev/acpica/components/utilities/uttrack.c
+++ b/sys/contrib/dev/acpica/components/utilities/uttrack.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utuuid.c b/sys/contrib/dev/acpica/components/utilities/utuuid.c
index 2f0e19a864d8..669cce69b1f3 100644
--- a/sys/contrib/dev/acpica/components/utilities/utuuid.c
+++ b/sys/contrib/dev/acpica/components/utilities/utuuid.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utxface.c b/sys/contrib/dev/acpica/components/utilities/utxface.c
index ff3342d87b61..9b5f8b3c9d84 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxface.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxface.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utxferror.c b/sys/contrib/dev/acpica/components/utilities/utxferror.c
index dab3183986c7..08a3ab986c3f 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxferror.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxferror.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfinit.c b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
index 8beae729258e..f295471031d0 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
index a46801be9ee1..595904977f23 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acapps.h b/sys/contrib/dev/acpica/include/acapps.h
index 21c9269b7376..ccaea124afb1 100644
--- a/sys/contrib/dev/acpica/include/acapps.h
+++ b/sys/contrib/dev/acpica/include/acapps.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -159,7 +159,7 @@
/* Common info for tool signons */
#define ACPICA_NAME "Intel ACPI Component Architecture"
-#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2023 Intel Corporation"
+#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2025 Intel Corporation"
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH " (64-bit version)"
diff --git a/sys/contrib/dev/acpica/include/acbuffer.h b/sys/contrib/dev/acpica/include/acbuffer.h
index 925e9a73dda8..682ddcd72625 100644
--- a/sys/contrib/dev/acpica/include/acbuffer.h
+++ b/sys/contrib/dev/acpica/include/acbuffer.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acclib.h b/sys/contrib/dev/acpica/include/acclib.h
index 43e8333fd8f1..3960ffd2582e 100644
--- a/sys/contrib/dev/acpica/include/acclib.h
+++ b/sys/contrib/dev/acpica/include/acclib.h
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/accommon.h b/sys/contrib/dev/acpica/include/accommon.h
index 9eb1a2524f7d..10a39803842b 100644
--- a/sys/contrib/dev/acpica/include/accommon.h
+++ b/sys/contrib/dev/acpica/include/accommon.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acconfig.h b/sys/contrib/dev/acpica/include/acconfig.h
index 7af986fce75a..983dc3021185 100644
--- a/sys/contrib/dev/acpica/include/acconfig.h
+++ b/sys/contrib/dev/acpica/include/acconfig.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acconvert.h b/sys/contrib/dev/acpica/include/acconvert.h
index f8e29bef3d25..9dedc51a7ef9 100644
--- a/sys/contrib/dev/acpica/include/acconvert.h
+++ b/sys/contrib/dev/acpica/include/acconvert.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acdebug.h b/sys/contrib/dev/acpica/include/acdebug.h
index 54e4e2801a09..e335752148b9 100644
--- a/sys/contrib/dev/acpica/include/acdebug.h
+++ b/sys/contrib/dev/acpica/include/acdebug.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -187,7 +187,7 @@ typedef struct acpi_db_execute_walk
{
UINT32 Count;
UINT32 MaxCount;
- char NameSeg[ACPI_NAMESEG_SIZE + 1];
+ char NameSeg[ACPI_NAMESEG_SIZE + 1] ACPI_NONSTRING;
} ACPI_DB_EXECUTE_WALK;
diff --git a/sys/contrib/dev/acpica/include/acdisasm.h b/sys/contrib/dev/acpica/include/acdisasm.h
index 1792a10533f8..ab092d6aec22 100644
--- a/sys/contrib/dev/acpica/include/acdisasm.h
+++ b/sys/contrib/dev/acpica/include/acdisasm.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -223,9 +223,12 @@ typedef enum
ACPI_DMT_UINT64,
ACPI_DMT_BUF7,
ACPI_DMT_BUF10,
+ ACPI_DMT_BUF11,
ACPI_DMT_BUF12,
ACPI_DMT_BUF16,
ACPI_DMT_BUF18,
+ ACPI_DMT_BUF24,
+ ACPI_DMT_BUF26,
ACPI_DMT_BUF32,
ACPI_DMT_BUF112,
ACPI_DMT_BUF128,
@@ -269,6 +272,7 @@ typedef enum
ACPI_DMT_DMAR_SCOPE,
ACPI_DMT_EINJACT,
ACPI_DMT_EINJINST,
+ ACPI_DMT_ERDT,
ACPI_DMT_ERSTACT,
ACPI_DMT_ERSTINST,
ACPI_DMT_FADTPM,
@@ -292,6 +296,7 @@ typedef enum
ACPI_DMT_PPTT,
ACPI_DMT_RGRT,
ACPI_DMT_RHCT,
+ ACPI_DMT_RIMT,
ACPI_DMT_SDEI,
ACPI_DMT_SDEV,
ACPI_DMT_SLIC,
@@ -452,6 +457,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar5[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar6[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0a[];
@@ -461,6 +467,24 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCacd[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCacdX2apic[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCarc[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCard[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCmrc[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtCmrd[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtDacd[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtDacdPath[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtDacdScope[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtIbad[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtIbrd[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtIbrdCorrFactor[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtMarc[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtMmrc[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtMmrcCorrFactor[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoErdtRmdd[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[];
@@ -595,6 +619,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMrrm[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMrrm0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit[];
@@ -654,6 +680,14 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctCmo1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctMmu1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimtNodeHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimtIommu[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimtIommuWire[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimtPcieRc[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimtIdMapping[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimtPlatDev[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoRimtPlatDevPad[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[];
@@ -831,6 +865,10 @@ AcpiDmDumpEinj (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpErdt (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpErst (
ACPI_TABLE_HEADER *Table);
@@ -883,6 +921,10 @@ AcpiDmDumpMpst (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpMrrm (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpMsct (
ACPI_TABLE_HEADER *Table);
@@ -926,6 +968,10 @@ void
AcpiDmDumpRhct (
ACPI_TABLE_HEADER *Table);
+void
+AcpiDmDumpRimt (
+ ACPI_TABLE_HEADER *Table);
+
UINT32
AcpiDmDumpRsdp (
ACPI_TABLE_HEADER *Table);
diff --git a/sys/contrib/dev/acpica/include/acdispat.h b/sys/contrib/dev/acpica/include/acdispat.h
index a0a5b832ee8d..0573e5817dff 100644
--- a/sys/contrib/dev/acpica/include/acdispat.h
+++ b/sys/contrib/dev/acpica/include/acdispat.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acevents.h b/sys/contrib/dev/acpica/include/acevents.h
index 8d1f76cd2c73..22eff360559c 100644
--- a/sys/contrib/dev/acpica/include/acevents.h
+++ b/sys/contrib/dev/acpica/include/acevents.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acexcep.h b/sys/contrib/dev/acpica/include/acexcep.h
index 218abea0ddca..57f98ab4540f 100644
--- a/sys/contrib/dev/acpica/include/acexcep.h
+++ b/sys/contrib/dev/acpica/include/acexcep.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h
index fa14d6e50602..02167c3af092 100644
--- a/sys/contrib/dev/acpica/include/acglobal.h
+++ b/sys/contrib/dev/acpica/include/acglobal.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/achware.h b/sys/contrib/dev/acpica/include/achware.h
index fcd04af6ae39..46efffb50708 100644
--- a/sys/contrib/dev/acpica/include/achware.h
+++ b/sys/contrib/dev/acpica/include/achware.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acinterp.h b/sys/contrib/dev/acpica/include/acinterp.h
index 65172ebc1f13..74166384f172 100644
--- a/sys/contrib/dev/acpica/include/acinterp.h
+++ b/sys/contrib/dev/acpica/include/acinterp.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h
index c8beb6f1b8b5..56ce42ba89fc 100644
--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -480,7 +480,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
*/
typedef struct acpi_name_info
{
- char Name[ACPI_NAMESEG_SIZE];
+ char Name[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
UINT16 ArgumentList;
UINT8 ExpectedBtypes;
@@ -568,7 +568,7 @@ typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
typedef struct acpi_simple_repair_info
{
- char Name[ACPI_NAMESEG_SIZE];
+ char Name[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
UINT32 UnexpectedBtypes;
UINT32 PackageIndex;
ACPI_OBJECT_CONVERTER ObjectConverter;
diff --git a/sys/contrib/dev/acpica/include/acmacros.h b/sys/contrib/dev/acpica/include/acmacros.h
index 14313099a74a..eabe403b3998 100644
--- a/sys/contrib/dev/acpica/include/acmacros.h
+++ b/sys/contrib/dev/acpica/include/acmacros.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acnames.h b/sys/contrib/dev/acpica/include/acnames.h
index 1161b9ce7696..070e318fb8cc 100644
--- a/sys/contrib/dev/acpica/include/acnames.h
+++ b/sys/contrib/dev/acpica/include/acnames.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acnamesp.h b/sys/contrib/dev/acpica/include/acnamesp.h
index f86d18582633..41f704b3d74b 100644
--- a/sys/contrib/dev/acpica/include/acnamesp.h
+++ b/sys/contrib/dev/acpica/include/acnamesp.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acobject.h b/sys/contrib/dev/acpica/include/acobject.h
index 889ac7e08df2..95be1a95b4c7 100644
--- a/sys/contrib/dev/acpica/include/acobject.h
+++ b/sys/contrib/dev/acpica/include/acobject.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acopcode.h b/sys/contrib/dev/acpica/include/acopcode.h
index a8ef2de1f9ad..c8d17c3554d0 100644
--- a/sys/contrib/dev/acpica/include/acopcode.h
+++ b/sys/contrib/dev/acpica/include/acopcode.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acoutput.h b/sys/contrib/dev/acpica/include/acoutput.h
index c270d2c83277..49a466dba33a 100644
--- a/sys/contrib/dev/acpica/include/acoutput.h
+++ b/sys/contrib/dev/acpica/include/acoutput.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acparser.h b/sys/contrib/dev/acpica/include/acparser.h
index a33cfcc5229b..8b3d3702f4a2 100644
--- a/sys/contrib/dev/acpica/include/acparser.h
+++ b/sys/contrib/dev/acpica/include/acparser.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acpi.h b/sys/contrib/dev/acpica/include/acpi.h
index b47d4108a7ba..07e5e93e2309 100644
--- a/sys/contrib/dev/acpica/include/acpi.h
+++ b/sys/contrib/dev/acpica/include/acpi.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acpiosxf.h b/sys/contrib/dev/acpica/include/acpiosxf.h
index 751f44508cae..77a22eee7442 100644
--- a/sys/contrib/dev/acpica/include/acpiosxf.h
+++ b/sys/contrib/dev/acpica/include/acpiosxf.h
@@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h
index bf645648bbc3..193b0e6a70dc 100644
--- a/sys/contrib/dev/acpica/include/acpixf.h
+++ b/sys/contrib/dev/acpica/include/acpixf.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -154,7 +154,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20241212
+#define ACPI_CA_VERSION 0x20250404
#include <contrib/dev/acpica/include/acconfig.h>
#include <contrib/dev/acpica/include/actypes.h>
diff --git a/sys/contrib/dev/acpica/include/acpredef.h b/sys/contrib/dev/acpica/include/acpredef.h
index 144aedf0bf9a..91fd49723b7f 100644
--- a/sys/contrib/dev/acpica/include/acpredef.h
+++ b/sys/contrib/dev/acpica/include/acpredef.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acresrc.h b/sys/contrib/dev/acpica/include/acresrc.h
index 8b6699c42588..2e3c7d3d1d40 100644
--- a/sys/contrib/dev/acpica/include/acresrc.h
+++ b/sys/contrib/dev/acpica/include/acresrc.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acrestyp.h b/sys/contrib/dev/acpica/include/acrestyp.h
index 9d35ed1397b0..ab48a3911ae6 100644
--- a/sys/contrib/dev/acpica/include/acrestyp.h
+++ b/sys/contrib/dev/acpica/include/acrestyp.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acstruct.h b/sys/contrib/dev/acpica/include/acstruct.h
index 3c0533ee2173..b1c54f09fe55 100644
--- a/sys/contrib/dev/acpica/include/acstruct.h
+++ b/sys/contrib/dev/acpica/include/acstruct.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/actables.h b/sys/contrib/dev/acpica/include/actables.h
index 436e9fd69c45..6f2cacbde3a1 100644
--- a/sys/contrib/dev/acpica/include/actables.h
+++ b/sys/contrib/dev/acpica/include/actables.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/actbinfo.h b/sys/contrib/dev/acpica/include/actbinfo.h
index 19692837f11d..fdf2a989ef6b 100644
--- a/sys/contrib/dev/acpica/include/actbinfo.h
+++ b/sys/contrib/dev/acpica/include/actbinfo.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -170,6 +170,7 @@
#define ACPI_DRTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f)
#define ACPI_ECDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ECDT,f)
#define ACPI_EINJ_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_EINJ,f)
+#define ACPI_ERDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ERDT,f)
#define ACPI_ERST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ERST,f)
#define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f)
#define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f)
@@ -181,6 +182,7 @@
#define ACPI_MCFG_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCFG,f)
#define ACPI_MCHI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCHI,f)
#define ACPI_MPST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MPST,f)
+#define ACPI_MRRM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MRRM,f)
#define ACPI_MSCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MSCT,f)
#define ACPI_NFIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_NFIT,f)
#define ACPI_PCCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PCCT,f)
@@ -190,6 +192,7 @@
#define ACPI_RAS2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RAS2,f)
#define ACPI_RGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RGRT,f)
#define ACPI_RHCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RHCT,f)
+#define ACPI_RIMT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RIMT,f)
#define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f)
#define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f)
#define ACPI_SDEI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEI,f)
@@ -275,11 +278,25 @@
#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
#define ACPI_DMAR4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f)
#define ACPI_DMAR5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_SATC,f)
+#define ACPI_DMAR6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_SIDP,f)
#define ACPI_DRTM0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST,f)
#define ACPI_DRTM1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST,f)
#define ACPI_DRTM1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_RESOURCE,f)
#define ACPI_DRTM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_DPS_ID,f)
#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
+#define ACPI_ERDT_HDR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTBL_HDR_16,f)
+#define ACPI_ERDT_CACD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_CACD,f)
+#define ACPI_ERDT_CARC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_CARC,f)
+#define ACPI_ERDT_CARD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_CARD,f)
+#define ACPI_ERDT_CMRC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_CMRC,f)
+#define ACPI_ERDT_CMRD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_CMRD,f)
+#define ACPI_ERDT_DACD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_DACD,f)
+#define ACPI_ERDT_DACD_PATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_DACD_PATHS,f)
+#define ACPI_ERDT_IBAD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_IBAD,f)
+#define ACPI_ERDT_IBRD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_IBRD,f)
+#define ACPI_ERDT_MARC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_MARC,f)
+#define ACPI_ERDT_MMRC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_MMRC,f)
+#define ACPI_ERDT_RMDD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ERDT_RMDD,f)
#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT_POINTER,f)
@@ -373,6 +390,7 @@
#define ACPI_MPST0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_COMPONENT,f)
#define ACPI_MPST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f)
#define ACPI_MPST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f)
+#define ACPI_MRRM0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MRRM_MEM_RANGE_ENTRY,f)
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
#define ACPI_NFITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_HEADER,f)
#define ACPI_NFIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f)
@@ -413,6 +431,12 @@
#define ACPI_RHCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_CMO_NODE,f)
#define ACPI_RHCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_MMU_NODE,f)
#define ACPI_RHCTFFFF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_HART_INFO,f)
+#define ACPI_RIMTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RIMT_NODE,f)
+#define ACPI_RIMTI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RIMT_IOMMU,f)
+#define ACPI_RIMTW_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RIMT_IOMMU_WIRE_GSI,f)
+#define ACPI_RIMTP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RIMT_PCIE_RC,f)
+#define ACPI_RIMTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RIMT_ID_MAPPING,f)
+#define ACPI_RIMTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RIMT_PLATFORM_DEVICE,f)
#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f)
#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f)
@@ -460,8 +484,10 @@
#define ACPI_AGDI_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_AGDI,f,o)
#define ACPI_APMTN_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_APMT_NODE,f,o)
#define ACPI_BGRT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_BGRT,f,o)
+#define ACPI_DMAR0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f,o)
#define ACPI_DRTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_DRTM,f,o)
#define ACPI_DRTM1a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_DRTM_RESOURCE,f,o)
+#define ACPI_ERDT_RMDD_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_ERDT_RMDD,f,o)
#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FADT,f,o)
#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FACS,f,o)
#define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_HPET,f,o)
diff --git a/sys/contrib/dev/acpica/include/actbl.h b/sys/contrib/dev/acpica/include/actbl.h
index cae349e02bed..eafd5d8a0f8b 100644
--- a/sys/contrib/dev/acpica/include/actbl.h
+++ b/sys/contrib/dev/acpica/include/actbl.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -213,15 +213,15 @@
typedef struct acpi_table_header
{
- char Signature[ACPI_NAMESEG_SIZE]; /* ASCII table signature */
- UINT32 Length; /* Length of table in bytes, including this header */
- UINT8 Revision; /* ACPI Specification minor version number */
- UINT8 Checksum; /* To make sum of entire table == 0 */
- char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
- char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
- UINT32 OemRevision; /* OEM revision number */
- char AslCompilerId[ACPI_NAMESEG_SIZE]; /* ASCII ASL compiler vendor ID */
- UINT32 AslCompilerRevision; /* ASL compiler version */
+ char Signature[ACPI_NAMESEG_SIZE] ACPI_NONSTRING; /* ASCII table signature */
+ UINT32 Length; /* Length of table in bytes, including this header */
+ UINT8 Revision; /* ACPI Specification minor version number */
+ UINT8 Checksum; /* To make sum of entire table == 0 */
+ char OemId[ACPI_OEM_ID_SIZE] ACPI_NONSTRING; /* ASCII OEM identification */
+ char OemTableId[ACPI_OEM_TABLE_ID_SIZE] ACPI_NONSTRING; /* ASCII OEM table identification */
+ UINT32 OemRevision; /* OEM revision number */
+ char AslCompilerId[ACPI_NAMESEG_SIZE]; /* ASCII ASL compiler vendor ID */
+ UINT32 AslCompilerRevision; /* ASL compiler version */
} ACPI_TABLE_HEADER;
diff --git a/sys/contrib/dev/acpica/include/actbl1.h b/sys/contrib/dev/acpica/include/actbl1.h
index 9ec85d2d22e8..876b721068c6 100644
--- a/sys/contrib/dev/acpica/include/actbl1.h
+++ b/sys/contrib/dev/acpica/include/actbl1.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -260,6 +260,16 @@ typedef struct acpi_whea_header
} ACPI_WHEA_HEADER;
+/* Larger subtable header (when Length can exceed 255) */
+
+typedef struct acpi_subtable_header_16
+{
+ UINT16 Type;
+ UINT16 Length;
+
+} ACPI_SUBTBL_HDR_16;
+
+
/*******************************************************************************
*
* ASF - Alert Standard Format table (Signature "ASF!")
@@ -1119,7 +1129,8 @@ enum AcpiDmarType
ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
ACPI_DMAR_TYPE_NAMESPACE = 4,
ACPI_DMAR_TYPE_SATC = 5,
- ACPI_DMAR_TYPE_RESERVED = 6 /* 6 and greater are reserved */
+ ACPI_DMAR_TYPE_SIDP = 6,
+ ACPI_DMAR_TYPE_RESERVED = 7 /* 7 and greater are reserved */
};
@@ -1129,7 +1140,8 @@ typedef struct acpi_dmar_device_scope
{
UINT8 EntryType;
UINT8 Length;
- UINT16 Reserved;
+ UINT8 Flags;
+ UINT8 Reserved;
UINT8 EnumerationId;
UINT8 Bus;
@@ -1166,7 +1178,7 @@ typedef struct acpi_dmar_hardware_unit
{
ACPI_DMAR_HEADER Header;
UINT8 Flags;
- UINT8 Reserved;
+ UINT8 Size;
UINT16 Segment;
UINT64 Address; /* Register Base Address */
@@ -1246,9 +1258,20 @@ typedef struct acpi_dmar_satc
UINT8 Reserved;
UINT16 Segment;
-} ACPI_DMAR_SATC
+} ACPI_DMAR_SATC;
+
+
+/* 6: SoC Integrated Device Property Reporting Structure */
+
+typedef struct acpi_dmar_sidp
+{
+ ACPI_DMAR_HEADER Header;
+ UINT16 Reserved;
+ UINT16 Segment;
+
+} ACPI_DMAR_SIDP;
+
-;
/*******************************************************************************
*
* DRTM - Dynamic Root of Trust for Measurement table
diff --git a/sys/contrib/dev/acpica/include/actbl2.h b/sys/contrib/dev/acpica/include/actbl2.h
index cc09702b8a3f..4899929b2d45 100644
--- a/sys/contrib/dev/acpica/include/actbl2.h
+++ b/sys/contrib/dev/acpica/include/actbl2.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
+ * Name: actbl2.h - ACPI Table Definitions
*
*****************************************************************************/
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -173,6 +173,7 @@
#define ACPI_SIG_BDAT "BDAT" /* BIOS Data ACPI Table */
#define ACPI_SIG_CCEL "CCEL" /* CC Event Log Table */
#define ACPI_SIG_CDAT "CDAT" /* Coherent Device Attribute Table */
+#define ACPI_SIG_ERDT "ERDT" /* Enhanced Resource Director Technology */
#define ACPI_SIG_IORT "IORT" /* IO Remapping Table */
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
@@ -181,6 +182,7 @@
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MPAM "MPAM" /* Memory System Resource Partitioning and Monitoring Table */
#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
+#define ACPI_SIG_MRRM "MRRM" /* Memory Range and Region Mapping table */
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
#define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */
@@ -194,6 +196,7 @@
#define ACPI_SIG_RAS2 "RAS2" /* RAS2 Feature table */
#define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */
#define ACPI_SIG_RHCT "RHCT" /* RISC-V Hart Capabilities Table */
+#define ACPI_SIG_RIMT "RIMT" /* RISC-V IO Mapping Table */
#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
#define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */
#define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
@@ -641,6 +644,235 @@ typedef struct acpi_table_ccel
/*******************************************************************************
*
+ * ERDT - Enhanced Resource Director Technology (ERDT) table
+ *
+ * Conforms to "Intel Resource Director Technology Architecture Specification"
+ * Version 1.1, January 2025
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_erdt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 MaxClos; /* Maximum classes of service */
+ UINT8 Reserved[24];
+ UINT8 Erdt_Substructures[];
+
+} ACPI_TABLE_ERDT;
+
+
+/* Values for subtable type in ACPI_SUBTBL_HDR_16 */
+
+enum AcpiErdtType
+{
+ ACPI_ERDT_TYPE_RMDD = 0,
+ ACPI_ERDT_TYPE_CACD = 1,
+ ACPI_ERDT_TYPE_DACD = 2,
+ ACPI_ERDT_TYPE_CMRC = 3,
+ ACPI_ERDT_TYPE_MMRC = 4,
+ ACPI_ERDT_TYPE_MARC = 5,
+ ACPI_ERDT_TYPE_CARC = 6,
+ ACPI_ERDT_TYPE_CMRD = 7,
+ ACPI_ERDT_TYPE_IBRD = 8,
+ ACPI_ERDT_TYPE_IBAD = 9,
+ ACPI_ERDT_TYPE_CARD = 10,
+ ACPI_ERDT_TYPE_RESERVED = 11 /* 11 and above are reserved */
+
+};
+
+/*
+ * ERDT Subtables, correspond to Type in ACPI_SUBTBL_HDR_16
+ */
+
+/* 0: RMDD - Resource Management Domain Description */
+
+typedef struct acpi_erdt_rmdd
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT16 Flags;
+ UINT16 IO_l3_Slices; /* Number of slices in IO cache */
+ UINT8 IO_l3_Sets; /* Number of sets in IO cache */
+ UINT8 IO_l3_Ways; /* Number of ways in IO cache */
+ UINT64 Reserved;
+ UINT16 DomainId; /* Unique domain ID */
+ UINT32 MaxRmid; /* Maximun RMID supported */
+ UINT64 CregBase; /* Control Register Base Address */
+ UINT16 CregSize; /* Control Register Size (4K pages) */
+ UINT8 RmddStructs[];
+
+} ACPI_ERDT_RMDD;
+
+
+/* 1: CACD - CPU Agent Collection Description */
+
+typedef struct acpi_erdt_cacd
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT16 Reserved;
+ UINT16 DomainId; /* Unique domain ID */
+ UINT32 X2APICIDS[];
+
+} ACPI_ERDT_CACD;
+
+
+/* 2: DACD - Device Agent Collection Description */
+
+typedef struct acpi_erdt_dacd
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT16 Reserved;
+ UINT16 DomainId; /* Unique domain ID */
+ UINT8 DevPaths[];
+
+} ACPI_ERDT_DACD;
+
+typedef struct acpi_erdt_dacd_dev_paths
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Segment;
+ UINT8 Reserved;
+ UINT8 StartBus;
+ UINT8 Path[];
+
+} ACPI_ERDT_DACD_PATHS;
+
+
+/* 3: CMRC - Cache Monitoring Registers for CPU Agents */
+
+typedef struct acpi_erdt_cmrc
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT32 Reserved1;
+ UINT32 Flags;
+ UINT8 IndexFn;
+ UINT8 Reserved2[11];
+ UINT64 CmtRegBase;
+ UINT32 CmtRegSize;
+ UINT16 ClumpSize;
+ UINT16 ClumpStride;
+ UINT64 UpScale;
+
+} ACPI_ERDT_CMRC;
+
+
+/* 4: MMRC - Memory-bandwidth Monitoring Registers for CPU Agents */
+
+typedef struct acpi_erdt_mmrc
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT32 Reserved1;
+ UINT32 Flags;
+ UINT8 IndexFn;
+ UINT8 Reserved2[11];
+ UINT64 RegBase;
+ UINT32 RegSize;
+ UINT8 CounterWidth;
+ UINT64 UpScale;
+ UINT8 Reserved3[7];
+ UINT32 CorrFactorListLen;
+ UINT32 CorrFactorList[];
+
+} ACPI_ERDT_MMRC;
+
+
+/* 5: MARC - Memory-bandwidth Allocation Registers for CPU Agents */
+
+typedef struct acpi_erdt_marc
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT16 Reserved1;
+ UINT16 Flags;
+ UINT8 IndexFn;
+ UINT8 Reserved2[7];
+ UINT64 RegBaseOpt;
+ UINT64 RegBaseMin;
+ UINT64 RegBaseMax;
+ UINT32 MbaRegSize;
+ UINT32 MbaCtrlRange;
+
+} ACPI_ERDT_MARC;
+
+
+/* 6: CARC - Cache Allocation Registers for CPU Agents */
+
+typedef struct acpi_erdt_carc
+{
+ ACPI_SUBTBL_HDR_16 Header;
+
+} ACPI_ERDT_CARC;
+
+
+/* 7: CMRD - Cache Monitoring Registers for Device Agents */
+
+typedef struct acpi_erdt_cmrd
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT32 Reserved1;
+ UINT32 Flags;
+ UINT8 IndexFn;
+ UINT8 Reserved2[11];
+ UINT64 RegBase;
+ UINT32 RegSize;
+ UINT16 CmtRegOff;
+ UINT16 CmtClumpSize;
+ UINT64 UpScale;
+
+} ACPI_ERDT_CMRD;
+
+
+/* 8: IBRD - Cache Monitoring Registers for Device Agents */
+
+typedef struct acpi_erdt_ibrd
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT32 Reserved1;
+ UINT32 Flags;
+ UINT8 IndexFn;
+ UINT8 Reserved2[11];
+ UINT64 RegBase;
+ UINT32 RegSize;
+ UINT16 TotalBwOffset;
+ UINT16 IOMissBwOffset;
+ UINT16 TotalBwClump;
+ UINT16 IOMissBwClump;
+ UINT8 Reserved3[7];
+ UINT8 CounterWidth;
+ UINT64 UpScale;
+ UINT32 CorrFactorListLen;
+ UINT32 CorrFactorList[];
+
+} ACPI_ERDT_IBRD;
+
+
+/* 9: IBAD - IO bandwidth Allocation Registers for device agents */
+
+typedef struct acpi_erdt_ibad
+{
+ ACPI_SUBTBL_HDR_16 Header;
+
+} ACPI_ERDT_IBAD;
+
+
+/* 10: CARD - IO bandwidth Allocation Registers for Device Agents */
+
+typedef struct acpi_erdt_card
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT32 Reserved1;
+ UINT32 Flags;
+ UINT32 ContentionMask;
+ UINT8 IndexFn;
+ UINT8 Reserved2[7];
+ UINT64 RegBase;
+ UINT32 RegSize;
+ UINT16 CatRegOffset;
+ UINT16 CatRegBlockSize;
+
+} ACPI_ERDT_CARD;
+
+
+/*******************************************************************************
+ *
* IORT - IO Remapping Table
*
* Conforms to "IO Remapping Table System Software on ARM Platforms",
@@ -2092,6 +2324,52 @@ typedef struct acpi_msct_proximity
/*******************************************************************************
*
+ * MRRM - Memory Range and Region Mapping (MRRM) table
+ * Conforms to "Intel Resource Director Technology Architecture Specification"
+ * Version 1.1, January 2025
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_mrrm
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT8 MaxMemRegion; /* Max Memory Regions supported */
+ UINT8 Flags; /* Region assignment type */
+ UINT8 Reserved[26];
+ UINT8 Memory_Range_Entry[];
+
+} ACPI_TABLE_MRRM;
+
+/* Flags */
+#define ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS (1<<0)
+
+/*******************************************************************************
+ *
+ * Memory Range entry - Memory Range entry in MRRM table
+ *
+ ******************************************************************************/
+
+typedef struct acpi_mrrm_mem_range_entry
+{
+ ACPI_SUBTBL_HDR_16 Header;
+ UINT32 Reserved0; /* Reserved */
+ UINT64 AddrBase; /* Base addr of the mem range */
+ UINT64 AddrLen; /* Length of the mem range */
+ UINT16 RegionIdFlags; /* Valid local or remote Region-ID */
+ UINT8 LocalRegionId; /* Platform-assigned static local Region-ID */
+ UINT8 RemoteRegionId; /* Platform-assigned static remote Region-ID */
+ UINT32 Reserved1; /* Reserved */
+ /* Region-ID Programming Registers[] */
+
+} ACPI_MRRM_MEM_RANGE_ENTRY;
+
+/* Values for RegionIdFlags above */
+#define ACPI_MRRM_VALID_REGION_ID_FLAGS_LOCAL (1<<0)
+#define ACPI_MRRM_VALID_REGION_ID_FLAGS_REMOTE (1<<1)
+
+
+/*******************************************************************************
+ *
* MSDM - Microsoft Data Management table
*
* Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
@@ -3318,17 +3596,17 @@ typedef struct acpi_ras2_pcc_desc {
/* RAS2 Platform Communication Channel Shared Memory Region */
-typedef struct acpi_ras2_shared_memory {
+typedef struct acpi_ras2_shmem {
UINT32 Signature;
UINT16 Command;
UINT16 Status;
UINT16 Version;
UINT8 Features[16];
- UINT8 SetCapabilities[16];
- UINT16 NumParameterBlocks;
- UINT32 SetCapabilitiesStatus;
+ UINT8 SetCaps[16];
+ UINT16 NumParamBlks;
+ UINT32 SetCapsStatus;
-} ACPI_RAS2_SHARED_MEMORY;
+} ACPI_RAS2_SHMEM;
/* RAS2 Parameter Block Structure for PATROL_SCRUB */
@@ -3342,16 +3620,16 @@ typedef struct acpi_ras2_parameter_block
/* RAS2 Parameter Block Structure for PATROL_SCRUB */
-typedef struct acpi_ras2_patrol_scrub_parameter {
+typedef struct acpi_ras2_patrol_scrub_param {
ACPI_RAS2_PARAMETER_BLOCK Header;
- UINT16 PatrolScrubCommand;
- UINT64 RequestedAddressRange[2];
- UINT64 ActualAddressRange[2];
+ UINT16 Command;
+ UINT64 ReqAddrRange[2];
+ UINT64 ActlAddrRange[2];
UINT32 Flags;
UINT32 ScrubParamsOut;
UINT32 ScrubParamsIn;
-} ACPI_RAS2_PATROL_SCRUB_PARAMETER;
+} ACPI_RAS2_PATROL_SCRUB_PARAM;
/* Masks for Flags field above */
@@ -3536,6 +3814,89 @@ typedef struct acpi_rhct_hart_info {
/*******************************************************************************
*
+ * RIMT - RISC-V IO Remapping Table
+ *
+ * https://github.com/riscv-non-isa/riscv-acpi-rimt
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_rimt {
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 NumNodes; /* Number of RIMT Nodes */
+ UINT32 NodeOffset; /* Offset to RIMT Node Array */
+ UINT32 Reserved;
+} ACPI_TABLE_RIMT;
+
+typedef struct acpi_rimt_node {
+ UINT8 Type;
+ UINT8 Revision;
+ UINT16 Length;
+ UINT16 Reserved;
+ UINT16 Id;
+ char NodeData[];
+} ACPI_RIMT_NODE;
+
+enum acpi_rimt_node_type {
+ ACPI_RIMT_NODE_TYPE_IOMMU = 0x0,
+ ACPI_RIMT_NODE_TYPE_PCIE_ROOT_COMPLEX = 0x1,
+ ACPI_RIMT_NODE_TYPE_PLAT_DEVICE = 0x2,
+};
+
+typedef struct acpi_rimt_iommu {
+ UINT8 HardwareId[8]; /* Hardware ID */
+ UINT64 BaseAddress; /* Base Address */
+ UINT32 Flags; /* Flags */
+ UINT32 ProximityDomain; /* Proximity Domain */
+ UINT16 PcieSegmentNumber; /* PCIe Segment number */
+ UINT16 PcieBdf; /* PCIe B/D/F */
+ UINT16 NumInterruptWires; /* Number of interrupt wires */
+ UINT16 InterruptWireOffset; /* Interrupt wire array offset */
+ UINT64 InterruptWire[]; /* Interrupt wire array */
+} ACPI_RIMT_IOMMU;
+
+/* IOMMU Node Flags */
+#define ACPI_RIMT_IOMMU_FLAGS_PCIE (1)
+#define ACPI_RIMT_IOMMU_FLAGS_PXM_VALID (1 << 1)
+
+/* Interrupt Wire Structure */
+typedef struct acpi_rimt_iommu_wire_gsi {
+ UINT32 IrqNum; /* Interrupt Number */
+ UINT32 Flags; /* Flags */
+} ACPI_RIMT_IOMMU_WIRE_GSI;
+
+/* Interrupt Wire Flags */
+#define ACPI_RIMT_GSI_LEVEL_TRIGGERRED (1)
+#define ACPI_RIMT_GSI_ACTIVE_HIGH (1 << 1)
+
+typedef struct acpi_rimt_id_mapping {
+ UINT32 SourceIdBase; /* Source ID Base */
+ UINT32 NumIds; /* Number of IDs */
+ UINT32 DestIdBase; /* Destination Device ID Base */
+ UINT32 DestOffset; /* Destination IOMMU Offset */
+ UINT32 Flags; /* Flags */
+} ACPI_RIMT_ID_MAPPING;
+
+typedef struct acpi_rimt_pcie_rc {
+ UINT32 Flags; /* Flags */
+ UINT16 Reserved; /* Reserved */
+ UINT16 PcieSegmentNumber; /* PCIe Segment number */
+ UINT16 IdMappingOffset; /* ID mapping array offset */
+ UINT16 NumIdMappings; /* Number of ID mappings */
+} ACPI_RIMT_PCIE_RC;
+
+/* PCIe Root Complex Node Flags */
+#define ACPI_RIMT_PCIE_ATS_SUPPORTED (1)
+#define ACPI_RIMT_PCIE_PRI_SUPPORTED (1 << 1)
+
+typedef struct acpi_rimt_platform_device {
+ UINT16 IdMappingOffset; /* ID Mapping array offset */
+ UINT16 NumIdMappings; /* Number of ID mappings */
+ char DeviceName[]; /* Device Object Name */
+} ACPI_RIMT_PLATFORM_DEVICE;
+
+
+/*******************************************************************************
+ *
* SBST - Smart Battery Specification Table
* Version 1
*
diff --git a/sys/contrib/dev/acpica/include/actbl3.h b/sys/contrib/dev/acpica/include/actbl3.h
index 516b081d8ec5..07bc8713becc 100644
--- a/sys/contrib/dev/acpica/include/actbl3.h
+++ b/sys/contrib/dev/acpica/include/actbl3.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -655,6 +655,8 @@ typedef struct acpi_table_tpm2
#define ACPI_TPM2_RESERVED10 10
#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */
#define ACPI_TPM2_RESERVED 12
+#define ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON 13
+#define ACPI_TPM2_CRB_WITH_ARM_FFA 15
/* Optional trailer appears after any StartMethod subtables */
diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h
index 5e1012d86e5a..66333243907b 100644
--- a/sys/contrib/dev/acpica/include/actypes.h
+++ b/sys/contrib/dev/acpica/include/actypes.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -673,12 +673,12 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src)))
#else
#define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE))
-#define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))
+#define ACPI_COPY_NAMESEG(dest,src) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))
#endif
/* Support for the special RSDP signature (8 characters) */
-#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
+#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, (sizeof(a) < 8) ? ACPI_NAMESEG_SIZE : 8))
#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
/* Support for OEMx signature (x can be any character) */
@@ -1578,4 +1578,8 @@ typedef enum
#define ACPI_FLEX_ARRAY(TYPE, NAME) TYPE NAME[0]
#endif
+#ifndef ACPI_NONSTRING
+#define ACPI_NONSTRING /* No terminating NUL character */
+#endif
+
#endif /* __ACTYPES_H__ */
diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h
index fbef7d97d34b..06b8eb0bda6b 100644
--- a/sys/contrib/dev/acpica/include/acutils.h
+++ b/sys/contrib/dev/acpica/include/acutils.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/acuuid.h b/sys/contrib/dev/acpica/include/acuuid.h
index f4c77be11f8e..071e9a5ad610 100644
--- a/sys/contrib/dev/acpica/include/acuuid.h
+++ b/sys/contrib/dev/acpica/include/acuuid.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/amlcode.h b/sys/contrib/dev/acpica/include/amlcode.h
index 600ee200cf11..6bb591904794 100644
--- a/sys/contrib/dev/acpica/include/amlcode.h
+++ b/sys/contrib/dev/acpica/include/amlcode.h
@@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/amlresrc.h b/sys/contrib/dev/acpica/include/amlresrc.h
index bb79a6486817..4482ed378ab1 100644
--- a/sys/contrib/dev/acpica/include/amlresrc.h
+++ b/sys/contrib/dev/acpica/include/amlresrc.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -792,10 +792,6 @@ typedef struct aml_resource_pin_group_config
#define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION 1 /* ACPI 6.2 */
-/* restore default alignment */
-
-#pragma pack()
-
/* Union of all resource descriptors, so we can allocate the worst case */
typedef union aml_resource
@@ -852,6 +848,9 @@ typedef union aml_resource
} AML_RESOURCE;
+/* restore default alignment */
+
+#pragma pack()
/* Interfaces used by both the disassembler and compiler */
diff --git a/sys/contrib/dev/acpica/include/platform/acenv.h b/sys/contrib/dev/acpica/include/platform/acenv.h
index 9ed2583aa710..b842965bfca0 100644
--- a/sys/contrib/dev/acpica/include/platform/acenv.h
+++ b/sys/contrib/dev/acpica/include/platform/acenv.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/platform/acenvex.h b/sys/contrib/dev/acpica/include/platform/acenvex.h
index 236b70f170bc..e9632619abf5 100644
--- a/sys/contrib/dev/acpica/include/platform/acenvex.h
+++ b/sys/contrib/dev/acpica/include/platform/acenvex.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/platform/acfreebsd.h b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
index e12c87546bf0..e81a5d40bcdf 100644
--- a/sys/contrib/dev/acpica/include/platform/acfreebsd.h
+++ b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/include/platform/acgcc.h b/sys/contrib/dev/acpica/include/platform/acgcc.h
index ebb4fd9063a6..39ff864fa5d7 100644
--- a/sys/contrib/dev/acpica/include/platform/acgcc.h
+++ b/sys/contrib/dev/acpica/include/platform/acgcc.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -226,4 +226,12 @@ typedef __builtin_va_list va_list;
}
#endif
+/*
+ * Explicitly mark strings that lack a terminating NUL character so
+ * that ACPICA can be built with -Wunterminated-string-initialization.
+ */
+#if __has_attribute(__nonstring__)
+#define ACPI_NONSTRING __attribute__((__nonstring__))
+#endif
+
#endif /* __ACGCC_H__ */
diff --git a/sys/contrib/dev/acpica/include/platform/acgccex.h b/sys/contrib/dev/acpica/include/platform/acgccex.h
index 4c2b241ef79b..bb3b55cf2ca6 100644
--- a/sys/contrib/dev/acpica/include/platform/acgccex.h
+++ b/sys/contrib/dev/acpica/include/platform/acgccex.h
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c b/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c
index 8fc3d3d9c90f..eb34274ce670 100644
--- a/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
index 252685a5b5f0..81cda5e4eb65 100644
--- a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
* All rights reserved.
*
* 2. License
diff --git a/sys/contrib/dev/iwlwifi/fw/uefi.h b/sys/contrib/dev/iwlwifi/fw/uefi.h
index 1f8884ca8997..50327bb8c2d6 100644
--- a/sys/contrib/dev/iwlwifi/fw/uefi.h
+++ b/sys/contrib/dev/iwlwifi/fw/uefi.h
@@ -318,7 +318,11 @@ static inline
int iwl_uefi_get_uats_table(struct iwl_trans *trans,
struct iwl_fw_runtime *fwrt)
{
+#if defined(__linux__)
return 0;
+#elif defined(__FreeBSD__)
+ return -ENOENT;
+#endif
}
#endif /* CONFIG_EFI */
#endif /* __iwl_fw_uefi__ */
diff --git a/sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware b/sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware
deleted file mode 100644
index 6bdd16d922b4..000000000000
--- a/sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware
+++ /dev/null
@@ -1,39 +0,0 @@
-Copyright (c) 2006-2021, Intel Corporation.
-All rights reserved.
-
-Redistribution. Redistribution and use in binary form, without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions must reproduce the above copyright notice and the
- following disclaimer in the documentation and/or other materials
- provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its suppliers
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-* No reverse engineering, decompilation, or disassembly of this software
- is permitted.
-
-Limited patent license. Intel Corporation grants a world-wide,
-royalty-free, non-exclusive license under patents it now or hereafter
-owns or controls to make, have made, use, import, offer to sell and
-sell ("Utilize") this software, but solely to the extent that any
-such patent is necessary to Utilize the software alone, or in
-combination with an operating system licensed under an approved Open
-Source license as listed by the Open Source Initiative at
-http://opensource.org/licenses. The patent license shall not apply to
-any other combinations which include this software. No hardware per
-se is licensed hereunder.
-
-DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
diff --git a/sys/contrib/dev/iwlwififw/WHENCE b/sys/contrib/dev/iwlwififw/WHENCE
deleted file mode 100644
index ef6fbe552049..000000000000
--- a/sys/contrib/dev/iwlwififw/WHENCE
+++ /dev/null
@@ -1,483 +0,0 @@
-Driver: iwlwifi - Intel Wireless Wifi
-
-File: iwlwifi-3945-2.ucode
-Version: 15.32.2.9
-
-File: iwlwifi-4965-2.ucode
-Version: 228.61.2.24
-
-File: iwlwifi-5000-1.ucode
-Version: 5.4.A.11 (aka 5.4.1.16)
-
-File: iwlwifi-5000-2.ucode
-Version: 8.24.2.12
-
-File: iwlwifi-5000-5.ucode
-Version: 8.83.5.1
-
-File: iwlwifi-5150-2.ucode
-Version: 8.24.2.2
-
-File: iwlwifi-1000-3.ucode
-Version: 128.50.3.1
-
-File: iwlwifi-1000-5.ucode
-Version: 39.31.5.1
-
-File: iwlwifi-6000-4.ucode
-Version: 9.221.4.1
-
-File: iwlwifi-6050-4.ucode
-Version: 9.201.4.1
-
-File: iwlwifi-6050-5.ucode
-Version: 41.28.5.1
-
-File: iwlwifi-6000g2a-5.ucode
-Version: 17.168.5.3
-
-File: iwlwifi-6000g2a-6.ucode
-Version: 18.168.6.1
-
-File: iwlwifi-6000g2b-5.ucode
-Version: 17.168.5.1
-
-File: iwlwifi-6000g2b-6.ucode
-Version: 18.168.6.1
-
-File: iwlwifi-135-6.ucode
-Version: 18.168.6.1
-
-File: iwlwifi-100-5.ucode
-Version: 39.31.5.1
-
-File: iwlwifi-105-6.ucode
-Version: 18.168.6.1
-
-File: iwlwifi-2030-6.ucode
-Version: 18.168.6.1
-
-File: iwlwifi-2000-6.ucode
-Version: 18.168.6.1
-
-File: iwlwifi-7260-17.ucode
-Version: 17.bfb58538.0
-
-File: iwlwifi-3160-17.ucode
-Version: 17.bfb58538.0
-
-File: iwlwifi-7265-17.ucode
-Version: 17.bfb58538.0
-
-File: iwlwifi-7265D-22.ucode
-Version: 22.391740.0
-
-File: iwlwifi-7265D-27.ucode
-Version: 27.541033.0
-
-File: iwlwifi-7265D-29.ucode
-Version: 29.f2390aa8.0
-
-File: iwlwifi-3168-22.ucode
-Version: 22.391740.0
-
-File: iwlwifi-3168-27.ucode
-Version: 27.541033.0
-
-File: iwlwifi-3168-29.ucode
-Version: 29.0bd893f3.0
-
-File: iwlwifi-8000C-22.ucode
-Version: 22.391740.0
-
-File: iwlwifi-8000C-27.ucode
-Version: 27.541033.0
-
-File: iwlwifi-8000C-31.ucode
-Version: 31.560484.0
-
-File: iwlwifi-8000C-34.ucode
-Version: 34.610288.0
-
-File: iwlwifi-8000C-36.ucode
-Version: 36.ca7b901d.0
-
-File: iwlwifi-8265-22.ucode
-Version: 22.391740.0
-
-File: iwlwifi-8265-27.ucode
-Version: 27.541033.0
-
-File: iwlwifi-8265-31.ucode
-Version: 31.560484.0
-
-File: iwlwifi-8265-34.ucode
-Version: 34.610288.0
-
-File: iwlwifi-8265-36.ucode
-Version: 36.ca7b901d.0
-
-File: iwlwifi-9000-pu-b0-jf-b0-33.ucode
-Version: 33.610294.0
-
-File: iwlwifi-9000-pu-b0-jf-b0-34.ucode
-Version: 34.ba501b11.0
-
-File: iwlwifi-9000-pu-b0-jf-b0-38.ucode
-Version: 38.755cfdd8.0
-
-File: iwlwifi-9000-pu-b0-jf-b0-41.ucode
-Version: 41.fc1a7aea.0
-
-File: iwlwifi-9000-pu-b0-jf-b0-43.ucode
-Version: 43.95eb4e97.0
-
-File: iwlwifi-9000-pu-b0-jf-b0-46.ucode
-Version: 46.9d0122c0.0
-
-File: iwlwifi-9260-th-b0-jf-b0-33.ucode
-Version: 33.610294.0
-
-File: iwlwifi-9260-th-b0-jf-b0-34.ucode
-Version: 34.ba501b11.0
-
-File: iwlwifi-9260-th-b0-jf-b0-38.ucode
-Version: 38.755cfdd8.0
-
-File: iwlwifi-9260-th-b0-jf-b0-41.ucode
-Version: 41.fc1a7aea.0
-
-File: iwlwifi-9260-th-b0-jf-b0-43.ucode
-Version: 43.95eb4e97.0
-
-File: iwlwifi-9260-th-b0-jf-b0-46.ucode
-Version: 46.9d0122c0.0
-
-File: iwlwifi-cc-a0-46.ucode
-Version: 46.3cfab8da.0
-
-File: iwlwifi-cc-a0-48.ucode
-Version: 48.4fa0041f.0
-
-File: iwlwifi-Qu-b0-hr-b0-48.ucode
-Version: 48.4fa0041f.0
-
-File: iwlwifi-Qu-b0-jf-b0-48.ucode
-Version: 48.4fa0041f.0
-
-File: iwlwifi-Qu-c0-hr-b0-48.ucode
-Version: 48.4fa0041f.0
-
-File: iwlwifi-Qu-c0-jf-b0-48.ucode
-Version: 48.4fa0041f.0
-
-File: iwlwifi-QuZ-a0-hr-b0-48.ucode
-Version: 48.4fa0041f.0
-
-File: iwlwifi-QuZ-a0-jf-b0-48.ucode
-Version: 48.4fa0041f.0
-
-File: iwlwifi-cc-a0-50.ucode
-Version: 50.3e391d3e.0
-
-File: iwlwifi-Qu-b0-hr-b0-50.ucode
-Version: 50.3e391d3e.0
-
-File: iwlwifi-Qu-b0-jf-b0-50.ucode
-Version: 50.3e391d3e.0
-
-File: iwlwifi-Qu-c0-hr-b0-50.ucode
-Version: 50.3e391d3e.0
-
-File: iwlwifi-Qu-c0-jf-b0-50.ucode
-Version: 50.3e391d3e.0
-
-File: iwlwifi-QuZ-a0-hr-b0-50.ucode
-Version: 50.3e391d3e.0
-
-File: iwlwifi-QuZ-a0-jf-b0-50.ucode
-Version: 50.3e391d3e.0
-
-File: iwlwifi-cc-a0-53.ucode
-Version: 53.c31ac674.0
-
-File: iwlwifi-Qu-b0-hr-b0-53.ucode
-Version: 53.c31ac674.0
-
-File: iwlwifi-Qu-b0-jf-b0-53.ucode
-Version: 53.c31ac674.0
-
-File: iwlwifi-Qu-c0-hr-b0-53.ucode
-Version: 53.c31ac674.0
-
-File: iwlwifi-Qu-c0-jf-b0-53.ucode
-Version: 53.c31ac674.0
-
-File: iwlwifi-QuZ-a0-hr-b0-53.ucode
-Version: 53.c31ac674.0
-
-File: iwlwifi-QuZ-a0-jf-b0-53.ucode
-Version: 53.c31ac674.0
-
-File: iwlwifi-cc-a0-55.ucode
-Version: 55.d9698065.0
-
-File: iwlwifi-Qu-b0-hr-b0-55.ucode
-Version: 55.d9698065.0
-
-File: iwlwifi-Qu-b0-jf-b0-55.ucode
-Version: 55.d9698065.0
-
-File: iwlwifi-Qu-c0-hr-b0-55.ucode
-Version: 55.d9698065.0
-
-File: iwlwifi-Qu-c0-jf-b0-55.ucode
-Version: 55.d9698065.0
-
-File: iwlwifi-QuZ-a0-hr-b0-55.ucode
-Version: 55.d9698065.0
-
-File: iwlwifi-QuZ-a0-jf-b0-55.ucode
-Version: 55.d9698065.0
-
-File: iwlwifi-cc-a0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-Qu-b0-hr-b0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-Qu-b0-jf-b0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-Qu-c0-hr-b0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-Qu-c0-jf-b0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-QuZ-a0-hr-b0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-QuZ-a0-jf-b0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-so-a0-gf-a0-64.ucode
-Version: 64.97bbee0a.0
-
-File: iwlwifi-so-a0-gf-a0-67.ucode
-Version: 67.8f59b80b.0
-
-File: iwlwifi-so-a0-gf4-a0-67.ucode
-Version: 67.8f59b80b.0
-
-File: iwlwifi-so-a0-gf-a0.pnvm
-
-File: iwlwifi-so-a0-gf4-a0.pnvm
-
-File: iwlwifi-so-a0-hr-b0-64.ucode
-Version: 64.97bbee0a.0
-
-File: iwlwifi-so-a0-jf-b0-64.ucode
-Version: 64.97bbee0a.0
-
-File: iwlwifi-ty-a0-gf-a0-59.ucode
-Version: 59.601f3a66.0
-
-File: iwlwifi-cc-a0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-Qu-b0-hr-b0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-Qu-b0-jf-b0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-Qu-c0-hr-b0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-Qu-c0-jf-b0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-QuZ-a0-hr-b0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-QuZ-a0-jf-b0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-ty-a0-gf-a0-62.ucode
-Version: 62.49eeb572.0
-
-File: iwlwifi-cc-a0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-cc-a0-67.ucode
-Version: 67.8f59b80b.0
-
-File: iwlwifi-Qu-b0-hr-b0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-Qu-b0-jf-b0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-Qu-c0-hr-b0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-Qu-c0-jf-b0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-QuZ-a0-hr-b0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-QuZ-a0-hr-b0-67.ucode
-Version: 67.8f59b80b.0
-
-File: iwlwifi-QuZ-a0-jf-b0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-ty-a0-gf-a0-63.ucode
-Version: 63.c04f3485.0
-
-File: iwlwifi-cc-a0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-Qu-b0-hr-b0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-Qu-b0-jf-b0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-Qu-c0-hr-b0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-Qu-c0-jf-b0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-QuZ-a0-hr-b0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-QuZ-a0-jf-b0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-ty-a0-gf-a0-66.ucode
-Version: 66.f1c864e0.0
-
-File: iwlwifi-ty-a0-gf-a0-67.ucode
-Version: 67.8f59b80b.0
-
-File: iwlwifi-cc-a0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-Qu-b0-hr-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-Qu-b0-jf-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-Qu-c0-hr-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-Qu-c0-jf-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-QuZ-a0-hr-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-QuZ-a0-jf-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-ty-a0-gf-a0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-so-a0-gf4-a0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-so-a0-gf-a0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-so-a0-hr-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-so-a0-jf-b0-68.ucode
-Version: 68.01d30b0c.0
-
-File: iwlwifi-cc-a0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-Qu-b0-hr-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-Qu-b0-jf-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-Qu-c0-hr-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-Qu-c0-jf-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-QuZ-a0-hr-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-QuZ-a0-jf-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-ty-a0-gf-a0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-so-a0-gf4-a0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-so-a0-gf-a0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-so-a0-hr-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-so-a0-jf-b0-71.ucode
-Version: 71.058653f6.0
-
-File: iwlwifi-cc-a0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-Qu-b0-hr-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-Qu-b0-jf-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-Qu-c0-hr-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-Qu-c0-jf-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-QuZ-a0-hr-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-QuZ-a0-jf-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-ty-a0-gf-a0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-so-a0-gf4-a0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-so-a0-gf-a0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-so-a0-hr-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-so-a0-jf-b0-73.ucode
-Version: 73.35c0a2c6.0
-
-File: iwlwifi-so-a0-gf-a0.pnvm
-
-File: iwlwifi-so-a0-gf4-a0.pnvm
-
-File: iwlwifi-ty-a0-gf-a0.pnvm
-
-Licence: Redistributable. See LICENCE.iwlwifi_firmware for details
-
-Also available from http://wireless.kernel.org/en/users/Drivers/iwlwifi#Firmware
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-3160-17.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-3160-17.ucode
deleted file mode 100644
index 95b26df9d56d..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-3160-17.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-3168-29.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-3168-29.ucode
deleted file mode 100644
index 1759561ec203..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-3168-29.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-7260-17.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-7260-17.ucode
deleted file mode 100644
index b1a87d52cdd1..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-7260-17.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-7265-17.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-7265-17.ucode
deleted file mode 100644
index f4a549cce6ed..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-7265-17.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-7265D-29.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-7265D-29.ucode
deleted file mode 100644
index 7c513f669790..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-7265D-29.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-8000C-36.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-8000C-36.ucode
deleted file mode 100644
index e4988f6b421e..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-8000C-36.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-8265-36.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-8265-36.ucode
deleted file mode 100644
index 60fda3b7d45b..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-8265-36.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-46.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-46.ucode
deleted file mode 100644
index 9af424f1ce06..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-46.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-9260-th-b0-jf-b0-46.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-9260-th-b0-jf-b0-46.ucode
deleted file mode 100644
index 4c2b25e585cb..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-9260-th-b0-jf-b0-46.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-hr-b0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-hr-b0-77.ucode
deleted file mode 100644
index de6cd8b98985..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-hr-b0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-jf-b0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-jf-b0-77.ucode
deleted file mode 100644
index ad87490d470b..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-b0-jf-b0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-hr-b0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-hr-b0-77.ucode
deleted file mode 100644
index 37e1c7af3f16..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-hr-b0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-jf-b0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-jf-b0-77.ucode
deleted file mode 100644
index bd0b2b249894..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-Qu-c0-jf-b0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-hr-b0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-hr-b0-77.ucode
deleted file mode 100644
index 256997390af6..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-hr-b0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-jf-b0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-jf-b0-77.ucode
deleted file mode 100644
index 7c2a06a2dd2e..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-QuZ-a0-jf-b0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-cc-a0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-cc-a0-77.ucode
deleted file mode 100644
index d138e34af24d..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-cc-a0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucode
deleted file mode 100644
index a1444bab2622..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvm b/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvm
deleted file mode 100644
index 3cdb0b522b22..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvm
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0-83.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0-83.ucode
deleted file mode 100644
index dbb15f487716..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0-83.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0.pnvm b/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0.pnvm
deleted file mode 100644
index 9dad35a1f5f5..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf-a0.pnvm
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0-83.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0-83.ucode
deleted file mode 100644
index 1bc07d83ac07..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0-83.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0.pnvm b/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0.pnvm
deleted file mode 100644
index 86b9a7c63776..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-gf4-a0.pnvm
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-hr-b0-81.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-hr-b0-81.ucode
deleted file mode 100644
index fc8558c6cc90..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-hr-b0-81.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-jf-b0-77.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-jf-b0-77.ucode
deleted file mode 100644
index 3649a1c89238..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-so-a0-jf-b0-77.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0-83.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0-83.ucode
deleted file mode 100644
index 3fdd6d5a0d9a..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0-83.ucode
+++ /dev/null
Binary files differ
diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0.pnvm b/sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0.pnvm
deleted file mode 100644
index 68b8668df93d..000000000000
--- a/sys/contrib/dev/iwlwififw/iwlwifi-ty-a0-gf-a0.pnvm
+++ /dev/null
Binary files differ
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index d35504127c9c..106ec9038820 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -614,12 +614,13 @@ bus_get_cpus_t acpi_get_cpus;
* ARM specific ACPI interfaces, relating to IORT table.
*/
int acpi_iort_map_pci_msi(u_int seg, u_int rid, u_int *xref, u_int *devid);
-int acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *devid);
+int acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, uint64_t *xref,
+ u_int *devid);
int acpi_iort_its_lookup(u_int its_id, u_int *xref, int *pxm);
int acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref,
u_int *devid);
-int acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref,
- u_int *devid);
+int acpi_iort_map_named_smmuv3(const char *devname, u_int rid,
+ uint64_t *xref, u_int *devid);
#endif
#endif /* _KERNEL */
#endif /* !_ACPIVAR_H_ */
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c
index 85d9061759c4..53d47c26b53d 100644
--- a/sys/dev/fdt/fdt_common.c
+++ b/sys/dev/fdt/fdt_common.c
@@ -62,10 +62,6 @@
SYSCTL_NODE(_hw, OID_AUTO, fdt, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
"Flattened Device Tree");
-vm_paddr_t fdt_immr_pa;
-vm_offset_t fdt_immr_va;
-vm_offset_t fdt_immr_size;
-
struct fdt_ic_list fdt_ic_list_head = SLIST_HEAD_INITIALIZER(fdt_ic_list_head);
static int
@@ -200,38 +196,6 @@ fdt_get_range(phandle_t node, int range_id, u_long *base, u_long *size)
}
int
-fdt_immr_addr(vm_offset_t immr_va)
-{
- phandle_t node;
- u_long base, size;
- int r;
-
- /*
- * Try to access the SOC node directly i.e. through /aliases/.
- */
- if ((node = OF_finddevice("soc")) != -1)
- if (ofw_bus_node_is_compatible(node, "simple-bus"))
- goto moveon;
- /*
- * Find the node the long way.
- */
- if ((node = OF_finddevice("/")) == -1)
- return (ENXIO);
-
- if ((node = fdt_find_compatible(node, "simple-bus", 0)) == 0)
- return (ENXIO);
-
-moveon:
- if ((r = fdt_get_range(node, 0, &base, &size)) == 0) {
- fdt_immr_pa = base;
- fdt_immr_va = immr_va;
- fdt_immr_size = size;
- }
-
- return (r);
-}
-
-int
fdt_is_compatible_strict(phandle_t node, const char *compatible)
{
char compat[FDT_COMPAT_LEN];
@@ -303,13 +267,13 @@ fdt_parent_addr_cells(phandle_t node)
}
u_long
-fdt_data_get(void *data, int cells)
+fdt_data_get(const void *data, int cells)
{
if (cells == 1)
- return (fdt32_to_cpu(*((uint32_t *)data)));
+ return (fdt32_to_cpu(*((const uint32_t *)data)));
- return (fdt64_to_cpu(*((uint64_t *)data)));
+ return (fdt64_to_cpu(*((const uint64_t *)data)));
}
int
@@ -336,22 +300,22 @@ fdt_addrsize_cells(phandle_t node, int *addr_cells, int *size_cells)
}
int
-fdt_data_to_res(pcell_t *data, int addr_cells, int size_cells, u_long *start,
- u_long *count)
+fdt_data_to_res(const pcell_t *data, int addr_cells, int size_cells,
+ u_long *start, u_long *count)
{
/* Address portion. */
if (addr_cells > 2)
return (ERANGE);
- *start = fdt_data_get((void *)data, addr_cells);
+ *start = fdt_data_get((const void *)data, addr_cells);
data += addr_cells;
/* Size portion. */
if (size_cells > 2)
return (ERANGE);
- *count = fdt_data_get((void *)data, size_cells);
+ *count = fdt_data_get((const void *)data, size_cells);
return (0);
}
@@ -443,8 +407,9 @@ fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc)
}
int
-fdt_get_reserved_regions(struct mem_region *mr, int *mrcnt)
+fdt_foreach_reserved_region(fdt_mem_region_cb cb, void *arg)
{
+ struct mem_region mr;
pcell_t reserve[FDT_REG_CELLS * FDT_MEM_REGIONS];
pcell_t *reservep;
phandle_t memory, root;
@@ -453,64 +418,55 @@ fdt_get_reserved_regions(struct mem_region *mr, int *mrcnt)
root = OF_finddevice("/");
memory = OF_finddevice("/memory");
- if (memory == -1) {
- rv = ENXIO;
- goto out;
- }
+ if (memory == -1)
+ return (ENXIO);
if ((rv = fdt_addrsize_cells(OF_parent(memory), &addr_cells,
&size_cells)) != 0)
- goto out;
+ return (rv);
- if (addr_cells > 2) {
- rv = ERANGE;
- goto out;
- }
+ if (addr_cells > 2)
+ return (ERANGE);
tuple_size = sizeof(pcell_t) * (addr_cells + size_cells);
res_len = OF_getproplen(root, "memreserve");
- if (res_len <= 0 || res_len > sizeof(reserve)) {
- rv = ERANGE;
- goto out;
- }
+ if (res_len <= 0 || res_len > sizeof(reserve))
+ return (ERANGE);
- if (OF_getprop(root, "memreserve", reserve, res_len) <= 0) {
- rv = ENXIO;
- goto out;
- }
+ if (OF_getprop(root, "memreserve", reserve, res_len) <= 0)
+ return (ENXIO);
tuples = res_len / tuple_size;
reservep = (pcell_t *)&reserve;
for (i = 0; i < tuples; i++) {
rv = fdt_data_to_res(reservep, addr_cells, size_cells,
- (u_long *)&mr[i].mr_start, (u_long *)&mr[i].mr_size);
+ (u_long *)&mr.mr_start, (u_long *)&mr.mr_size);
if (rv != 0)
- goto out;
+ return (rv);
+
+ cb(&mr, arg);
reservep += addr_cells + size_cells;
}
- *mrcnt = i;
- rv = 0;
-out:
- return (rv);
+ return (0);
}
int
-fdt_get_reserved_mem(struct mem_region *reserved, int *mreserved)
+fdt_foreach_reserved_mem(fdt_mem_region_cb cb, void *arg)
{
+ struct mem_region mr;
pcell_t reg[FDT_REG_CELLS];
phandle_t child, root;
int addr_cells, size_cells;
- int i, rv;
+ int rv;
root = OF_finddevice("/reserved-memory");
- if (root == -1) {
+ if (root == -1)
return (ENXIO);
- }
if ((rv = fdt_addrsize_cells(root, &addr_cells, &size_cells)) != 0)
return (rv);
@@ -519,7 +475,6 @@ fdt_get_reserved_mem(struct mem_region *reserved, int *mreserved)
panic("Too many address and size cells %d %d", addr_cells,
size_cells);
- i = 0;
for (child = OF_child(root); child != 0; child = OF_peer(child)) {
if (!OF_hasprop(child, "no-map"))
continue;
@@ -530,79 +485,59 @@ fdt_get_reserved_mem(struct mem_region *reserved, int *mreserved)
continue;
fdt_data_to_res(reg, addr_cells, size_cells,
- (u_long *)&reserved[i].mr_start,
- (u_long *)&reserved[i].mr_size);
- i++;
- }
+ (u_long *)&mr.mr_start, (u_long *)&mr.mr_size);
- *mreserved = i;
+ cb(&mr, arg);
+ }
return (0);
}
int
-fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, uint64_t *memsize)
+fdt_foreach_mem_region(fdt_mem_region_cb cb, void *arg)
{
+ struct mem_region mr;
pcell_t reg[FDT_REG_CELLS * FDT_MEM_REGIONS];
pcell_t *regp;
phandle_t memory;
- uint64_t memory_size;
int addr_cells, size_cells;
int i, reg_len, rv, tuple_size, tuples;
memory = OF_finddevice("/memory");
- if (memory == -1) {
- rv = ENXIO;
- goto out;
- }
+ if (memory == -1)
+ return (ENXIO);
if ((rv = fdt_addrsize_cells(OF_parent(memory), &addr_cells,
&size_cells)) != 0)
- goto out;
+ return (rv);
- if (addr_cells > 2) {
- rv = ERANGE;
- goto out;
- }
+ if (addr_cells > 2)
+ return (ERANGE);
tuple_size = sizeof(pcell_t) * (addr_cells + size_cells);
reg_len = OF_getproplen(memory, "reg");
- if (reg_len <= 0 || reg_len > sizeof(reg)) {
- rv = ERANGE;
- goto out;
- }
+ if (reg_len <= 0 || reg_len > sizeof(reg))
+ return (ERANGE);
- if (OF_getprop(memory, "reg", reg, reg_len) <= 0) {
- rv = ENXIO;
- goto out;
- }
+ if (OF_getprop(memory, "reg", reg, reg_len) <= 0)
+ return (ENXIO);
- memory_size = 0;
tuples = reg_len / tuple_size;
regp = (pcell_t *)&reg;
for (i = 0; i < tuples; i++) {
rv = fdt_data_to_res(regp, addr_cells, size_cells,
- (u_long *)&mr[i].mr_start, (u_long *)&mr[i].mr_size);
+ (u_long *)&mr.mr_start, (u_long *)&mr.mr_size);
if (rv != 0)
- goto out;
+ return (rv);
- regp += addr_cells + size_cells;
- memory_size += mr[i].mr_size;
- }
+ cb(&mr, arg);
- if (memory_size == 0) {
- rv = ERANGE;
- goto out;
+ regp += addr_cells + size_cells;
}
- *mrcnt = i;
- if (memsize != NULL)
- *memsize = memory_size;
- rv = 0;
-out:
- return (rv);
+ return (0);
}
int
diff --git a/sys/dev/fdt/fdt_common.h b/sys/dev/fdt/fdt_common.h
index de0bee5bd003..ece54290a6ad 100644
--- a/sys/dev/fdt/fdt_common.h
+++ b/sys/dev/fdt/fdt_common.h
@@ -36,7 +36,7 @@
#include <contrib/libfdt/libfdt_env.h>
#include <dev/ofw/ofw_bus.h>
-#define FDT_MEM_REGIONS 16
+#define FDT_MEM_REGIONS 64
#define DI_MAX_INTR_NUM 32
@@ -66,24 +66,22 @@ struct fdt_ic {
device_t dev;
};
-extern vm_paddr_t fdt_immr_pa;
-extern vm_offset_t fdt_immr_va;
-extern vm_offset_t fdt_immr_size;
-
#if defined(FDT_DTB_STATIC)
extern u_char fdt_static_dtb;
#endif
SYSCTL_DECL(_hw_fdt);
+typedef void (*fdt_mem_region_cb)(const struct mem_region *, void *);
+
int fdt_addrsize_cells(phandle_t, int *, int *);
-u_long fdt_data_get(void *, int);
-int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *);
+u_long fdt_data_get(const void *, int);
+int fdt_data_to_res(const pcell_t *, int, int, u_long *, u_long *);
phandle_t fdt_find_compatible(phandle_t, const char *, int);
phandle_t fdt_depth_search_compatible(phandle_t, const char *, int);
-int fdt_get_mem_regions(struct mem_region *, int *, uint64_t *);
-int fdt_get_reserved_mem(struct mem_region *, int *);
-int fdt_get_reserved_regions(struct mem_region *, int *);
+int fdt_foreach_mem_region(fdt_mem_region_cb, void *);
+int fdt_foreach_reserved_mem(fdt_mem_region_cb, void *);
+int fdt_foreach_reserved_region(fdt_mem_region_cb, void *);
int fdt_get_phyaddr(phandle_t, device_t, int *, void **);
int fdt_get_range(phandle_t, int, u_long *, u_long *);
int fdt_immr_addr(vm_offset_t);
diff --git a/sys/dev/fdt/fdt_slicer.c b/sys/dev/fdt/fdt_slicer.c
index 5c1d11cfdcf5..3ba4eddf8b61 100644
--- a/sys/dev/fdt/fdt_slicer.c
+++ b/sys/dev/fdt/fdt_slicer.c
@@ -156,12 +156,12 @@ fdt_slicer_cleanup(void)
}
/*
- * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_SECOND),
+ * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_THIRD),
* i. e. after g_init() is called, due to the use of the GEOM topology_lock
* in flash_register_slicer(). However, must be before SI_SUB_CONFIGURE.
*/
-SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_init, NULL);
-SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_cleanup, NULL);
+SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_FOURTH, fdt_slicer_init, NULL);
+SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_FOURTH, fdt_slicer_cleanup, NULL);
static int
mod_handler(module_t mod, int type, void *data)
@@ -178,6 +178,6 @@ static moduledata_t fdt_slicer_mod = {
"fdt_slicer", mod_handler, NULL
};
-DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_FOURTH);
MODULE_DEPEND(fdt_slicer, geom_flashmap, 0, 0, 0);
MODULE_VERSION(fdt_slicer, 1);
diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h
index 39965c8669cf..5b298b889ed6 100644
--- a/sys/dev/gve/gve.h
+++ b/sys/dev/gve/gve.h
@@ -63,6 +63,10 @@
*/
#define GVE_QPL_DIVISOR 16
+/* Ring Size Limits */
+#define GVE_DEFAULT_MIN_RX_RING_SIZE 512
+#define GVE_DEFAULT_MIN_TX_RING_SIZE 256
+
static MALLOC_DEFINE(M_GVE, "gve", "gve allocations");
struct gve_dma_handle {
@@ -529,12 +533,17 @@ struct gve_priv {
uint16_t num_event_counters;
uint16_t default_num_queues;
uint16_t tx_desc_cnt;
+ uint16_t max_tx_desc_cnt;
+ uint16_t min_tx_desc_cnt;
uint16_t rx_desc_cnt;
+ uint16_t max_rx_desc_cnt;
+ uint16_t min_rx_desc_cnt;
uint16_t rx_pages_per_qpl;
uint64_t max_registered_pages;
uint64_t num_registered_pages;
uint32_t supported_features;
uint16_t max_mtu;
+ bool modify_ringsize_enabled;
struct gve_dma_handle counter_array_mem;
__be32 *counters;
@@ -542,7 +551,6 @@ struct gve_priv {
struct gve_irq_db *irq_db_indices;
enum gve_queue_format queue_format;
- struct gve_queue_page_list *qpls;
struct gve_queue_config tx_cfg;
struct gve_queue_config rx_cfg;
uint32_t num_queues;
@@ -621,6 +629,9 @@ gve_is_qpl(struct gve_priv *priv)
/* Defined in gve_main.c */
void gve_schedule_reset(struct gve_priv *priv);
+int gve_adjust_tx_queues(struct gve_priv *priv, uint16_t new_queue_cnt);
+int gve_adjust_rx_queues(struct gve_priv *priv, uint16_t new_queue_cnt);
+int gve_adjust_ring_sizes(struct gve_priv *priv, uint16_t new_desc_cnt, bool is_rx);
/* Register access functions defined in gve_utils.c */
uint32_t gve_reg_bar_read_4(struct gve_priv *priv, bus_size_t offset);
@@ -629,15 +640,16 @@ void gve_db_bar_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val);
void gve_db_bar_dqo_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val);
/* QPL (Queue Page List) functions defined in gve_qpl.c */
-int gve_alloc_qpls(struct gve_priv *priv);
-void gve_free_qpls(struct gve_priv *priv);
+struct gve_queue_page_list *gve_alloc_qpl(struct gve_priv *priv, uint32_t id,
+ int npages, bool single_kva);
+void gve_free_qpl(struct gve_priv *priv, struct gve_queue_page_list *qpl);
int gve_register_qpls(struct gve_priv *priv);
int gve_unregister_qpls(struct gve_priv *priv);
void gve_mextadd_free(struct mbuf *mbuf);
/* TX functions defined in gve_tx.c */
-int gve_alloc_tx_rings(struct gve_priv *priv);
-void gve_free_tx_rings(struct gve_priv *priv);
+int gve_alloc_tx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx);
+void gve_free_tx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx);
int gve_create_tx_rings(struct gve_priv *priv);
int gve_destroy_tx_rings(struct gve_priv *priv);
int gve_tx_intr(void *arg);
@@ -656,8 +668,8 @@ int gve_xmit_dqo_qpl(struct gve_tx_ring *tx, struct mbuf *mbuf);
void gve_tx_cleanup_tq_dqo(void *arg, int pending);
/* RX functions defined in gve_rx.c */
-int gve_alloc_rx_rings(struct gve_priv *priv);
-void gve_free_rx_rings(struct gve_priv *priv);
+int gve_alloc_rx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx);
+void gve_free_rx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx);
int gve_create_rx_rings(struct gve_priv *priv);
int gve_destroy_rx_rings(struct gve_priv *priv);
int gve_rx_intr(void *arg);
diff --git a/sys/dev/gve/gve_adminq.c b/sys/dev/gve/gve_adminq.c
index dd03f817f45a..3415d2fa4b60 100644
--- a/sys/dev/gve/gve_adminq.c
+++ b/sys/dev/gve/gve_adminq.c
@@ -59,6 +59,7 @@ void gve_parse_device_option(struct gve_priv *priv,
struct gve_device_option_gqi_qpl **dev_op_gqi_qpl,
struct gve_device_option_dqo_rda **dev_op_dqo_rda,
struct gve_device_option_dqo_qpl **dev_op_dqo_qpl,
+ struct gve_device_option_modify_ring **dev_op_modify_ring,
struct gve_device_option_jumbo_frames **dev_op_jumbo_frames)
{
uint32_t req_feat_mask = be32toh(option->required_features_mask);
@@ -121,6 +122,34 @@ void gve_parse_device_option(struct gve_priv *priv,
*dev_op_dqo_qpl = (void *)(option + 1);
break;
+ case GVE_DEV_OPT_ID_MODIFY_RING:
+ if (option_length < (sizeof(**dev_op_modify_ring) -
+ sizeof(struct gve_ring_size_bound)) ||
+ req_feat_mask != GVE_DEV_OPT_REQ_FEAT_MASK_MODIFY_RING) {
+ device_printf(priv->dev, GVE_DEVICE_OPTION_ERROR_FMT,
+ "Modify Ring", (int)sizeof(**dev_op_modify_ring),
+ GVE_DEV_OPT_REQ_FEAT_MASK_MODIFY_RING,
+ option_length, req_feat_mask);
+ break;
+ }
+
+ if (option_length > sizeof(**dev_op_modify_ring)) {
+ device_printf(priv->dev, GVE_DEVICE_OPTION_TOO_BIG_FMT,
+ "Modify Ring");
+ }
+ *dev_op_modify_ring = (void *)(option + 1);
+
+ /* Min ring size included; set the minimum ring size. */
+ if (option_length == sizeof(**dev_op_modify_ring)) {
+ priv->min_rx_desc_cnt = max(
+ be16toh((*dev_op_modify_ring)->min_ring_size.rx),
+ GVE_DEFAULT_MIN_RX_RING_SIZE);
+ priv->min_tx_desc_cnt = max(
+ be16toh((*dev_op_modify_ring)->min_ring_size.tx),
+ GVE_DEFAULT_MIN_TX_RING_SIZE);
+ }
+ break;
+
case GVE_DEV_OPT_ID_JUMBO_FRAMES:
if (option_length < sizeof(**dev_op_jumbo_frames) ||
req_feat_mask != GVE_DEV_OPT_REQ_FEAT_MASK_JUMBO_FRAMES) {
@@ -155,6 +184,7 @@ gve_process_device_options(struct gve_priv *priv,
struct gve_device_option_gqi_qpl **dev_op_gqi_qpl,
struct gve_device_option_dqo_rda **dev_op_dqo_rda,
struct gve_device_option_dqo_qpl **dev_op_dqo_qpl,
+ struct gve_device_option_modify_ring **dev_op_modify_ring,
struct gve_device_option_jumbo_frames **dev_op_jumbo_frames)
{
char *desc_end = (char *)descriptor + be16toh(descriptor->total_length);
@@ -176,6 +206,7 @@ gve_process_device_options(struct gve_priv *priv,
dev_op_gqi_qpl,
dev_op_dqo_rda,
dev_op_dqo_qpl,
+ dev_op_modify_ring,
dev_op_jumbo_frames);
dev_opt = (void *)((char *)(dev_opt + 1) + be16toh(dev_opt->option_length));
}
@@ -390,8 +421,18 @@ gve_adminq_set_mtu(struct gve_priv *priv, uint32_t mtu) {
static void
gve_enable_supported_features(struct gve_priv *priv,
uint32_t supported_features_mask,
+ const struct gve_device_option_modify_ring *dev_op_modify_ring,
const struct gve_device_option_jumbo_frames *dev_op_jumbo_frames)
{
+ if (dev_op_modify_ring &&
+ (supported_features_mask & GVE_SUP_MODIFY_RING_MASK)) {
+ if (bootverbose)
+ device_printf(priv->dev, "MODIFY RING device option enabled.\n");
+ priv->modify_ringsize_enabled = true;
+ priv->max_rx_desc_cnt = be16toh(dev_op_modify_ring->max_ring_size.rx);
+ priv->max_tx_desc_cnt = be16toh(dev_op_modify_ring->max_ring_size.tx);
+ }
+
if (dev_op_jumbo_frames &&
(supported_features_mask & GVE_SUP_JUMBO_FRAMES_MASK)) {
if (bootverbose)
@@ -410,6 +451,7 @@ gve_adminq_describe_device(struct gve_priv *priv)
struct gve_device_option_gqi_qpl *dev_op_gqi_qpl = NULL;
struct gve_device_option_dqo_rda *dev_op_dqo_rda = NULL;
struct gve_device_option_dqo_qpl *dev_op_dqo_qpl = NULL;
+ struct gve_device_option_modify_ring *dev_op_modify_ring = NULL;
struct gve_device_option_jumbo_frames *dev_op_jumbo_frames = NULL;
uint32_t supported_features_mask = 0;
int rc;
@@ -438,10 +480,15 @@ gve_adminq_describe_device(struct gve_priv *priv)
bus_dmamap_sync(desc_mem.tag, desc_mem.map, BUS_DMASYNC_POSTREAD);
+ /* Default min in case device options don't have min values */
+ priv->min_rx_desc_cnt = GVE_DEFAULT_MIN_RX_RING_SIZE;
+ priv->min_tx_desc_cnt = GVE_DEFAULT_MIN_TX_RING_SIZE;
+
rc = gve_process_device_options(priv, desc,
&dev_op_gqi_qpl,
&dev_op_dqo_rda,
&dev_op_dqo_qpl,
+ &dev_op_modify_ring,
&dev_op_jumbo_frames);
if (rc != 0)
goto free_device_descriptor;
@@ -489,8 +536,12 @@ gve_adminq_describe_device(struct gve_priv *priv)
priv->default_num_queues = be16toh(desc->default_num_queues);
priv->supported_features = supported_features_mask;
+ /* Default max to current in case modify ring size option is disabled */
+ priv->max_rx_desc_cnt = priv->rx_desc_cnt;
+ priv->max_tx_desc_cnt = priv->tx_desc_cnt;
+
gve_enable_supported_features(priv, supported_features_mask,
- dev_op_jumbo_frames);
+ dev_op_modify_ring, dev_op_jumbo_frames);
for (i = 0; i < ETHER_ADDR_LEN; i++)
priv->mac[i] = desc->mac[i];
diff --git a/sys/dev/gve/gve_adminq.h b/sys/dev/gve/gve_adminq.h
index 37a7cb3ecbb8..bc51046a3037 100644
--- a/sys/dev/gve/gve_adminq.h
+++ b/sys/dev/gve/gve_adminq.h
@@ -153,13 +153,21 @@ struct gve_device_option_dqo_qpl {
_Static_assert(sizeof(struct gve_device_option_dqo_qpl) == 8,
"gve: bad admin queue struct length");
+struct gve_ring_size_bound {
+ __be16 rx;
+ __be16 tx;
+};
+
+_Static_assert(sizeof(struct gve_ring_size_bound) == 4,
+ "gve: bad admin queue struct length");
+
struct gve_device_option_modify_ring {
__be32 supported_features_mask;
- __be16 max_rx_ring_size;
- __be16 max_tx_ring_size;
+ struct gve_ring_size_bound max_ring_size;
+ struct gve_ring_size_bound min_ring_size;
};
-_Static_assert(sizeof(struct gve_device_option_modify_ring) == 8,
+_Static_assert(sizeof(struct gve_device_option_modify_ring) == 12,
"gve: bad admin queue struct length");
struct gve_device_option_jumbo_frames {
diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c
index 8e764f9660d7..8a00deedef36 100644
--- a/sys/dev/gve/gve_main.c
+++ b/sys/dev/gve/gve_main.c
@@ -32,10 +32,10 @@
#include "gve_adminq.h"
#include "gve_dqo.h"
-#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.2\n"
+#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.3\n"
#define GVE_VERSION_MAJOR 1
#define GVE_VERSION_MINOR 3
-#define GVE_VERSION_SUB 2
+#define GVE_VERSION_SUB 3
#define GVE_DEFAULT_RX_COPYBREAK 256
@@ -192,6 +192,122 @@ reset:
gve_schedule_reset(priv);
}
+int
+gve_adjust_rx_queues(struct gve_priv *priv, uint16_t new_queue_cnt)
+{
+ int err;
+
+ GVE_IFACE_LOCK_ASSERT(priv->gve_iface_lock);
+
+ gve_down(priv);
+
+ if (new_queue_cnt < priv->rx_cfg.num_queues) {
+ /*
+ * Freeing a ring still preserves its ntfy_id,
+ * which is needed if we create the ring again.
+ */
+ gve_free_rx_rings(priv, new_queue_cnt, priv->rx_cfg.num_queues);
+ } else {
+ err = gve_alloc_rx_rings(priv, priv->rx_cfg.num_queues, new_queue_cnt);
+ if (err != 0) {
+ device_printf(priv->dev, "Failed to allocate new queues");
+ /* Failed to allocate rings, start back up with old ones */
+ gve_up(priv);
+ return (err);
+
+ }
+ }
+ priv->rx_cfg.num_queues = new_queue_cnt;
+
+ err = gve_up(priv);
+ if (err != 0)
+ gve_schedule_reset(priv);
+
+ return (err);
+}
+
+int
+gve_adjust_tx_queues(struct gve_priv *priv, uint16_t new_queue_cnt)
+{
+ int err;
+
+ GVE_IFACE_LOCK_ASSERT(priv->gve_iface_lock);
+
+ gve_down(priv);
+
+ if (new_queue_cnt < priv->tx_cfg.num_queues) {
+ /*
+ * Freeing a ring still preserves its ntfy_id,
+ * which is needed if we create the ring again.
+ */
+ gve_free_tx_rings(priv, new_queue_cnt, priv->tx_cfg.num_queues);
+ } else {
+ err = gve_alloc_tx_rings(priv, priv->tx_cfg.num_queues, new_queue_cnt);
+ if (err != 0) {
+ device_printf(priv->dev, "Failed to allocate new queues");
+ /* Failed to allocate rings, start back up with old ones */
+ gve_up(priv);
+ return (err);
+
+ }
+ }
+ priv->tx_cfg.num_queues = new_queue_cnt;
+
+ err = gve_up(priv);
+ if (err != 0)
+ gve_schedule_reset(priv);
+
+ return (err);
+}
+
+int
+gve_adjust_ring_sizes(struct gve_priv *priv, uint16_t new_desc_cnt, bool is_rx)
+{
+ int err;
+ uint16_t prev_desc_cnt;
+
+ GVE_IFACE_LOCK_ASSERT(priv->gve_iface_lock);
+
+ gve_down(priv);
+
+ if (is_rx) {
+ gve_free_rx_rings(priv, 0, priv->rx_cfg.num_queues);
+ prev_desc_cnt = priv->rx_desc_cnt;
+ priv->rx_desc_cnt = new_desc_cnt;
+ err = gve_alloc_rx_rings(priv, 0, priv->rx_cfg.num_queues);
+ if (err != 0) {
+ device_printf(priv->dev,
+ "Failed to allocate rings. Trying to start back up with previous ring size.");
+ priv->rx_desc_cnt = prev_desc_cnt;
+ err = gve_alloc_rx_rings(priv, 0, priv->rx_cfg.num_queues);
+ }
+ } else {
+ gve_free_tx_rings(priv, 0, priv->tx_cfg.num_queues);
+ prev_desc_cnt = priv->tx_desc_cnt;
+ priv->tx_desc_cnt = new_desc_cnt;
+ err = gve_alloc_tx_rings(priv, 0, priv->tx_cfg.num_queues);
+ if (err != 0) {
+ device_printf(priv->dev,
+ "Failed to allocate rings. Trying to start back up with previous ring size.");
+ priv->tx_desc_cnt = prev_desc_cnt;
+ err = gve_alloc_tx_rings(priv, 0, priv->tx_cfg.num_queues);
+ }
+ }
+
+ if (err != 0) {
+ device_printf(priv->dev, "Failed to allocate rings! Cannot start device back up!");
+ return (err);
+ }
+
+ err = gve_up(priv);
+ if (err != 0) {
+ gve_schedule_reset(priv);
+ return (err);
+ }
+
+ return (0);
+}
+
static int
gve_set_mtu(if_t ifp, uint32_t new_mtu)
{
@@ -480,10 +596,14 @@ static void
gve_free_rings(struct gve_priv *priv)
{
gve_free_irqs(priv);
- gve_free_tx_rings(priv);
- gve_free_rx_rings(priv);
- if (gve_is_qpl(priv))
- gve_free_qpls(priv);
+
+ gve_free_tx_rings(priv, 0, priv->tx_cfg.num_queues);
+ free(priv->tx, M_GVE);
+ priv->tx = NULL;
+
+ gve_free_rx_rings(priv, 0, priv->rx_cfg.num_queues);
+ free(priv->rx, M_GVE);
+ priv->rx = NULL;
}
static int
@@ -491,17 +611,15 @@ gve_alloc_rings(struct gve_priv *priv)
{
int err;
- if (gve_is_qpl(priv)) {
- err = gve_alloc_qpls(priv);
- if (err != 0)
- goto abort;
- }
-
- err = gve_alloc_rx_rings(priv);
+ priv->rx = malloc(sizeof(struct gve_rx_ring) * priv->rx_cfg.max_queues,
+ M_GVE, M_WAITOK | M_ZERO);
+ err = gve_alloc_rx_rings(priv, 0, priv->rx_cfg.num_queues);
if (err != 0)
goto abort;
- err = gve_alloc_tx_rings(priv);
+ priv->tx = malloc(sizeof(struct gve_tx_ring) * priv->tx_cfg.max_queues,
+ M_GVE, M_WAITOK | M_ZERO);
+ err = gve_alloc_tx_rings(priv, 0, priv->tx_cfg.num_queues);
if (err != 0)
goto abort;
@@ -603,7 +721,7 @@ gve_set_queue_cnts(struct gve_priv *priv)
priv->rx_cfg.num_queues);
}
- priv->num_queues = priv->tx_cfg.num_queues + priv->rx_cfg.num_queues;
+ priv->num_queues = priv->tx_cfg.max_queues + priv->rx_cfg.max_queues;
priv->mgmt_msix_idx = priv->num_queues;
}
diff --git a/sys/dev/gve/gve_qpl.c b/sys/dev/gve/gve_qpl.c
index 1fcc2b5365c9..0e7098dcd4a1 100644
--- a/sys/dev/gve/gve_qpl.c
+++ b/sys/dev/gve/gve_qpl.c
@@ -36,28 +36,9 @@
static MALLOC_DEFINE(M_GVE_QPL, "gve qpl", "gve qpl allocations");
-static uint32_t
-gve_num_tx_qpls(struct gve_priv *priv)
-{
- if (!gve_is_qpl(priv))
- return (0);
-
- return (priv->tx_cfg.max_queues);
-}
-
-static uint32_t
-gve_num_rx_qpls(struct gve_priv *priv)
-{
- if (!gve_is_qpl(priv))
- return (0);
-
- return (priv->rx_cfg.max_queues);
-}
-
-static void
-gve_free_qpl(struct gve_priv *priv, uint32_t id)
+void
+gve_free_qpl(struct gve_priv *priv, struct gve_queue_page_list *qpl)
{
- struct gve_queue_page_list *qpl = &priv->qpls[id];
int i;
for (i = 0; i < qpl->num_dmas; i++) {
@@ -92,12 +73,14 @@ gve_free_qpl(struct gve_priv *priv, uint32_t id)
if (qpl->dmas != NULL)
free(qpl->dmas, M_GVE_QPL);
+
+ free(qpl, M_GVE_QPL);
}
-static int
+struct gve_queue_page_list *
gve_alloc_qpl(struct gve_priv *priv, uint32_t id, int npages, bool single_kva)
{
- struct gve_queue_page_list *qpl = &priv->qpls[id];
+ struct gve_queue_page_list *qpl;
int err;
int i;
@@ -105,9 +88,12 @@ gve_alloc_qpl(struct gve_priv *priv, uint32_t id, int npages, bool single_kva)
device_printf(priv->dev, "Reached max number of registered pages %ju > %ju\n",
(uintmax_t)npages + priv->num_registered_pages,
(uintmax_t)priv->max_registered_pages);
- return (EINVAL);
+ return (NULL);
}
+ qpl = malloc(sizeof(struct gve_queue_page_list), M_GVE_QPL,
+ M_WAITOK | M_ZERO);
+
qpl->id = id;
qpl->num_pages = 0;
qpl->num_dmas = 0;
@@ -163,126 +149,90 @@ gve_alloc_qpl(struct gve_priv *priv, uint32_t id, int npages, bool single_kva)
priv->num_registered_pages++;
}
- return (0);
+ return (qpl);
abort:
- gve_free_qpl(priv, id);
- return (err);
+ gve_free_qpl(priv, qpl);
+ return (NULL);
}
-void
-gve_free_qpls(struct gve_priv *priv)
-{
- int num_qpls = gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv);
- int i;
-
- if (num_qpls == 0)
- return;
-
- if (priv->qpls != NULL) {
- for (i = 0; i < num_qpls; i++)
- gve_free_qpl(priv, i);
- free(priv->qpls, M_GVE_QPL);
- priv->qpls = NULL;
- }
-}
-
-int gve_alloc_qpls(struct gve_priv *priv)
+int
+gve_register_qpls(struct gve_priv *priv)
{
- int num_qpls = gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv);
- int num_pages;
+ struct gve_ring_com *com;
+ struct gve_tx_ring *tx;
+ struct gve_rx_ring *rx;
int err;
int i;
- if (num_qpls == 0)
+ if (gve_get_state_flag(priv, GVE_STATE_FLAG_QPLREG_OK))
return (0);
- priv->qpls = malloc(num_qpls * sizeof(*priv->qpls), M_GVE_QPL,
- M_WAITOK | M_ZERO);
-
- num_pages = gve_is_gqi(priv) ?
- priv->tx_desc_cnt / GVE_QPL_DIVISOR :
- GVE_TX_NUM_QPL_PAGES_DQO;
- for (i = 0; i < gve_num_tx_qpls(priv); i++) {
- err = gve_alloc_qpl(priv, i, num_pages,
- /*single_kva=*/true);
- if (err != 0)
- goto abort;
- }
-
- num_pages = gve_is_gqi(priv) ? priv->rx_desc_cnt : GVE_RX_NUM_QPL_PAGES_DQO;
- for (; i < num_qpls; i++) {
- err = gve_alloc_qpl(priv, i, num_pages, /*single_kva=*/false);
- if (err != 0)
- goto abort;
- }
-
- return (0);
-
-abort:
- gve_free_qpls(priv);
- return (err);
-}
-
-static int
-gve_unregister_n_qpls(struct gve_priv *priv, int n)
-{
- int err;
- int i;
-
- for (i = 0; i < n; i++) {
- err = gve_adminq_unregister_page_list(priv, priv->qpls[i].id);
+ /* Register TX qpls */
+ for (i = 0; i < priv->tx_cfg.num_queues; i++) {
+ tx = &priv->tx[i];
+ com = &tx->com;
+ err = gve_adminq_register_page_list(priv, com->qpl);
if (err != 0) {
device_printf(priv->dev,
- "Failed to unregister qpl %d, err: %d\n",
- priv->qpls[i].id, err);
+ "Failed to register qpl %d, err: %d\n",
+ com->qpl->id, err);
+ /* Caller schedules a reset when this fails */
+ return (err);
}
}
- if (err != 0)
- return (err);
-
- return (0);
-}
-
-int
-gve_register_qpls(struct gve_priv *priv)
-{
- int num_qpls = gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv);
- int err;
- int i;
-
- if (gve_get_state_flag(priv, GVE_STATE_FLAG_QPLREG_OK))
- return (0);
-
- for (i = 0; i < num_qpls; i++) {
- err = gve_adminq_register_page_list(priv, &priv->qpls[i]);
+ /* Register RX qpls */
+ for (i = 0; i < priv->rx_cfg.num_queues; i++) {
+ rx = &priv->rx[i];
+ com = &rx->com;
+ err = gve_adminq_register_page_list(priv, com->qpl);
if (err != 0) {
device_printf(priv->dev,
"Failed to register qpl %d, err: %d\n",
- priv->qpls[i].id, err);
- goto abort;
+ com->qpl->id, err);
+ /* Caller schedules a reset when this fails */
+ return (err);
}
}
-
gve_set_state_flag(priv, GVE_STATE_FLAG_QPLREG_OK);
return (0);
-
-abort:
- gve_unregister_n_qpls(priv, i);
- return (err);
}
int
gve_unregister_qpls(struct gve_priv *priv)
{
- int num_qpls = gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv);
int err;
+ int i;
+ struct gve_ring_com *com;
+ struct gve_tx_ring *tx;
+ struct gve_rx_ring *rx;
if (!gve_get_state_flag(priv, GVE_STATE_FLAG_QPLREG_OK))
return (0);
- err = gve_unregister_n_qpls(priv, num_qpls);
+ for (i = 0; i < priv->tx_cfg.num_queues; i++) {
+ tx = &priv->tx[i];
+ com = &tx->com;
+ err = gve_adminq_unregister_page_list(priv, com->qpl->id);
+ if (err != 0) {
+ device_printf(priv->dev,
+ "Failed to unregister qpl %d, err: %d\n",
+ com->qpl->id, err);
+ }
+ }
+
+ for (i = 0; i < priv->rx_cfg.num_queues; i++) {
+ rx = &priv->rx[i];
+ com = &rx->com;
+ err = gve_adminq_unregister_page_list(priv, com->qpl->id);
+ if (err != 0) {
+ device_printf(priv->dev,
+ "Failed to unregister qpl %d, err: %d\n",
+ com->qpl->id, err);
+ }
+ }
+
if (err != 0)
return (err);
diff --git a/sys/dev/gve/gve_rx.c b/sys/dev/gve/gve_rx.c
index e540ad6f4c11..de64375ac4f3 100644
--- a/sys/dev/gve/gve_rx.c
+++ b/sys/dev/gve/gve_rx.c
@@ -36,6 +36,7 @@ static void
gve_rx_free_ring_gqi(struct gve_priv *priv, int i)
{
struct gve_rx_ring *rx = &priv->rx[i];
+ struct gve_ring_com *com = &rx->com;
if (rx->page_info != NULL) {
free(rx->page_info, M_GVE);
@@ -51,6 +52,11 @@ gve_rx_free_ring_gqi(struct gve_priv *priv, int i)
gve_dma_free_coherent(&rx->desc_ring_mem);
rx->desc_ring = NULL;
}
+
+ if (com->qpl != NULL) {
+ gve_free_qpl(priv, com->qpl);
+ com->qpl = NULL;
+ }
}
static void
@@ -113,10 +119,13 @@ gve_rx_alloc_ring_gqi(struct gve_priv *priv, int i)
rx->mask = priv->rx_pages_per_qpl - 1;
rx->desc_ring = rx->desc_ring_mem.cpu_addr;
- com->qpl = &priv->qpls[priv->tx_cfg.max_queues + i];
+ com->qpl = gve_alloc_qpl(priv, i + priv->tx_cfg.max_queues,
+ priv->rx_desc_cnt, /*single_kva=*/false);
if (com->qpl == NULL) {
- device_printf(priv->dev, "No QPL left for rx ring %d", i);
- return (ENOMEM);
+ device_printf(priv->dev,
+ "Failed to alloc QPL for rx ring %d", i);
+ err = ENOMEM;
+ goto abort;
}
rx->page_info = malloc(priv->rx_desc_cnt * sizeof(*rx->page_info),
@@ -176,38 +185,32 @@ abort:
}
int
-gve_alloc_rx_rings(struct gve_priv *priv)
+gve_alloc_rx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx)
{
- int err = 0;
int i;
+ int err;
- priv->rx = malloc(sizeof(struct gve_rx_ring) * priv->rx_cfg.num_queues,
- M_GVE, M_WAITOK | M_ZERO);
+ KASSERT(priv->rx != NULL, ("priv->rx is NULL!"));
- for (i = 0; i < priv->rx_cfg.num_queues; i++) {
+ for (i = start_idx; i < stop_idx; i++) {
err = gve_rx_alloc_ring(priv, i);
if (err != 0)
goto free_rings;
}
return (0);
-
free_rings:
- while (i--)
- gve_rx_free_ring(priv, i);
- free(priv->rx, M_GVE);
+ gve_free_rx_rings(priv, start_idx, i);
return (err);
}
void
-gve_free_rx_rings(struct gve_priv *priv)
+gve_free_rx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx)
{
int i;
- for (i = 0; i < priv->rx_cfg.num_queues; i++)
+ for (i = start_idx; i < stop_idx; i++)
gve_rx_free_ring(priv, i);
-
- free(priv->rx, M_GVE);
}
static void
diff --git a/sys/dev/gve/gve_rx_dqo.c b/sys/dev/gve/gve_rx_dqo.c
index 6ce9ddd887d0..a499ac9d3c6a 100644
--- a/sys/dev/gve/gve_rx_dqo.c
+++ b/sys/dev/gve/gve_rx_dqo.c
@@ -58,6 +58,7 @@ void
gve_rx_free_ring_dqo(struct gve_priv *priv, int i)
{
struct gve_rx_ring *rx = &priv->rx[i];
+ struct gve_ring_com *com = &rx->com;
int j;
if (rx->dqo.compl_ring != NULL) {
@@ -86,6 +87,11 @@ gve_rx_free_ring_dqo(struct gve_priv *priv, int i)
if (!gve_is_qpl(priv) && rx->dqo.buf_dmatag)
bus_dma_tag_destroy(rx->dqo.buf_dmatag);
+
+ if (com->qpl != NULL) {
+ gve_free_qpl(priv, com->qpl);
+ com->qpl = NULL;
+ }
}
int
@@ -123,10 +129,13 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i)
M_GVE, M_WAITOK | M_ZERO);
if (gve_is_qpl(priv)) {
- rx->com.qpl = &priv->qpls[priv->tx_cfg.max_queues + i];
+ rx->com.qpl = gve_alloc_qpl(priv, i + priv->tx_cfg.max_queues,
+ GVE_RX_NUM_QPL_PAGES_DQO, /*single_kva=*/false);
if (rx->com.qpl == NULL) {
- device_printf(priv->dev, "No QPL left for rx ring %d", i);
- return (ENOMEM);
+ device_printf(priv->dev,
+ "Failed to alloc QPL for rx ring %d", i);
+ err = ENOMEM;
+ goto abort;
}
return (0);
}
diff --git a/sys/dev/gve/gve_sysctl.c b/sys/dev/gve/gve_sysctl.c
index c96d082837a4..f7c7b5803865 100644
--- a/sys/dev/gve/gve_sysctl.c
+++ b/sys/dev/gve/gve_sysctl.c
@@ -285,6 +285,175 @@ gve_setup_main_stat_sysctl(struct sysctl_ctx_list *ctx,
&priv->reset_cnt, 0, "Times reset");
}
+static int
+gve_check_num_queues(struct gve_priv *priv, int val, bool is_rx)
+{
+ if (val < 1) {
+ device_printf(priv->dev,
+ "Requested num queues (%u) must be a positive integer\n", val);
+ return (EINVAL);
+ }
+
+ if (val > (is_rx ? priv->rx_cfg.max_queues : priv->tx_cfg.max_queues)) {
+ device_printf(priv->dev,
+ "Requested num queues (%u) is too large\n", val);
+ return (EINVAL);
+ }
+
+ return (0);
+}
+
+static int
+gve_sysctl_num_tx_queues(SYSCTL_HANDLER_ARGS)
+{
+ struct gve_priv *priv = arg1;
+ int val;
+ int err;
+
+ val = priv->tx_cfg.num_queues;
+ err = sysctl_handle_int(oidp, &val, 0, req);
+ if (err != 0 || req->newptr == NULL)
+ return (err);
+
+ err = gve_check_num_queues(priv, val, /*is_rx=*/false);
+ if (err != 0)
+ return (err);
+
+ if (val != priv->tx_cfg.num_queues) {
+ GVE_IFACE_LOCK_LOCK(priv->gve_iface_lock);
+ err = gve_adjust_tx_queues(priv, val);
+ GVE_IFACE_LOCK_UNLOCK(priv->gve_iface_lock);
+ }
+
+ return (err);
+}
+
+static int
+gve_sysctl_num_rx_queues(SYSCTL_HANDLER_ARGS)
+{
+ struct gve_priv *priv = arg1;
+ int val;
+ int err;
+
+ val = priv->rx_cfg.num_queues;
+ err = sysctl_handle_int(oidp, &val, 0, req);
+ if (err != 0 || req->newptr == NULL)
+ return (err);
+
+ err = gve_check_num_queues(priv, val, /*is_rx=*/true);
+
+ if (err != 0)
+ return (err);
+
+ if (val != priv->rx_cfg.num_queues) {
+ GVE_IFACE_LOCK_LOCK(priv->gve_iface_lock);
+ err = gve_adjust_rx_queues(priv, val);
+ GVE_IFACE_LOCK_UNLOCK(priv->gve_iface_lock);
+ }
+
+ return (err);
+}
+
+static int
+gve_check_ring_size(struct gve_priv *priv, int val, bool is_rx)
+{
+ if (!powerof2(val) || val == 0) {
+ device_printf(priv->dev,
+ "Requested ring size (%u) must be a power of 2\n", val);
+ return (EINVAL);
+ }
+
+ if (val < (is_rx ? priv->min_rx_desc_cnt : priv->min_tx_desc_cnt)) {
+ device_printf(priv->dev,
+ "Requested ring size (%u) cannot be less than %d\n", val,
+ (is_rx ? priv->min_rx_desc_cnt : priv->min_tx_desc_cnt));
+ return (EINVAL);
+ }
+
+
+ if (val > (is_rx ? priv->max_rx_desc_cnt : priv->max_tx_desc_cnt)) {
+ device_printf(priv->dev,
+ "Requested ring size (%u) cannot be greater than %d\n", val,
+ (is_rx ? priv->max_rx_desc_cnt : priv->max_tx_desc_cnt));
+ return (EINVAL);
+ }
+
+ return (0);
+}
+
+static int
+gve_sysctl_tx_ring_size(SYSCTL_HANDLER_ARGS)
+{
+ struct gve_priv *priv = arg1;
+ int val;
+ int err;
+
+ val = priv->tx_desc_cnt;
+ err = sysctl_handle_int(oidp, &val, 0, req);
+ if (err != 0 || req->newptr == NULL)
+ return (err);
+
+ err = gve_check_ring_size(priv, val, /*is_rx=*/false);
+ if (err != 0)
+ return (err);
+
+ if (val != priv->tx_desc_cnt) {
+ GVE_IFACE_LOCK_LOCK(priv->gve_iface_lock);
+ err = gve_adjust_ring_sizes(priv, val, /*is_rx=*/false);
+ GVE_IFACE_LOCK_UNLOCK(priv->gve_iface_lock);
+ }
+
+ return (err);
+}
+
+static int
+gve_sysctl_rx_ring_size(SYSCTL_HANDLER_ARGS)
+{
+ struct gve_priv *priv = arg1;
+ int val;
+ int err;
+
+ val = priv->rx_desc_cnt;
+ err = sysctl_handle_int(oidp, &val, 0, req);
+ if (err != 0 || req->newptr == NULL)
+ return (err);
+
+ err = gve_check_ring_size(priv, val, /*is_rx=*/true);
+ if (err != 0)
+ return (err);
+
+ if (val != priv->rx_desc_cnt) {
+ GVE_IFACE_LOCK_LOCK(priv->gve_iface_lock);
+ err = gve_adjust_ring_sizes(priv, val, /*is_rx=*/true);
+ GVE_IFACE_LOCK_UNLOCK(priv->gve_iface_lock);
+ }
+
+ return (err);
+}
+
+static void
+gve_setup_sysctl_writables(struct sysctl_ctx_list *ctx,
+ struct sysctl_oid_list *child, struct gve_priv *priv)
+{
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "num_tx_queues",
+ CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0,
+ gve_sysctl_num_tx_queues, "I", "Number of TX queues");
+
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "num_rx_queues",
+ CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0,
+ gve_sysctl_num_rx_queues, "I", "Number of RX queues");
+
+ if (priv->modify_ringsize_enabled) {
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_ring_size",
+ CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0,
+ gve_sysctl_tx_ring_size, "I", "TX ring size");
+
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_ring_size",
+ CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0,
+ gve_sysctl_rx_ring_size, "I", "RX ring size");
+ }
+}
+
void gve_setup_sysctl(struct gve_priv *priv)
{
device_t dev;
@@ -300,6 +469,7 @@ void gve_setup_sysctl(struct gve_priv *priv)
gve_setup_queue_stat_sysctl(ctx, child, priv);
gve_setup_adminq_stat_sysctl(ctx, child, priv);
gve_setup_main_stat_sysctl(ctx, child, priv);
+ gve_setup_sysctl_writables(ctx, child, priv);
}
void
diff --git a/sys/dev/gve/gve_tx.c b/sys/dev/gve/gve_tx.c
index 04dde4f1a79b..b667df4ca06e 100644
--- a/sys/dev/gve/gve_tx.c
+++ b/sys/dev/gve/gve_tx.c
@@ -52,6 +52,7 @@ static void
gve_tx_free_ring_gqi(struct gve_priv *priv, int i)
{
struct gve_tx_ring *tx = &priv->tx[i];
+ struct gve_ring_com *com = &tx->com;
if (tx->desc_ring != NULL) {
gve_dma_free_coherent(&tx->desc_ring_mem);
@@ -62,6 +63,11 @@ gve_tx_free_ring_gqi(struct gve_priv *priv, int i)
free(tx->info, M_GVE);
tx->info = NULL;
}
+
+ if (com->qpl != NULL) {
+ gve_free_qpl(priv, com->qpl);
+ com->qpl = NULL;
+ }
}
static void
@@ -109,9 +115,11 @@ gve_tx_alloc_ring_gqi(struct gve_priv *priv, int i)
}
tx->desc_ring = tx->desc_ring_mem.cpu_addr;
- com->qpl = &priv->qpls[i];
+ com->qpl = gve_alloc_qpl(priv, i, priv->tx_desc_cnt / GVE_QPL_DIVISOR,
+ /*single_kva=*/true);
if (com->qpl == NULL) {
- device_printf(priv->dev, "No QPL left for tx ring %d\n", i);
+ device_printf(priv->dev,
+ "Failed to alloc QPL for tx ring %d\n", i);
err = ENOMEM;
goto abort;
}
@@ -173,39 +181,32 @@ abort:
}
int
-gve_alloc_tx_rings(struct gve_priv *priv)
+gve_alloc_tx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx)
{
- int err = 0;
int i;
+ int err;
- priv->tx = malloc(sizeof(struct gve_tx_ring) * priv->tx_cfg.num_queues,
- M_GVE, M_WAITOK | M_ZERO);
+ KASSERT(priv->tx != NULL, ("priv->tx is NULL!"));
- for (i = 0; i < priv->tx_cfg.num_queues; i++) {
+ for (i = start_idx; i < stop_idx; i++) {
err = gve_tx_alloc_ring(priv, i);
if (err != 0)
goto free_rings;
-
}
return (0);
-
free_rings:
- while (i--)
- gve_tx_free_ring(priv, i);
- free(priv->tx, M_GVE);
+ gve_free_tx_rings(priv, start_idx, i);
return (err);
}
void
-gve_free_tx_rings(struct gve_priv *priv)
+gve_free_tx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx)
{
int i;
- for (i = 0; i < priv->tx_cfg.num_queues; i++)
+ for (i = start_idx; i < stop_idx; i++)
gve_tx_free_ring(priv, i);
-
- free(priv->tx, M_GVE);
}
static void
diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c
index bf314ef95173..7361d47b8ce6 100644
--- a/sys/dev/gve/gve_tx_dqo.c
+++ b/sys/dev/gve/gve_tx_dqo.c
@@ -75,6 +75,7 @@ void
gve_tx_free_ring_dqo(struct gve_priv *priv, int i)
{
struct gve_tx_ring *tx = &priv->tx[i];
+ struct gve_ring_com *com = &tx->com;
int j;
if (tx->dqo.desc_ring != NULL) {
@@ -109,6 +110,11 @@ gve_tx_free_ring_dqo(struct gve_priv *priv, int i)
free(tx->dqo.qpl_bufs, M_GVE);
tx->dqo.qpl_bufs = NULL;
}
+
+ if (com->qpl != NULL) {
+ gve_free_qpl(priv, com->qpl);
+ com->qpl = NULL;
+ }
}
static int
@@ -210,7 +216,15 @@ gve_tx_alloc_ring_dqo(struct gve_priv *priv, int i)
if (gve_is_qpl(priv)) {
int qpl_buf_cnt;
- tx->com.qpl = &priv->qpls[i];
+ tx->com.qpl = gve_alloc_qpl(priv, i, GVE_TX_NUM_QPL_PAGES_DQO,
+ /*single_kva*/false);
+ if (tx->com.qpl == NULL) {
+ device_printf(priv->dev,
+ "Failed to alloc QPL for tx ring %d", i);
+ err = ENOMEM;
+ goto abort;
+ }
+
qpl_buf_cnt = GVE_TX_BUFS_PER_PAGE_DQO *
tx->com.qpl->num_pages;
diff --git a/sys/dev/gve/gve_utils.c b/sys/dev/gve/gve_utils.c
index 080343d3f651..4e9dd4625e2f 100644
--- a/sys/dev/gve/gve_utils.c
+++ b/sys/dev/gve/gve_utils.c
@@ -234,7 +234,7 @@ gve_free_irqs(struct gve_priv *priv)
return;
}
- num_irqs = priv->tx_cfg.num_queues + priv->rx_cfg.num_queues + 1;
+ num_irqs = priv->tx_cfg.max_queues + priv->rx_cfg.max_queues + 1;
for (i = 0; i < num_irqs; i++) {
irq = &priv->irq_tbl[i];
@@ -268,8 +268,8 @@ gve_free_irqs(struct gve_priv *priv)
int
gve_alloc_irqs(struct gve_priv *priv)
{
- int num_tx = priv->tx_cfg.num_queues;
- int num_rx = priv->rx_cfg.num_queues;
+ int num_tx = priv->tx_cfg.max_queues;
+ int num_rx = priv->rx_cfg.max_queues;
int req_nvecs = num_tx + num_rx + 1;
int got_nvecs = req_nvecs;
struct gve_irq *irq;
diff --git a/sys/dev/iicbus/controller/qcom/geni_iic.c b/sys/dev/iicbus/controller/qcom/geni_iic.c
new file mode 100644
index 000000000000..f53fc1d3f1cd
--- /dev/null
+++ b/sys/dev/iicbus/controller/qcom/geni_iic.c
@@ -0,0 +1,608 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Poul-Henning Kamp <phk@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * QualComm GENI I2C controller
+ *
+ * The GENI is actually a multi-protocol serial controller, so a lot of
+ * this can probably be shared if we ever get to those protocols.
+ *
+ * The best open "documentation" of the hardware is the Linux device driver
+ * from which much was learned, and we tip our hat to the authors of it.
+ */
+
+#include <sys/cdefs.h>
+
+#include "opt_acpi.h"
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/endian.h>
+#include <sys/time.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <sys/bus.h>
+
+#include <machine/bus.h>
+#include <sys/rman.h>
+
+#include <dev/iicbus/iicbus.h>
+#include <dev/iicbus/iiconf.h>
+
+#include <dev/iicbus/controller/qcom/geni_iic_var.h>
+
+#define GENI_ALL_REGISTERS(THIS_MACRO) \
+ THIS_MACRO(GENI_FORCE_DEFAULT_REG, 0x020) \
+ THIS_MACRO(GENI_OUTPUT_CTRL, 0x024) \
+ THIS_MACRO(GENI_STATUS, 0x040) \
+ THIS_MACRO(GENI_SER_M_CLK_CFG, 0x048) \
+ THIS_MACRO(GENI_SER_S_CLK_CFG, 0x04c) \
+ THIS_MACRO(GENI_IF_DISABLE_RO, 0x064) \
+ THIS_MACRO(GENI_FW_REVISION_RO, 0x068) \
+ THIS_MACRO(GENI_CLK_SEL, 0x07c) \
+ THIS_MACRO(GENI_CFG_SEQ_START, 0x084) \
+ THIS_MACRO(GENI_BYTE_GRANULARITY, 0x254) \
+ THIS_MACRO(GENI_DMA_MODE_EN, 0x258) \
+ THIS_MACRO(GENI_TX_PACKING_CFG0, 0x260) \
+ THIS_MACRO(GENI_TX_PACKING_CFG1, 0x264) \
+ THIS_MACRO(GENI_I2C_TX_TRANS_LEN, 0x26c) \
+ THIS_MACRO(GENI_I2C_RX_TRANS_LEN, 0x270) \
+ THIS_MACRO(GENI_I2C_SCL_COUNTERS, 0x278) \
+ THIS_MACRO(GENI_RX_PACKING_CFG0, 0x284) \
+ THIS_MACRO(GENI_RX_PACKING_CFG1, 0x288) \
+ THIS_MACRO(GENI_M_CMD0, 0x600) \
+ THIS_MACRO(GENI_M_CMD_CTRL_REG, 0x604) \
+ THIS_MACRO(GENI_M_IRQ_STATUS, 0x610) \
+ THIS_MACRO(GENI_M_IRQ_EN, 0x614) \
+ THIS_MACRO(GENI_M_IRQ_CLEAR, 0x618) \
+ THIS_MACRO(GENI_M_IRQ_EN_SET, 0x61c) \
+ THIS_MACRO(GENI_M_IRQ_EN_CLEAR, 0x620) \
+ THIS_MACRO(GENI_S_CMD0, 0x630) \
+ THIS_MACRO(GENI_S_CMD_CTRL_REG, 0x634) \
+ THIS_MACRO(GENI_S_IRQ_STATUS, 0x640) \
+ THIS_MACRO(GENI_S_IRQ_EN, 0x644) \
+ THIS_MACRO(GENI_S_IRQ_CLEAR, 0x648) \
+ THIS_MACRO(GENI_S_IRQ_EN_SET, 0x64c) \
+ THIS_MACRO(GENI_S_IRQ_EN_CLEAR, 0x650) \
+ THIS_MACRO(GENI_TX_FIFOn, 0x700) \
+ THIS_MACRO(GENI_RX_FIFOn, 0x780) \
+ THIS_MACRO(GENI_TX_FIFO_STATUS, 0x800) \
+ THIS_MACRO(GENI_RX_FIFO_STATUS, 0x804) \
+ THIS_MACRO(GENI_TX_WATERMARK_REG, 0x80c) \
+ THIS_MACRO(GENI_RX_WATERMARK_REG, 0x810) \
+ THIS_MACRO(GENI_RX_RFR_WATERMARK_REG, 0x814) \
+ THIS_MACRO(GENI_IOS, 0x908) \
+ THIS_MACRO(GENI_M_GP_LENGTH, 0x910) \
+ THIS_MACRO(GENI_S_GP_LENGTH, 0x914) \
+ THIS_MACRO(GENI_DMA_TX_IRQ_STAT, 0xc40) \
+ THIS_MACRO(GENI_DMA_TX_IRQ_CLR, 0xc44) \
+ THIS_MACRO(GENI_DMA_TX_IRQ_EN, 0xc48) \
+ THIS_MACRO(GENI_DMA_TX_IRQ_EN_CLR, 0xc4c) \
+ THIS_MACRO(GENI_DMA_TX_IRQ_EN_SET, 0xc50) \
+ THIS_MACRO(GENI_DMA_TX_FSM_RST, 0xc58) \
+ THIS_MACRO(GENI_DMA_RX_IRQ_STAT, 0xd40) \
+ THIS_MACRO(GENI_DMA_RX_IRQ_CLR, 0xd44) \
+ THIS_MACRO(GENI_DMA_RX_IRQ_EN, 0xd48) \
+ THIS_MACRO(GENI_DMA_RX_IRQ_EN_CLR, 0xd4c) \
+ THIS_MACRO(GENI_DMA_RX_IRQ_EN_SET, 0xd50) \
+ THIS_MACRO(GENI_DMA_RX_LEN_IN, 0xd54) \
+ THIS_MACRO(GENI_DMA_RX_FSM_RST, 0xd58) \
+ THIS_MACRO(GENI_IRQ_EN, 0xe1c) \
+ THIS_MACRO(GENI_HW_PARAM_0, 0xe24) \
+ THIS_MACRO(GENI_HW_PARAM_1, 0xe28)
+
+enum geni_registers {
+#define ITER_MACRO(name, offset) name = offset,
+ GENI_ALL_REGISTERS(ITER_MACRO)
+#undef ITER_MACRO
+};
+
+#define RD(sc, reg) bus_read_4((sc)->regs_res, reg)
+#define WR(sc, reg, val) bus_write_4((sc)->regs_res, reg, val)
+
+static void
+geni_dump_regs(geniiic_softc_t *sc)
+{
+ device_printf(sc->dev, "Register Dump\n");
+#define DUMP_MACRO(name, offset) \
+ device_printf(sc->dev, \
+ " %08x %04x " #name "\n", \
+ RD(sc, offset), offset);
+ GENI_ALL_REGISTERS(DUMP_MACRO)
+#undef DUMP_MACRO
+}
+
+static unsigned geniiic_debug_units = 0;
+
+static SYSCTL_NODE(_hw, OID_AUTO, geniiic, CTLFLAG_RW, 0, "GENI I2C");
+SYSCTL_INT(_hw_geniiic, OID_AUTO, debug_units, CTLFLAG_RWTUN,
+ &geniiic_debug_units, 1, "Bitmask of units to debug");
+
+
+static driver_filter_t geniiic_intr;
+
+static int
+geniiic_intr(void *cookie)
+{
+ uint32_t m_status, rx_fifo_status;
+ int retval = FILTER_STRAY;
+ geniiic_softc_t *sc = cookie;
+
+ mtx_lock_spin(&sc->intr_lock);
+ m_status = RD(sc, GENI_M_IRQ_STATUS);
+
+ rx_fifo_status = RD(sc, GENI_RX_FIFO_STATUS);
+ if (sc->rx_buf != NULL && rx_fifo_status & 0x3f) {
+
+ // Number of whole FIFO words, each 4 bytes
+ unsigned gotlen = (((rx_fifo_status & 0x3f) << 2)-1) * 4;
+
+ // Valid bytes in the last FIFO word
+ // (Field is 3 bits, we'll only ever see 0…3)
+ gotlen += (rx_fifo_status >> 28) & 0x7;
+
+ unsigned cnt;
+ for (cnt = 0; cnt < (rx_fifo_status & 0x3f); cnt++) {
+ uint32_t data = RD(sc, GENI_RX_FIFOn);
+ unsigned u;
+ for (u = 0; u < 4 && sc->rx_len && gotlen; u++) {
+ *sc->rx_buf++ = data & 0xff;
+ data >>= 8;
+ sc->rx_len--;
+ gotlen--;
+ }
+ }
+ }
+ if (m_status & (1<<26)) {
+ WR(sc, GENI_M_IRQ_CLEAR, (1<<26));
+ retval = FILTER_HANDLED;
+ }
+
+ if (m_status & (1<<0)) {
+ sc->rx_complete = true;
+ WR(sc, GENI_M_IRQ_EN_CLEAR, (1<<0));
+ WR(sc, GENI_M_IRQ_EN_CLEAR, (1<<26));
+ WR(sc, GENI_M_IRQ_CLEAR, (1<<0));
+ wakeup(sc);
+ retval = FILTER_HANDLED;
+ }
+ sc->cmd_status = m_status;
+
+ if (sc->rx_buf == NULL) {
+ device_printf(sc->dev,
+ "Interrupt m_stat %x rx_fifo_status %x retval %d\n",
+ m_status, rx_fifo_status, retval);
+ WR(sc, GENI_M_IRQ_EN, 0);
+ WR(sc, GENI_M_IRQ_CLEAR, m_status);
+ device_printf(sc->dev,
+ "Interrupt M_IRQ_STATUS 0x%x M_IRQ_EN 0x%x\n",
+ RD(sc, GENI_M_IRQ_STATUS), RD(sc, GENI_M_IRQ_EN));
+ device_printf(sc->dev,
+ "Interrupt S_IRQ_STATUS 0x%x S_IRQ_EN 0x%x\n",
+ RD(sc, GENI_S_IRQ_STATUS), RD(sc, GENI_S_IRQ_EN));
+ device_printf(sc->dev,
+ "Interrupt DMA_TX_IRQ_STAT 0x%x DMA_RX_IRQ_STAT 0x%x\n",
+ RD(sc, GENI_DMA_TX_IRQ_STAT), RD(sc, GENI_DMA_RX_IRQ_STAT));
+ device_printf(sc->dev,
+ "Interrupt DMA_TX_IRQ_EN 0x%x DMA_RX_IRQ_EN 0x%x\n",
+ RD(sc, GENI_DMA_TX_IRQ_EN), RD(sc, GENI_DMA_RX_IRQ_EN));
+ WR(sc, GENI_DMA_TX_IRQ_EN_CLR, RD(sc, GENI_DMA_TX_IRQ_STAT));
+ WR(sc, GENI_DMA_TX_IRQ_CLR, RD(sc, GENI_DMA_TX_IRQ_STAT));
+ WR(sc, GENI_DMA_RX_IRQ_EN_CLR, RD(sc, GENI_DMA_RX_IRQ_STAT));
+ WR(sc, GENI_DMA_RX_IRQ_CLR, RD(sc, GENI_DMA_RX_IRQ_STAT));
+ }
+ mtx_unlock_spin(&sc->intr_lock);
+ return(retval);
+}
+
+static int
+geniiic_wait_m_ireq(geniiic_softc_t *sc, uint32_t bits)
+{
+ uint32_t status;
+ int timeout;
+
+ for (timeout = 0; timeout < 10000; timeout++) {
+ status = RD(sc, GENI_M_IRQ_STATUS);
+ if (status & bits) {
+ return (0);
+ }
+ DELAY(10);
+ }
+ return (IIC_ETIMEOUT);
+}
+
+static int
+geniiic_read(geniiic_softc_t *sc,
+ uint8_t slave, uint8_t *buf, uint16_t len, bool nonfinal)
+{
+ uint32_t cmd, istatus;
+
+ istatus = RD(sc, GENI_M_IRQ_STATUS);
+ WR(sc, GENI_M_IRQ_CLEAR, istatus);
+
+ sc->rx_complete = false;
+ sc->rx_fifo = false;
+ sc->rx_buf = buf;
+ sc->rx_len = len;
+ WR(sc, GENI_I2C_RX_TRANS_LEN, len);
+
+ // GENI_M_CMD0_OPCODE_I2C_READ << M_OPCODE_SHFT
+ cmd = (0x2 << 27);
+
+ // GENI_M_CMD0_SLV_ADDR_SHIFT
+ cmd |= slave << 9;
+
+ if (nonfinal) {
+ // GENI_M_CMD0_STOP_STRETCH
+ cmd |= (1<<2);
+ }
+ WR(sc, GENI_RX_WATERMARK_REG, sc->rx_fifo_size - 4);
+
+ // CMD_DONE, RX_FIFO_WATERMARK
+ WR(sc, GENI_M_IRQ_EN, (1<<0) | (1<<26));
+
+ // M_IRQ
+ WR(sc, GENI_IRQ_EN, (1<<2));
+
+ WR(sc, GENI_M_CMD0, cmd);
+
+ mtx_lock_spin(&sc->intr_lock);
+ sc->rx_fifo = false;
+ unsigned msec;
+ for (msec = 0; msec < 100; msec++) {
+ msleep_spin_sbt(sc, &sc->intr_lock,
+ "geniwait", SBT_1MS, SBT_1MS / 10, 0);
+ if (sc->rx_complete)
+ break;
+ }
+ if (msec > sc->worst) {
+ device_printf(sc->dev,
+ "Tworst from %u to %u\n", sc->worst, msec);
+ if (msec != 100)
+ sc->worst = msec;
+ }
+
+ if (!sc->rx_complete) {
+ // S_GENI_CMD_CANCEL
+ WR(sc, GENI_M_CMD_CTRL_REG, (1<<2));
+
+ WR(sc, GENI_IRQ_EN, 0);
+ device_printf(sc->dev,
+ "Incomplete read (residual %x)\n", sc->rx_len);
+ }
+
+ sc->rx_buf = NULL;
+ len = sc->rx_len;
+ sc->rx_len = 0;
+
+ mtx_unlock_spin(&sc->intr_lock);
+
+#define COMPLAIN(about) \
+ device_printf(sc->dev, \
+ "read " about " slave=0x%x len=0x%x, cmd=0x%x cmd_status=0x%x\n", \
+ slave, len, cmd, sc->cmd_status \
+ )
+
+ if (geniiic_debug_units) {
+ unsigned unit = device_get_unit(sc->dev);
+ if (unit < 32 && geniiic_debug_units & (1<<unit) && len == 0) {
+ COMPLAIN("OK");
+ return(IIC_NOERR);
+ }
+ }
+ if (len == 0)
+ return(IIC_NOERR);
+
+ if (sc->cmd_status & (1<<10)) {
+ COMPLAIN("ESTATUS");
+ return(IIC_ESTATUS);
+ }
+ if (len) {
+ COMPLAIN("EUNDERFLOW");
+ return(IIC_EUNDERFLOW);
+ }
+ COMPLAIN("EBUSERR");
+ return (IIC_EBUSERR);
+#undef COMPLAIN
+}
+
+static int
+geniiic_write(geniiic_softc_t *sc,
+ uint8_t slave, uint8_t *buf, uint16_t len, bool nonfinal)
+{
+ uint32_t status, data, cmd;
+ int timeout, error;
+
+ status = RD(sc, GENI_M_IRQ_STATUS);
+ WR(sc, GENI_M_IRQ_CLEAR, status);
+
+ WR(sc, GENI_I2C_TX_TRANS_LEN, len);
+
+ // GENI_M_CMD0_OPCODE_I2C_WRITE << M_OPCODE_SHFT
+ cmd = (0x1 << 27);
+
+ // GENI_M_CMD0_SLV_ADDR_SHIFT
+ cmd |= slave << 9;
+
+ if (nonfinal) {
+ // GENI_M_CMD0_STOP_STRETCH
+ cmd |= (1<<2);
+ }
+ WR(sc, GENI_M_CMD0, cmd);
+ for(timeout = 0; len > 0 && timeout < 100; timeout++) {
+ status = RD(sc, GENI_TX_FIFO_STATUS);
+ if (status < 16) {
+ data = 0;
+ if (len) { data |= *buf << 0; buf++; len--; }
+ if (len) { data |= *buf << 8; buf++; len--; }
+ if (len) { data |= *buf << 16; buf++; len--; }
+ if (len) { data |= *buf << 24; buf++; len--; }
+ WR(sc, GENI_TX_FIFOn, data);
+ } else {
+ DELAY(10);
+ }
+ }
+
+ // GENI_M_IRQ_CMD_DONE
+ error = geniiic_wait_m_ireq(sc, 1);
+
+ if (len == 0 && error == 0)
+ return(IIC_NOERR);
+ device_printf(sc->dev,
+ "write ERR len=%d, error=%d cmd=0x%x\n", len, error, cmd);
+ return (IIC_EBUSERR);
+}
+
+static void
+geniiic_dumpmsg(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
+{
+ unsigned u;
+
+ device_printf(dev, "transfer:\n");
+ for (u = 0; u < nmsgs; u++) {
+ device_printf(dev,
+ " [%d] slave=0x%x, flags=0x%x len=0x%x buf=%p\n",
+ u, msgs[u].slave, msgs[u].flags, msgs[u].len, msgs[u].buf
+ );
+ }
+}
+
+int
+geniiic_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
+{
+ geniiic_softc_t *sc = device_get_softc(dev);
+ unsigned u;
+ int error;
+
+ if (sc->nfail > 4) {
+ pause_sbt("geniic_fail", SBT_1S * 5, SBT_1S, 0);
+ return (IIC_ERESOURCE);
+ }
+
+ sx_xlock(&sc->real_bus_lock);
+
+ if (geniiic_debug_units) {
+ unsigned unit = device_get_unit(dev);
+ if (unit < 32 && geniiic_debug_units & (1<<unit)) {
+ geniiic_dumpmsg(dev, msgs, nmsgs);
+ }
+ }
+
+ error = 0;
+ for (u = 0; u < nmsgs; u++) {
+ bool nonfinal =
+ (u < nmsgs - 1) && (msgs[u].flags & IIC_M_NOSTOP);
+ unsigned slave = msgs[u].slave >> 1;
+ if (msgs[u].flags & IIC_M_RD) {
+ error = geniiic_read(sc,
+ slave, msgs[u].buf, msgs[u].len, nonfinal);
+ } else {
+ error = geniiic_write(sc,
+ slave, msgs[u].buf, msgs[u].len, nonfinal);
+ }
+ }
+ if (error) {
+ device_printf(dev, "transfer error %d\n", error);
+ geniiic_dumpmsg(dev, msgs, nmsgs);
+ }
+ if (error) {
+ geniiic_reset(dev, 0, 0, NULL);
+ }
+ if (error)
+ sc->nfail++;
+ else
+ sc->nfail = 0;
+ sx_xunlock(&sc->real_bus_lock);
+ return (error);
+}
+
+int
+geniiic_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
+{
+ geniiic_softc_t *sc = device_get_softc(dev);
+ unsigned u;
+
+ device_printf(dev, "reset\n");
+ WR(sc, GENI_M_IRQ_EN, 0);
+ WR(sc, GENI_M_IRQ_CLEAR, ~0);
+ WR(sc, GENI_DMA_TX_IRQ_EN_CLR, ~0);
+ WR(sc, GENI_DMA_TX_IRQ_CLR, ~0);
+ WR(sc, GENI_DMA_RX_IRQ_EN_CLR, ~0);
+ WR(sc, GENI_DMA_RX_IRQ_CLR, ~0);
+
+ // S_GENI_CMD_ABORT
+ WR(sc, GENI_M_CMD_CTRL_REG, (1<<1));
+
+ WR(sc, GENI_DMA_RX_FSM_RST, 1);
+ for (u = 0; u < 1000; u++) {
+ if (RD(sc, GENI_DMA_RX_IRQ_STAT) & 0x8)
+ break;
+ DELAY(10);
+ }
+ if (u > 0)
+ device_printf(dev, "RXRESET time %u\n", u);
+ WR(sc, GENI_DMA_TX_FSM_RST, 1);
+ for (u = 0; u < 1000; u++) {
+ if (RD(sc, GENI_DMA_TX_IRQ_STAT) & 0x8)
+ break;
+ DELAY(10);
+ }
+ if (u > 0)
+ device_printf(dev, "TXRESET time %u\n", u);
+ return (0);
+}
+
+int
+geniiic_callback(device_t dev, int index, caddr_t data)
+{
+ geniiic_softc_t *sc = device_get_softc(dev);
+ int error = 0;
+
+ return(0);
+ switch (index) {
+ case IIC_REQUEST_BUS:
+ if (sx_try_xlock(&sc->bus_lock) == 0)
+ error = IIC_EBUSBSY;
+ else
+ sc->bus_locked = true;
+ break;
+
+ case IIC_RELEASE_BUS:
+ if (!sc->bus_locked) {
+ device_printf(dev, "Unlocking unlocked bus\n");
+ }
+ sc->bus_locked = false;
+ sx_xunlock(&sc->bus_lock);
+ break;
+
+ default:
+ device_printf(dev, "callback unknown %d\n", index);
+ error = errno2iic(EINVAL);
+ }
+
+ return (error);
+}
+
+int
+geniiic_attach(geniiic_softc_t *sc)
+{
+ int error = 0;
+
+ if (bootverbose)
+ geni_dump_regs(sc);
+ mtx_init(&sc->intr_lock, "geniiic intr lock", NULL, MTX_SPIN);
+ sx_init(&sc->real_bus_lock, "geniiic real bus lock");
+ sx_init(&sc->bus_lock, "geniiic bus lock");
+
+ sc->rx_fifo_size = (RD(sc, GENI_HW_PARAM_1) >> 16) & 0x3f;
+ device_printf(sc->dev, " RX fifo size= 0x%x\n", sc->rx_fifo_size);
+
+ // We might want to set/check the following registers:
+ // GENI_BYTE_GRANULARITY (0x00000000)
+ // GENI_TX_PACKING_CFG0 (0x0007f8fe)
+ // GENI_TX_PACKING_CFG1 (000ffefe)
+ // GENI_RX_PACKING_CFG0 (0x0007f8fe)
+ // GENI_RX_PACKING_CFG1 (000ffefe)
+
+ sc->iicbus = device_add_child(sc->dev, "iicbus", DEVICE_UNIT_ANY);
+ if (sc->iicbus == NULL) {
+ device_printf(sc->dev, "iicbus driver not found\n");
+ return(ENXIO);
+ }
+
+ error = bus_setup_intr(sc->dev,
+ sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE,
+ geniiic_intr, NULL, sc, &sc->intr_handle);
+ if (error) {
+ device_printf(sc->dev,
+ "Unable to setup irq: error %d\n", error);
+ }
+
+ bus_attach_children(sc->dev);
+ return (error);
+}
+
+int
+geniiic_detach(geniiic_softc_t *sc)
+{
+ int error = 0;
+
+ error = bus_generic_detach(sc->dev);
+ if (error)
+ return (error);
+
+ WR(sc, GENI_M_IRQ_EN, 0);
+
+ if (sc->intr_handle) {
+ bus_teardown_intr(sc->dev, sc->intr_res, sc->intr_handle);
+ }
+
+ sx_xlock(&sc->bus_lock);
+ sx_xlock(&sc->real_bus_lock);
+
+ geniiic_reset(sc->dev, 0, 0, NULL);
+ sc->iicbus = NULL;
+ sc->intr_handle = NULL;
+
+ sx_xunlock(&sc->real_bus_lock);
+ sx_xunlock(&sc->bus_lock);
+
+ sx_destroy(&sc->real_bus_lock);
+ sx_destroy(&sc->bus_lock);
+
+ mtx_destroy(&sc->intr_lock);
+ return (error);
+}
+
+int
+geniiic_suspend(geniiic_softc_t *sc)
+{
+ int error;
+
+ device_printf(sc->dev, "suspend method is NO-OP (good luck!)\n");
+
+ error = bus_generic_suspend(sc->dev);
+
+ return (error);
+}
+
+int geniiic_resume(geniiic_softc_t *sc)
+{
+ int error;
+
+ device_printf(sc->dev, "resume method is NO-OP (good luck!)\n");
+
+ error = bus_generic_resume(sc->dev);
+
+ return (error);
+}
+
+DRIVER_MODULE(iicbus, geniiic, iicbus_driver, NULL, NULL);
+DRIVER_MODULE(acpi_iicbus, geniiic, acpi_iicbus_driver, NULL, NULL);
+MODULE_DEPEND(geniiic, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
+MODULE_VERSION(geniiic, 1);
diff --git a/sys/dev/iicbus/controller/qcom/geni_iic_acpi.c b/sys/dev/iicbus/controller/qcom/geni_iic_acpi.c
new file mode 100644
index 000000000000..2105071f5609
--- /dev/null
+++ b/sys/dev/iicbus/controller/qcom/geni_iic_acpi.c
@@ -0,0 +1,189 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Poul-Henning Kamp <phk@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <sys/cdefs.h>
+#include "opt_acpi.h"
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/proc.h>
+#include <sys/rman.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#include <dev/acpica/acpivar.h>
+#include <dev/iicbus/iiconf.h>
+
+#include <dev/iicbus/controller/qcom/geni_iic_var.h>
+
+static int geniiic_acpi_probe(device_t dev);
+static int geniiic_acpi_attach(device_t dev);
+static int geniiic_acpi_detach(device_t dev);
+
+static char *geniiic_ids[] = {
+ "QCOM0C10",
+ NULL
+};
+
+static int
+geniiic_acpi_probe(device_t dev)
+{
+ int rv;
+
+ if (acpi_disabled("geniiic"))
+ return (ENXIO);
+ rv = ACPI_ID_PROBE(device_get_parent(dev), dev, geniiic_ids, NULL);
+ if (rv > 0)
+ return (rv);
+
+ device_set_desc(dev, "Qualcomm GENI I2C Controller");
+ return (rv);
+}
+
+static int
+geniiic_acpi_attach(device_t dev)
+{
+ geniiic_softc_t *sc;
+ char *str;
+ int error;
+
+ sc = device_get_softc(dev);
+
+ sc->dev = dev;
+ error = ACPI_ID_PROBE(device_get_parent(dev), dev, geniiic_ids, &str);
+ if (error > 0)
+ return (error);
+
+ sc->regs_rid = 0;
+ sc->regs_res = bus_alloc_resource_any(dev,
+ SYS_RES_MEMORY, &sc->regs_rid, RF_ACTIVE);
+ if (sc->regs_res == NULL) {
+ device_printf(dev, "unable to map registers\n");
+ geniiic_acpi_detach(dev);
+ return (ENXIO);
+ }
+ sc->intr_rid = 0;
+ sc->intr_res = bus_alloc_resource_any(dev,
+ SYS_RES_IRQ, &sc->intr_rid, RF_SHAREABLE | RF_ACTIVE);
+ if (sc->intr_res == NULL) {
+ device_printf(dev, "unable to map interrupt\n");
+ geniiic_acpi_detach(dev);
+ return (ENXIO);
+ }
+ sc->platform_attached = true;
+
+ error = geniiic_attach(sc);
+ if (error)
+ geniiic_acpi_detach(dev);
+
+ return (error);
+}
+
+static int
+geniiic_acpi_detach(device_t dev)
+{
+ geniiic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ if (sc->platform_attached) {
+ error = geniiic_detach(sc);
+ if (error)
+ return (error);
+ sc->platform_attached = false;
+ }
+
+ if (sc->intr_res) {
+ bus_release_resource(dev, SYS_RES_IRQ,
+ sc->intr_rid, sc->intr_res);
+ sc->intr_res = NULL;
+ }
+ if (sc->regs_res) {
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ sc->regs_rid, sc->regs_res);
+ sc->regs_res = NULL;
+ }
+
+ return (0);
+}
+
+static int
+geniiic_acpi_suspend(device_t dev)
+{
+ geniiic_softc_t *sc = device_get_softc(dev);
+
+ return (geniiic_suspend(sc));
+}
+
+static int
+geniiic_acpi_resume(device_t dev)
+{
+ geniiic_softc_t *sc = device_get_softc(dev);
+
+ return (geniiic_resume(sc));
+}
+
+static device_method_t geniiic_acpi_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, geniiic_acpi_probe),
+ DEVMETHOD(device_attach, geniiic_acpi_attach),
+ DEVMETHOD(device_detach, geniiic_acpi_detach),
+ DEVMETHOD(device_suspend, geniiic_acpi_suspend),
+ DEVMETHOD(device_resume, geniiic_acpi_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
+
+ /* iicbus interface */
+ DEVMETHOD(iicbus_transfer, geniiic_transfer),
+ DEVMETHOD(iicbus_reset, geniiic_reset),
+ DEVMETHOD(iicbus_callback, geniiic_callback),
+
+ DEVMETHOD_END
+};
+
+static driver_t geniiic_acpi_driver = {
+ "geniiic",
+ geniiic_acpi_methods,
+ sizeof(struct geniiic_softc),
+};
+
+DRIVER_MODULE_ORDERED(geniiic, acpi, geniiic_acpi_driver, 0, 0, SI_ORDER_ANY);
+MODULE_DEPEND(geniiic, acpi, 1, 1, 1);
+ACPI_PNP_INFO(geniiic_ids);
diff --git a/sys/dev/iicbus/controller/qcom/geni_iic_var.h b/sys/dev/iicbus/controller/qcom/geni_iic_var.h
new file mode 100644
index 000000000000..9ce8200c6fe5
--- /dev/null
+++ b/sys/dev/iicbus/controller/qcom/geni_iic_var.h
@@ -0,0 +1,80 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Poul-Henning Kamp <phk@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _GENIIIC_GENI_VAR_H_
+#define _GENIIIC_GENI_VAR_H_
+
+#include "bus_if.h"
+#include "device_if.h"
+#include "iicbus_if.h"
+
+struct geniiic_softc {
+ device_t dev;
+ device_t iicbus;
+ struct resource *regs_res;
+ int regs_rid;
+ struct resource *intr_res;
+ int intr_rid;
+ void *intr_handle;
+ int intr_type;
+ uint32_t intr_mask;
+
+ bool bus_locked;
+
+ bool platform_attached;
+
+ int nfail;
+ unsigned worst;
+
+ unsigned rx_fifo_size;
+ bool rx_complete;
+ bool rx_fifo;
+ uint8_t *rx_buf;
+ unsigned rx_len;
+ uint32_t cmd_status;
+
+ // Protect access to the bus
+ struct sx bus_lock;
+ struct sx real_bus_lock;
+
+ // Coordinate with interrupt routine
+ struct mtx intr_lock;
+};
+
+typedef struct geniiic_softc geniiic_softc_t;
+
+int geniiic_attach(geniiic_softc_t *sc);
+int geniiic_detach(geniiic_softc_t *sc);
+int geniiic_suspend(geniiic_softc_t *sc);
+int geniiic_resume(geniiic_softc_t *sc);
+
+extern iicbus_transfer_t geniiic_transfer;
+extern iicbus_reset_t geniiic_reset;
+extern iicbus_callback_t geniiic_callback;
+
+#endif /* _GENIIIC_GENI_VAR_H_ */
diff --git a/sys/dev/iwx/if_iwx.c b/sys/dev/iwx/if_iwx.c
index 9e5d5a9569d5..03008e4fac93 100644
--- a/sys/dev/iwx/if_iwx.c
+++ b/sys/dev/iwx/if_iwx.c
@@ -5111,9 +5111,6 @@ iwx_phy_ctxt_cmd(struct iwx_softc *sc, struct iwx_phy_ctxt *ctxt,
static int
iwx_send_cmd(struct iwx_softc *sc, struct iwx_host_cmd *hcmd)
{
-#ifdef IWX_DEBUG
- iwx_bbl_add_entry(hcmd->id, IWX_BBL_CMD_TX, ticks);
-#endif
struct iwx_tx_ring *ring = &sc->txq[IWX_DQA_CMD_QUEUE];
struct iwx_tfh_tfd *desc;
struct iwx_tx_data *txdata;
@@ -5717,9 +5714,6 @@ iwx_tx(struct iwx_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
memcpy(tx->hdr, wh, hdrlen);
txcmd_size = sizeof(*tx);
}
-#if IWX_DEBUG
- iwx_bbl_add_entry(totlen, IWX_BBL_PKT_TX, ticks);
-#endif
/* Trim 802.11 header. */
m_adj(m, hdrlen);
@@ -8565,9 +8559,6 @@ iwx_watchdog(void *arg)
if (--sc->sc_tx_timer[i] == 0) {
printf("%s: device timeout\n", DEVNAME(sc));
- if (sc->sc_debug)
- iwx_bbl_print_log();
-
iwx_nic_error(sc);
iwx_dump_driver_status(sc);
ieee80211_restart_all(ic);
@@ -8892,9 +8883,7 @@ iwx_rx_pkt(struct iwx_softc *sc, struct iwx_rx_data *data, struct mbuf *ml)
if (!iwx_rx_pkt_valid(pkt))
break;
-#ifdef IWX_DEBUG
- iwx_bbl_add_entry(pkt->hdr.code, IWX_BBL_CMD_RX, ticks);
-#endif
+
/*
* XXX Intel inside (tm)
* Any commands in the LONG_GROUP could actually be in the
@@ -9507,7 +9496,6 @@ iwx_intr_msix(void *arg)
(inta_hw & IWX_MSIX_HW_INT_CAUSES_REG_SW_ERR) ||
(inta_hw & IWX_MSIX_HW_INT_CAUSES_REG_SW_ERR_V2)) {
if (sc->sc_debug) {
- iwx_bbl_print_log();
iwx_nic_error(sc);
iwx_dump_driver_status(sc);
}
@@ -10022,12 +10010,11 @@ out:
const struct iwx_device_cfg *
iwx_find_device_cfg(struct iwx_softc *sc)
{
- uint16_t mac_type, rf_type;
+ uint16_t sdev_id, mac_type, rf_type;
uint8_t mac_step, cdb, jacket, rf_id, no_160, cores;
int i;
- uint16_t sdev_id;
- sdev_id = pci_get_device(sc->sc_dev);
+ sdev_id = pci_get_subdevice(sc->sc_dev);
mac_type = IWX_CSR_HW_REV_TYPE(sc->sc_hw_rev);
mac_step = IWX_CSR_HW_REV_STEP(sc->sc_hw_rev << 2);
rf_type = IWX_CSR_HW_RFID_TYPE(sc->sc_hw_rf_id);
diff --git a/sys/dev/iwx/if_iwx_debug.c b/sys/dev/iwx/if_iwx_debug.c
index 6a2bf32ad738..0c6658094282 100644
--- a/sys/dev/iwx/if_iwx_debug.c
+++ b/sys/dev/iwx/if_iwx_debug.c
@@ -19,30 +19,178 @@
#include <dev/iwx/if_iwxreg.h>
#include <dev/iwx/if_iwx_debug.h>
-static uint16_t bbl_idx = 0;
-static uint32_t bbl_seq = 0;
-static uint8_t bbl_compress = 1;
+static int print_codes[][2] = {
+#if 0
+ for example:
+ IWX_LEGACY_GROUP, IWX_ADD_STA_KEY,
+ IWX_LEGACY_GROUP, IWX_SCD_QUEUE_CONFIG_CMD,
+ IWX_LEGACY_GROUP, IWX_ADD_STA,
+ IWX_LEGACY_GROUP, IWX_REMOVE_STA,
+#endif
+};
-static const char *
-iwx_bbl_to_str(int type)
-{
- switch(type) {
- case IWX_BBL_PKT_TX:
- return ("IWX_BBL_PKT_TX");
- case IWX_BBL_PKT_RX:
- return ("IWX_BBL_PKT_RX");
- case IWX_BBL_PKT_DUP:
- return ("IWX_BBL_PKT_DUP");
- case IWX_BBL_CMD_TX:
- return ("IWX_BBL_CMD_TX");
- case IWX_BBL_CMD_RX:
- return ("IWX_BBL_CMD_RX");
- case IWX_BBL_ANY:
- return ("IWX_BBL_ANY");
- default:
- return ("ERROR");
- }
-}
+struct opcode_label {
+ uint8_t opcode;
+ const char *label;
+};
+
+static struct opcode_label command_group[] = {
+ { 0x0, "IWX_LEGACY_GROUP"},
+ { 0x1, "IWX_LONG_GROUP"},
+ { 0x2, "IWX_SYSTEM_GROUP"},
+ { 0x3, "IWX_MAC_CONF_GROUP"},
+ { 0x4, "IWX_PHY_OPS_GROUP"},
+ { 0x5, "IWX_DATA_PATH_GROUP"},
+ { 0xb, "IWX_PROT_OFFLOAD_GROUP"},
+ { 0xc, "IWX_REGULATORY_AND_NVM_GROUP"},
+ { 0, NULL }
+};
+
+static struct opcode_label legacy_opcodes[] = {
+ { 0xc0, "IWX_REPLY_RX_PHY_CMD" },
+ { 0xc1, "IWX_REPLY_RX_MPDU_CMD" },
+ { 0xc2, "IWX_BAR_FRAME_RELEASE" },
+ { 0xc3, "IWX_FRAME_RELEASE" },
+ { 0xc5, "IWX_BA_NOTIF" },
+ { 0x62, "IWX_TEMPERATURE_NOTIFICATION" },
+ { 0xc8, "IWX_MCC_UPDATE_CMD" },
+ { 0xc9, "IWX_MCC_CHUB_UPDATE_CMD" },
+ { 0x65, "IWX_CALIBRATION_CFG_CMD" },
+ { 0x66, "IWX_CALIBRATION_RES_NOTIFICATION" },
+ { 0x67, "IWX_CALIBRATION_COMPLETE_NOTIFICATION" },
+ { 0x68, "IWX_RADIO_VERSION_NOTIFICATION" },
+ { 0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE" },
+ { 0x01, "IWX_SOC_CONFIGURATION_CMD" },
+ { 0x02, "IWX_REPLY_ERROR" },
+ { 0x03, "IWX_CTDP_CONFIG_CMD" },
+ { 0x04, "IWX_INIT_COMPLETE_NOTIF" },
+ { 0x05, "IWX_SESSION_PROTECTION_CMD" },
+ { 0x5d, "IWX_BT_COEX_CI" },
+ { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" },
+ { 0x08, "IWX_RLC_CONFIG_CMD" },
+ { 0xd0, "IWX_MCAST_FILTER_CMD" },
+ { 0xd1, "IWX_REPLY_SF_CFG_CMD" },
+ { 0xd2, "IWX_REPLY_BEACON_FILTERING_CMD" },
+ { 0xd3, "IWX_D3_CONFIG_CMD" },
+ { 0xd4, "IWX_PROT_OFFLOAD_CONFIG_CMD" },
+ { 0xd5, "IWX_OFFLOADS_QUERY_CMD" },
+ { 0xd6, "IWX_REMOTE_WAKE_CONFIG_CMD" },
+ { 0x77, "IWX_POWER_TABLE_CMD" },
+ { 0x78, "IWX_PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION" },
+ { 0xcc, "IWX_BT_COEX_PRIO_TABLE" },
+ { 0xcd, "IWX_BT_COEX_PROT_ENV" },
+ { 0xce, "IWX_BT_PROFILE_NOTIFICATION" },
+ { 0x6a, "IWX_PHY_CONFIGURATION_CMD" },
+ { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" },
+ { 0x17, "IWX_ADD_STA_KEY" },
+ { 0x18, "IWX_ADD_STA" },
+ { 0x19, "IWX_REMOVE_STA" },
+ { 0xe0, "IWX_WOWLAN_PATTERNS" },
+ { 0xe1, "IWX_WOWLAN_CONFIGURATION" },
+ { 0xe2, "IWX_WOWLAN_TSC_RSC_PARAM" },
+ { 0xe3, "IWX_WOWLAN_TKIP_PARAM" },
+ { 0xe4, "IWX_WOWLAN_KEK_KCK_MATERIAL" },
+ { 0xe5, "IWX_WOWLAN_GET_STATUSES" },
+ { 0xe6, "IWX_WOWLAN_TX_POWER_PER_DB" },
+ { 0x0f, "IWX_SCAN_COMPLETE_UMAC" },
+ { 0x88, "IWX_NVM_ACCESS_CMD" },
+ { 0x20, "IWX_WEP_KEY" },
+ { 0xdc, "IWX_CMD_DTS_MEASUREMENT_TRIGGER" },
+ { 0xdd, "IWX_DTS_MEASUREMENT_NOTIFICATION" },
+ { 0x28, "IWX_MAC_CONTEXT_CMD" },
+ { 0x29, "IWX_TIME_EVENT_CMD" },
+ { 0x01, "IWX_ALIVE" },
+ { 0xf0, "IWX_REPLY_DEBUG_CMD" },
+ { 0x90, "IWX_BEACON_NOTIFICATION" },
+ { 0xf5, "IWX_RX_NO_DATA_NOTIF" },
+ { 0x08, "IWX_PHY_CONTEXT_CMD" },
+ { 0x91, "IWX_BEACON_TEMPLATE_CMD" },
+ { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" },
+ { 0x09, "IWX_DBG_CFG" },
+ { 0xf7, "IWX_DEBUG_LOG_MSG" },
+ { 0x1c, "IWX_TX_CMD" },
+ { 0x1d, "IWX_SCD_QUEUE_CFG" },
+ { 0x1e, "IWX_TXPATH_FLUSH" },
+ { 0x1f, "IWX_MGMT_MCAST_KEY" },
+ { 0x98, "IWX_TX_ANT_CONFIGURATION_CMD" },
+ { 0xee, "IWX_LTR_CONFIG" },
+ { 0x8e, "IWX_SET_CALIB_DEFAULT_CMD" },
+ { 0xFE, "IWX_CT_KILL_NOTIFICATION" },
+ { 0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE" },
+ { 0x2a, "IWX_TIME_EVENT_NOTIFICATION" },
+ { 0x2b, "IWX_BINDING_CONTEXT_CMD" },
+ { 0x2c, "IWX_TIME_QUOTA_CMD" },
+ { 0x2d, "IWX_NON_QOS_TX_COUNTER_CMD" },
+ { 0xa0, "IWX_CARD_STATE_CMD" },
+ { 0xa1, "IWX_CARD_STATE_NOTIFICATION" },
+ { 0xa2, "IWX_MISSED_BEACONS_NOTIFICATION" },
+ { 0x0c, "IWX_SCAN_CFG_CMD" },
+ { 0x0d, "IWX_SCAN_REQ_UMAC" },
+ { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" },
+ { 0x0e, "IWX_SCAN_ABORT_UMAC" },
+ { 0xfe, "IWX_PNVM_INIT_COMPLETE" },
+ { 0xa9, "IWX_MAC_PM_POWER_TABLE" },
+ { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" },
+ { 0x9b, "IWX_BT_CONFIG" },
+ { 0x9c, "IWX_STATISTICS_CMD" },
+ { 0x9d, "IWX_STATISTICS_NOTIFICATION" },
+ { 0x9f, "IWX_REDUCE_TX_POWER_CMD" },
+ { 0xb1, "IWX_MFUART_LOAD_NOTIFICATION" },
+ { 0xb5, "IWX_SCAN_ITERATION_COMPLETE_UMAC" },
+ { 0x54, "IWX_NET_DETECT_CONFIG_CMD" },
+ { 0x56, "IWX_NET_DETECT_PROFILES_QUERY_CMD" },
+ { 0x57, "IWX_NET_DETECT_PROFILES_CMD" },
+ { 0x58, "IWX_NET_DETECT_HOTSPOTS_CMD" },
+ { 0x59, "IWX_NET_DETECT_HOTSPOTS_QUERY_CMD" },
+ { 0, NULL }
+};
+
+/* SYSTEM_GROUP group subcommand IDs */
+static struct opcode_label system_opcodes[] = {
+ { 0x00, "IWX_SHARED_MEM_CFG_CMD" },
+ { 0x01, "IWX_SOC_CONFIGURATION_CMD" },
+ { 0x03, "IWX_INIT_EXTENDED_CFG_CMD" },
+ { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" },
+ { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" },
+ { 0, NULL }
+};
+
+/* MAC_CONF group subcommand IDs */
+static struct opcode_label macconf_opcodes[] = {
+ { 0x05, "IWX_SESSION_PROTECTION_CMD" },
+ { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" },
+ { 0, NULL }
+};
+
+/* DATA_PATH group subcommand IDs */
+static struct opcode_label data_opcodes[] = {
+ { 0x00, "IWX_DQA_ENABLE_CMD" },
+ { 0x08, "IWX_RLC_CONFIG_CMD" },
+ { 0x0f, "IWX_TLC_MNG_CONFIG_CMD" },
+ { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" },
+ { 0x17, "IWX_SCD_QUEUE_CONFIG_CMD" },
+ { 0xf5, "IWX_RX_NO_DATA_NOTIF" },
+ { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" },
+ { 0xf7, "IWX_TLC_MNG_UPDATE_NOTIF" },
+ { 0, NULL }
+};
+
+/* REGULATORY_AND_NVM group subcommand IDs */
+static struct opcode_label reg_opcodes[] = {
+ { 0x00, "IWX_NVM_ACCESS_COMPLETE" },
+ { 0x02, "IWX_NVM_GET_INFO " },
+ { 0xfe, "IWX_PNVM_INIT_COMPLETE" },
+ { 0, NULL }
+};
+
+/* PHY_OPS subcommand IDs */
+static struct opcode_label phyops_opcodes[] = {
+ {0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE"},
+ {0x03, "IWX_CTDP_CONFIG_CMD"},
+ {0x04, "IWX_TEMP_REPORTING_THRESHOLDS_CMD"},
+ {0xFE, "IWX_CT_KILL_NOTIFICATION"},
+ {0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE"},
+};
static const char *
get_label(struct opcode_label *table, uint8_t opcode)
@@ -87,9 +235,9 @@ get_table(uint8_t group)
}
void
-print_opcode(const char *func, int line, int type, uint32_t code)
+print_opcode(const char *func, int line, uint32_t code)
{
- int print = print_mask & type;
+ int print = 0;
uint8_t opcode = iwx_cmd_opcode(code);
uint8_t group = iwx_cmd_groupid(code);
@@ -104,112 +252,13 @@ print_opcode(const char *func, int line, int type, uint32_t code)
print = 1;
if (print) {
- printf("%s:%d %s\t%s\t%s\t(0x%08x)\n", func, line,
- iwx_bbl_to_str(type), get_label(command_group, group),
+ printf("%s:%d \t%s\t%s\t(0x%08x)\n", func, line,
+ get_label(command_group, group),
get_label(table, opcode), code);
}
}
void
-iwx_dump_cmd(uint32_t id, void *data, uint16_t len, const char *str, int type)
-{
- int dump = dump_mask & type;
- uint8_t opcode = iwx_cmd_opcode(id);
- uint8_t group = iwx_cmd_groupid(id);
-
- for (int i = 0; i < nitems(dump_codes); i++)
- if (dump_codes[i][0] == group && dump_codes[i][1] == opcode)
- dump = 1;
-
- if (dump)
- hexdump(data, len, str, 0);
-}
-
-void
-iwx_bbl_add_entry(uint32_t code, int type, int ticks)
-{
- /*
- * Compress together repeated notifications, but increment the sequence
- * number so we can track things processing.
- */
- if (bbl_compress && (iwx_bb_log[bbl_idx].code == code &&
- iwx_bb_log[bbl_idx].type == type)) {
- iwx_bb_log[bbl_idx].count++;
- iwx_bb_log[bbl_idx].seq = bbl_seq++;
- iwx_bb_log[bbl_idx].ticks = ticks;
- return;
- }
-
- if (bbl_idx++ > IWX_BBL_ENTRIES) {
-#if 0
- printf("iwx bbl roll over: type %d (%lu)\n", type, code);
-#endif
- bbl_idx = 0;
- }
- iwx_bb_log[bbl_idx].code = code;
- iwx_bb_log[bbl_idx].type = type;
- iwx_bb_log[bbl_idx].seq = bbl_seq++;
- iwx_bb_log[bbl_idx].ticks = ticks;
- iwx_bb_log[bbl_idx].count = 1;
-}
-
-static void
-iwx_bbl_print_entry(struct iwx_bbl_entry *e)
-{
- uint8_t opcode = iwx_cmd_opcode(e->code);
- uint8_t group = iwx_cmd_groupid(e->code);
-
- switch(e->type) {
- case IWX_BBL_PKT_TX:
- printf("pkt ");
- printf("seq %08d\t pkt len %u",
- e->seq, e->code);
- break;
- printf("pkt dup ");
- printf("seq %08d\t dup count %u",
- e->seq, e->code);
- break;
- case IWX_BBL_CMD_TX:
- printf("tx -> ");
- printf("seq %08d\tcode 0x%08x (%s:%s)",
- e->seq, e->code, get_label(command_group, group),
- get_label(get_table(group), opcode));
- break;
- case IWX_BBL_CMD_RX:
- printf("rx ");
- printf("seq %08d\tcode 0x%08x (%s:%s)",
- e->seq, e->code, get_label(command_group, group),
- get_label(get_table(group), opcode));
- break;
- }
- if (e->count > 1)
- printf(" (count %d)", e->count);
- printf("\n");
-}
-
-void
-iwx_bbl_print_log(void)
-{
- int start = -1;
-
- start = bbl_idx+1;
- if (start > IWX_BBL_ENTRIES-1)
- start = 0;
-
- for (int i = start; i < IWX_BBL_ENTRIES; i++) {
- struct iwx_bbl_entry *e = &iwx_bb_log[i];
- printf("bbl entry %05d %05d: ", i, e->ticks);
- iwx_bbl_print_entry(e);
- }
- for (int i = 0; i < start; i++) {
- struct iwx_bbl_entry *e = &iwx_bb_log[i];
- printf("bbl entry %05d %05d: ", i, e->ticks);
- iwx_bbl_print_entry(e);
- }
- printf("iwx bblog index %d seq %d\n", bbl_idx, bbl_seq);
-}
-
-void
print_ratenflags(const char *func, int line, uint32_t flags, int ver)
{
printf("%s:%d\n\t flags 0x%08x ", func, line, flags);
diff --git a/sys/dev/iwx/if_iwx_debug.h b/sys/dev/iwx/if_iwx_debug.h
index 80fd3ffa6eed..0079a7e7e753 100644
--- a/sys/dev/iwx/if_iwx_debug.h
+++ b/sys/dev/iwx/if_iwx_debug.h
@@ -53,213 +53,7 @@ enum {
#define IWX_DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
#endif
-void print_opcode(const char *, int, int, uint32_t);
+void print_opcode(const char *, int, uint32_t);
void print_ratenflags(const char *, int , uint32_t , int );
-void iwx_dump_cmd(uint32_t , void *, uint16_t, const char *, int);
-void iwx_bbl_add_entry(uint32_t, int, int);
-void iwx_bbl_print_log(void);
-
-#define IWX_BBL_NONE 0x00
-#define IWX_BBL_PKT_TX 0x01
-#define IWX_BBL_PKT_RX 0x02
-#define IWX_BBL_PKT_DUP 0x04
-#define IWX_BBL_CMD_TX 0x10
-#define IWX_BBL_CMD_RX 0x20
-#define IWX_BBL_ANY 0xFF
-
-static int print_mask = IWX_BBL_NONE; //IWX_BBL_NONE | IWX_BBL_CMD_TX;
-static int print_codes[][2] = {
-#if 0
- for example:
- IWX_LEGACY_GROUP, IWX_ADD_STA_KEY,
- IWX_LEGACY_GROUP, IWX_SCD_QUEUE_CONFIG_CMD,
- IWX_LEGACY_GROUP, IWX_ADD_STA,
- IWX_LEGACY_GROUP, IWX_REMOVE_STA,
-#endif
-};
-
-static int dump_mask = IWX_BBL_NONE;
-static int dump_codes[][2] = {
-#if 0
- for example:
- IWX_LEGACY_GROUP, IWX_ADD_STA_KEY,
- IWX_LEGACY_GROUP, IWX_SCD_QUEUE_CONFIG_CMD,
- IWX_LEGACY_GROUP, IWX_ADD_STA,
- IWX_LEGACY_GROUP, IWX_REMOVE_STA,
-#endif
-};
-
-struct opcode_label {
- uint8_t opcode;
- const char *label;
-};
-
-static struct opcode_label command_group[] = {
- { 0x0, "IWX_LEGACY_GROUP"},
- { 0x1, "IWX_LONG_GROUP"},
- { 0x2, "IWX_SYSTEM_GROUP"},
- { 0x3, "IWX_MAC_CONF_GROUP"},
- { 0x4, "IWX_PHY_OPS_GROUP"},
- { 0x5, "IWX_DATA_PATH_GROUP"},
- { 0xb, "IWX_PROT_OFFLOAD_GROUP"},
- { 0xc, "IWX_REGULATORY_AND_NVM_GROUP"},
- { 0, NULL }
-};
-
-static struct opcode_label legacy_opcodes[] = {
- { 0xc0, "IWX_REPLY_RX_PHY_CMD" },
- { 0xc1, "IWX_REPLY_RX_MPDU_CMD" },
- { 0xc2, "IWX_BAR_FRAME_RELEASE" },
- { 0xc3, "IWX_FRAME_RELEASE" },
- { 0xc5, "IWX_BA_NOTIF" },
- { 0x62, "IWX_TEMPERATURE_NOTIFICATION" },
- { 0xc8, "IWX_MCC_UPDATE_CMD" },
- { 0xc9, "IWX_MCC_CHUB_UPDATE_CMD" },
- { 0x65, "IWX_CALIBRATION_CFG_CMD" },
- { 0x66, "IWX_CALIBRATION_RES_NOTIFICATION" },
- { 0x67, "IWX_CALIBRATION_COMPLETE_NOTIFICATION" },
- { 0x68, "IWX_RADIO_VERSION_NOTIFICATION" },
- { 0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE" },
- { 0x01, "IWX_SOC_CONFIGURATION_CMD" },
- { 0x02, "IWX_REPLY_ERROR" },
- { 0x03, "IWX_CTDP_CONFIG_CMD" },
- { 0x04, "IWX_INIT_COMPLETE_NOTIF" },
- { 0x05, "IWX_SESSION_PROTECTION_CMD" },
- { 0x5d, "IWX_BT_COEX_CI" },
- { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" },
- { 0x08, "IWX_RLC_CONFIG_CMD" },
- { 0xd0, "IWX_MCAST_FILTER_CMD" },
- { 0xd1, "IWX_REPLY_SF_CFG_CMD" },
- { 0xd2, "IWX_REPLY_BEACON_FILTERING_CMD" },
- { 0xd3, "IWX_D3_CONFIG_CMD" },
- { 0xd4, "IWX_PROT_OFFLOAD_CONFIG_CMD" },
- { 0xd5, "IWX_OFFLOADS_QUERY_CMD" },
- { 0xd6, "IWX_REMOTE_WAKE_CONFIG_CMD" },
- { 0x77, "IWX_POWER_TABLE_CMD" },
- { 0x78, "IWX_PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION" },
- { 0xcc, "IWX_BT_COEX_PRIO_TABLE" },
- { 0xcd, "IWX_BT_COEX_PROT_ENV" },
- { 0xce, "IWX_BT_PROFILE_NOTIFICATION" },
- { 0x6a, "IWX_PHY_CONFIGURATION_CMD" },
- { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" },
- { 0x17, "IWX_ADD_STA_KEY" },
- { 0x18, "IWX_ADD_STA" },
- { 0x19, "IWX_REMOVE_STA" },
- { 0xe0, "IWX_WOWLAN_PATTERNS" },
- { 0xe1, "IWX_WOWLAN_CONFIGURATION" },
- { 0xe2, "IWX_WOWLAN_TSC_RSC_PARAM" },
- { 0xe3, "IWX_WOWLAN_TKIP_PARAM" },
- { 0xe4, "IWX_WOWLAN_KEK_KCK_MATERIAL" },
- { 0xe5, "IWX_WOWLAN_GET_STATUSES" },
- { 0xe6, "IWX_WOWLAN_TX_POWER_PER_DB" },
- { 0x0f, "IWX_SCAN_COMPLETE_UMAC" },
- { 0x88, "IWX_NVM_ACCESS_CMD" },
- { 0x20, "IWX_WEP_KEY" },
- { 0xdc, "IWX_CMD_DTS_MEASUREMENT_TRIGGER" },
- { 0xdd, "IWX_DTS_MEASUREMENT_NOTIFICATION" },
- { 0x28, "IWX_MAC_CONTEXT_CMD" },
- { 0x29, "IWX_TIME_EVENT_CMD" },
- { 0x01, "IWX_ALIVE" },
- { 0xf0, "IWX_REPLY_DEBUG_CMD" },
- { 0x90, "IWX_BEACON_NOTIFICATION" },
- { 0xf5, "IWX_RX_NO_DATA_NOTIF" },
- { 0x08, "IWX_PHY_CONTEXT_CMD" },
- { 0x91, "IWX_BEACON_TEMPLATE_CMD" },
- { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" },
- { 0x09, "IWX_DBG_CFG" },
- { 0xf7, "IWX_DEBUG_LOG_MSG" },
- { 0x1c, "IWX_TX_CMD" },
- { 0x1d, "IWX_SCD_QUEUE_CFG" },
- { 0x1e, "IWX_TXPATH_FLUSH" },
- { 0x1f, "IWX_MGMT_MCAST_KEY" },
- { 0x98, "IWX_TX_ANT_CONFIGURATION_CMD" },
- { 0xee, "IWX_LTR_CONFIG" },
- { 0x8e, "IWX_SET_CALIB_DEFAULT_CMD" },
- { 0xFE, "IWX_CT_KILL_NOTIFICATION" },
- { 0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE" },
- { 0x2a, "IWX_TIME_EVENT_NOTIFICATION" },
- { 0x2b, "IWX_BINDING_CONTEXT_CMD" },
- { 0x2c, "IWX_TIME_QUOTA_CMD" },
- { 0x2d, "IWX_NON_QOS_TX_COUNTER_CMD" },
- { 0xa0, "IWX_CARD_STATE_CMD" },
- { 0xa1, "IWX_CARD_STATE_NOTIFICATION" },
- { 0xa2, "IWX_MISSED_BEACONS_NOTIFICATION" },
- { 0x0c, "IWX_SCAN_CFG_CMD" },
- { 0x0d, "IWX_SCAN_REQ_UMAC" },
- { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" },
- { 0x0e, "IWX_SCAN_ABORT_UMAC" },
- { 0xfe, "IWX_PNVM_INIT_COMPLETE" },
- { 0xa9, "IWX_MAC_PM_POWER_TABLE" },
- { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" },
- { 0x9b, "IWX_BT_CONFIG" },
- { 0x9c, "IWX_STATISTICS_CMD" },
- { 0x9d, "IWX_STATISTICS_NOTIFICATION" },
- { 0x9f, "IWX_REDUCE_TX_POWER_CMD" },
- { 0xb1, "IWX_MFUART_LOAD_NOTIFICATION" },
- { 0xb5, "IWX_SCAN_ITERATION_COMPLETE_UMAC" },
- { 0x54, "IWX_NET_DETECT_CONFIG_CMD" },
- { 0x56, "IWX_NET_DETECT_PROFILES_QUERY_CMD" },
- { 0x57, "IWX_NET_DETECT_PROFILES_CMD" },
- { 0x58, "IWX_NET_DETECT_HOTSPOTS_CMD" },
- { 0x59, "IWX_NET_DETECT_HOTSPOTS_QUERY_CMD" },
- { 0, NULL }
-};
-
-/* SYSTEM_GROUP group subcommand IDs */
-static struct opcode_label system_opcodes[] = {
- { 0x00, "IWX_SHARED_MEM_CFG_CMD" },
- { 0x01, "IWX_SOC_CONFIGURATION_CMD" },
- { 0x03, "IWX_INIT_EXTENDED_CFG_CMD" },
- { 0x07, "IWX_FW_ERROR_RECOVERY_CMD" },
- { 0xff, "IWX_FSEQ_VER_MISMATCH_NOTIFICATION | IWX_REPLY_MAX" },
- { 0, NULL }
-};
-
-/* MAC_CONF group subcommand IDs */
-static struct opcode_label macconf_opcodes[] = {
- { 0x05, "IWX_SESSION_PROTECTION_CMD" },
- { 0xfb, "IWX_SESSION_PROTECTION_NOTIF" },
- { 0, NULL }
-};
-
-/* DATA_PATH group subcommand IDs */
-static struct opcode_label data_opcodes[] = {
- { 0x00, "IWX_DQA_ENABLE_CMD" },
- { 0x08, "IWX_RLC_CONFIG_CMD" },
- { 0x0f, "IWX_TLC_MNG_CONFIG_CMD" },
- { 0x16, "IWX_RX_BAID_ALLOCATION_CONFIG_CMD" },
- { 0x17, "IWX_SCD_QUEUE_CONFIG_CMD" },
- { 0xf5, "IWX_RX_NO_DATA_NOTIF" },
- { 0xf6, "IWX_THERMAL_DUAL_CHAIN_REQUEST" },
- { 0xf7, "IWX_TLC_MNG_UPDATE_NOTIF" },
- { 0, NULL }
-};
-
-/* REGULATORY_AND_NVM group subcommand IDs */
-static struct opcode_label reg_opcodes[] = {
- { 0x00, "IWX_NVM_ACCESS_COMPLETE" },
- { 0x02, "IWX_NVM_GET_INFO " },
- { 0xfe, "IWX_PNVM_INIT_COMPLETE" },
- { 0, NULL }
-};
-
-/* PHY_OPS subcommand IDs */
-static struct opcode_label phyops_opcodes[] = {
- {0x00, "IWX_CMD_DTS_MEASUREMENT_TRIGGER_WIDE"},
- {0x03, "IWX_CTDP_CONFIG_CMD"},
- {0x04, "IWX_TEMP_REPORTING_THRESHOLDS_CMD"},
- {0xFE, "IWX_CT_KILL_NOTIFICATION"},
- {0xFF, "IWX_DTS_MEASUREMENT_NOTIF_WIDE"},
-};
-
-struct iwx_bbl_entry {
- uint8_t type;
- uint32_t code;
- uint32_t seq;
- uint32_t ticks;
- uint32_t count;
-};
-#define IWX_BBL_ENTRIES 2000
-static struct iwx_bbl_entry iwx_bb_log[IWX_BBL_ENTRIES];
#endif /* __IF_IWX_DEBUG_H__ */
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index c3539cf8b8f2..f83506bda1aa 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -169,186 +169,186 @@ static const struct media mlx5e_mode_table[MLX5E_LINK_SPEEDS_NUMBER] =
},
};
-static const struct media mlx5e_ext_mode_table[MLX5E_EXT_LINK_SPEEDS_NUMBER][MLX5E_CABLE_TYPE_NUMBER] =
+static const struct media mlx5e_ext_mode_table[MLX5E_EXT_LINK_SPEEDS_NUMBER][MLX5E_CONNECTOR_TYPE_NUMBER] =
{
/**/
- [MLX5E_SGMII_100M][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_SGMII_100M][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_100_SGMII,
.baudrate = IF_Mbps(100),
},
/**/
- [MLX5E_1000BASE_X_SGMII][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_1000BASE_X_SGMII][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_1000_CX,
.baudrate = IF_Mbps(1000),
},
- [MLX5E_1000BASE_X_SGMII][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_1000BASE_X_SGMII][MLX5E_PORT_FIBRE] = {
.subtype = IFM_1000_SX,
.baudrate = IF_Mbps(1000),
},
/**/
- [MLX5E_5GBASE_R][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_5GBASE_R][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_5000_KR,
.baudrate = IF_Mbps(5000),
},
- [MLX5E_5GBASE_R][MLX5E_CABLE_TYPE_TWISTED_PAIR] = {
+ [MLX5E_5GBASE_R][MLX5E_PORT_TP] = {
.subtype = IFM_5000_T,
.baudrate = IF_Mbps(5000),
},
/**/
- [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_10G_KR,
.baudrate = IF_Gbps(10ULL),
},
- [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_PORT_DA] = {
.subtype = IFM_10G_CR1,
.baudrate = IF_Gbps(10ULL),
},
- [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_PORT_FIBRE] = {
.subtype = IFM_10G_SR,
.baudrate = IF_Gbps(10ULL),
},
/**/
- [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_40G_KR4,
.baudrate = IF_Gbps(40ULL),
},
- [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_PORT_DA] = {
.subtype = IFM_40G_CR4,
.baudrate = IF_Gbps(40ULL),
},
- [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_PORT_FIBRE] = {
.subtype = IFM_40G_SR4,
.baudrate = IF_Gbps(40ULL),
},
/**/
- [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_25G_KR,
.baudrate = IF_Gbps(25ULL),
},
- [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_PORT_DA] = {
.subtype = IFM_25G_CR,
.baudrate = IF_Gbps(25ULL),
},
- [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_PORT_FIBRE] = {
.subtype = IFM_25G_SR,
.baudrate = IF_Gbps(25ULL),
},
- [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_CABLE_TYPE_TWISTED_PAIR] = {
+ [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_PORT_TP] = {
.subtype = IFM_25G_T,
.baudrate = IF_Gbps(25ULL),
},
/**/
- [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_50G_KR2,
.baudrate = IF_Gbps(50ULL),
},
- [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_PORT_DA] = {
.subtype = IFM_50G_CR2,
.baudrate = IF_Gbps(50ULL),
},
- [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_PORT_FIBRE] = {
.subtype = IFM_50G_SR2,
.baudrate = IF_Gbps(50ULL),
},
/**/
- [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_50G_KR_PAM4,
.baudrate = IF_Gbps(50ULL),
},
- [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_PORT_DA] = {
.subtype = IFM_50G_CP,
.baudrate = IF_Gbps(50ULL),
},
- [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_PORT_FIBRE] = {
.subtype = IFM_50G_SR,
.baudrate = IF_Gbps(50ULL),
},
/**/
- [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_100G_KR4,
.baudrate = IF_Gbps(100ULL),
},
- [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_PORT_DA] = {
.subtype = IFM_100G_CR4,
.baudrate = IF_Gbps(100ULL),
},
- [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_PORT_FIBRE] = {
.subtype = IFM_100G_SR4,
.baudrate = IF_Gbps(100ULL),
},
/**/
- [MLX5E_100GAUI_1_100GBASE_CR_KR][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_100GAUI_1_100GBASE_CR_KR][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_100G_KR_PAM4,
.baudrate = IF_Gbps(100ULL),
},
- [MLX5E_100GAUI_1_100GBASE_CR_KR][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_100GAUI_1_100GBASE_CR_KR][MLX5E_PORT_DA] = {
.subtype = IFM_100G_CR_PAM4,
.baudrate = IF_Gbps(100ULL),
},
- [MLX5E_100GAUI_1_100GBASE_CR_KR][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_100GAUI_1_100GBASE_CR_KR][MLX5E_PORT_FIBRE] = {
.subtype = IFM_100G_SR2, /* XXX */
.baudrate = IF_Gbps(100ULL),
},
/**/
- [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_100G_KR4,
.baudrate = IF_Gbps(100ULL),
},
- [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_PORT_DA] = {
.subtype = IFM_100G_CP2,
.baudrate = IF_Gbps(100ULL),
},
- [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_PORT_FIBRE] = {
.subtype = IFM_100G_SR2,
.baudrate = IF_Gbps(100ULL),
},
/**/
- [MLX5E_200GAUI_2_200GBASE_CR2_KR2][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_200GAUI_2_200GBASE_CR2_KR2][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_200G_KR4_PAM4, /* XXX */
.baudrate = IF_Gbps(200ULL),
},
- [MLX5E_200GAUI_2_200GBASE_CR2_KR2][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_200GAUI_2_200GBASE_CR2_KR2][MLX5E_PORT_DA] = {
.subtype = IFM_200G_CR4_PAM4, /* XXX */
.baudrate = IF_Gbps(200ULL),
},
- [MLX5E_200GAUI_2_200GBASE_CR2_KR2][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_200GAUI_2_200GBASE_CR2_KR2][MLX5E_PORT_FIBRE] = {
.subtype = IFM_200G_SR4, /* XXX */
.baudrate = IF_Gbps(200ULL),
},
/**/
- [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_200G_KR4_PAM4,
.baudrate = IF_Gbps(200ULL),
},
- [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_CABLE_TYPE_PASSIVE_COPPER] = {
+ [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_PORT_DA] = {
.subtype = IFM_200G_CR4_PAM4,
.baudrate = IF_Gbps(200ULL),
},
- [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_CABLE_TYPE_OPTICAL_MODULE] = {
+ [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_PORT_FIBRE] = {
.subtype = IFM_200G_SR4,
.baudrate = IF_Gbps(200ULL),
},
/**/
- [MLX5E_400GAUI_8][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_400GAUI_8][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_400G_LR8, /* XXX */
.baudrate = IF_Gbps(400ULL),
},
/**/
- [MLX5E_400GAUI_4_400GBASE_CR4_KR4][MLX5E_CABLE_TYPE_UNKNOWN] = {
+ [MLX5E_400GAUI_4_400GBASE_CR4_KR4][MLX5E_PORT_UNKNOWN] = {
.subtype = IFM_400G_LR8, /* XXX */
.baudrate = IF_Gbps(400ULL),
},
@@ -372,7 +372,7 @@ mlx5e_update_carrier(struct mlx5e_priv *priv)
u32 eth_proto_oper;
int error;
u8 i;
- u8 cable_type;
+ u8 connector_type;
u8 port_state;
u8 is_er_type;
bool ext;
@@ -403,24 +403,14 @@ mlx5e_update_carrier(struct mlx5e_priv *priv)
ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
eth_proto_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext,
eth_proto_oper);
-
+ connector_type = MLX5_GET(ptys_reg, out, connector_type);
i = ilog2(eth_proto_oper);
if (ext) {
- error = mlx5_query_pddr_cable_type(mdev, 1, &cable_type);
- if (error != 0) {
- /* use fallback entry */
- media_entry = mlx5e_ext_mode_table[i][MLX5E_CABLE_TYPE_UNKNOWN];
-
- mlx5_en_err(priv->ifp,
- "query port pddr failed: %d\n", error);
- } else {
- media_entry = mlx5e_ext_mode_table[i][cable_type];
-
+ media_entry = mlx5e_ext_mode_table[i][connector_type];
/* check if we should use fallback entry */
- if (media_entry.subtype == 0)
- media_entry = mlx5e_ext_mode_table[i][MLX5E_CABLE_TYPE_UNKNOWN];
- }
+ if (media_entry.subtype == 0)
+ media_entry = mlx5e_ext_mode_table[i][MLX5E_PORT_UNKNOWN];
} else {
media_entry = mlx5e_mode_table[i];
}
diff --git a/sys/dev/mlx5/port.h b/sys/dev/mlx5/port.h
index bfbc721139d3..a35265852ae4 100644
--- a/sys/dev/mlx5/port.h
+++ b/sys/dev/mlx5/port.h
@@ -128,6 +128,19 @@ enum mlx5e_ext_link_speed {
MLX5E_EXT_LINK_SPEEDS_NUMBER = 32,
};
+enum mlx5e_connector_type {
+ MLX5E_PORT_UNKNOWN = 0,
+ MLX5E_PORT_NONE = 1,
+ MLX5E_PORT_TP = 2,
+ MLX5E_PORT_AUI = 3,
+ MLX5E_PORT_BNC = 4,
+ MLX5E_PORT_MII = 5,
+ MLX5E_PORT_FIBRE = 6,
+ MLX5E_PORT_DA = 7,
+ MLX5E_PORT_OTHER = 8,
+ MLX5E_CONNECTOR_TYPE_NUMBER = 9,
+};
+
enum mlx5e_cable_type {
MLX5E_CABLE_TYPE_UNKNOWN = 0,
MLX5E_CABLE_TYPE_ACTIVE_CABLE = 1,
diff --git a/sys/dev/mmc/bridge.h b/sys/dev/mmc/bridge.h
index 4ec082a61b55..bd08b695c84a 100644
--- a/sys/dev/mmc/bridge.h
+++ b/sys/dev/mmc/bridge.h
@@ -103,6 +103,10 @@ enum mmc_chip_select {
cs_dontcare = 0, cs_high, cs_low
};
+enum mmc_bus_type {
+ bus_type_default = 0, bus_type_spi
+};
+
enum mmc_bus_width {
bus_width_1 = 0, bus_width_4 = 2, bus_width_8 = 3
};
@@ -123,6 +127,7 @@ struct mmc_ios {
uint32_t clock; /* Speed of the clock in Hz to move data */
enum mmc_vdd vdd; /* Voltage to apply to the power pins */
enum mmc_vccq vccq; /* Voltage to use for signaling */
+ enum mmc_bus_type bus_type;
enum mmc_bus_mode bus_mode;
enum mmc_chip_select chip_select;
enum mmc_bus_width bus_width;
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c
index 78b38f91a1f0..f4ea8faca35c 100644
--- a/sys/dev/mmc/mmc.c
+++ b/sys/dev/mmc/mmc.c
@@ -701,6 +701,10 @@ mmc_select_card(struct mmc_softc *sc, uint16_t rca)
{
int err, flags;
+ /* No card selection in SPI mode. */
+ if (mmcbr_get_bus_type(sc->dev) == bus_type_spi)
+ return (MMC_ERR_NONE);
+
flags = (rca ? MMC_RSP_R1B : MMC_RSP_NONE) | MMC_CMD_AC;
sc->retune_paused++;
err = mmc_wait_for_command(sc, MMC_SELECT_CARD, (uint32_t)rca << 16,
@@ -900,6 +904,10 @@ mmc_set_timing(struct mmc_softc *sc, struct mmc_ivars *ivar,
uint8_t value;
int err;
+ /* No timings in SPI mode. */
+ if (mmcbr_get_bus_type(sc->dev) == bus_type_spi)
+ return (MMC_ERR_NONE);
+
if (mmcbr_get_mode(sc->dev) == mode_sd) {
switch (timing) {
case bus_timing_normal:
diff --git a/sys/dev/mmc/mmc_subr.c b/sys/dev/mmc/mmc_subr.c
index 0a555cd74c97..fba99e791dff 100644
--- a/sys/dev/mmc/mmc_subr.c
+++ b/sys/dev/mmc/mmc_subr.c
@@ -112,6 +112,8 @@ mmc_wait_for_app_cmd(device_t busdev, device_t dev, uint16_t rca,
sc = device_get_softc(busdev);
+ cmd->flags |= MMC_CMD_IS_APP;
+
/* Squelch error reporting at lower levels, we report below. */
sc->squelched++;
do {
diff --git a/sys/dev/mmc/mmcbrvar.h b/sys/dev/mmc/mmcbrvar.h
index 8faef227324b..c47966793098 100644
--- a/sys/dev/mmc/mmcbrvar.h
+++ b/sys/dev/mmc/mmcbrvar.h
@@ -60,6 +60,7 @@
#include "mmcbr_if.h"
enum mmcbr_device_ivars {
+ MMCBR_IVAR_BUS_TYPE,
MMCBR_IVAR_BUS_MODE,
MMCBR_IVAR_BUS_WIDTH,
MMCBR_IVAR_CHIP_SELECT,
@@ -113,6 +114,17 @@ mmcbr_get_retune_req(device_t dev)
return ((int)v);
}
+static int __inline
+mmcbr_get_bus_type(device_t dev)
+{
+ uintptr_t v;
+
+ if (__predict_false(BUS_READ_IVAR(device_get_parent(dev), dev,
+ MMCBR_IVAR_BUS_TYPE, &v) != 0))
+ return (bus_type_default);
+ return ((int)v);
+}
+
/*
* Convenience wrappers for the mmcbr interface
*/
diff --git a/sys/dev/mmc/mmcreg.h b/sys/dev/mmc/mmcreg.h
index b544e3dd41e5..e5783249c67b 100644
--- a/sys/dev/mmc/mmcreg.h
+++ b/sys/dev/mmc/mmcreg.h
@@ -80,6 +80,7 @@ struct mmc_command {
#define MMC_CMD_BC (2ul << 5) /* Broadcast command, no response */
#define MMC_CMD_BCR (3ul << 5) /* Broadcast command with response */
#define MMC_CMD_MASK (3ul << 5)
+#define MMC_CMD_IS_APP (1ul << 7) /* Next cmd after MMC_APP_CMD */
/* Possible response types defined in the standard: */
#define MMC_RSP_NONE (0)
diff --git a/sys/dev/mmc/mmcspi.c b/sys/dev/mmc/mmcspi.c
new file mode 100644
index 000000000000..d18f7aeb8cc0
--- /dev/null
+++ b/sys/dev/mmc/mmcspi.c
@@ -0,0 +1,2378 @@
+/*-
+ * Copyright (c) 2012-2025 Patrick Kelsey. All rights reserved.
+ * Copyright (c) 2025 Ruslan Bukin <br@bsdpad.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Portions of this software may have been developed with reference to
+ * the SD Simplified Specification. The following disclaimer may apply:
+ *
+ * The following conditions apply to the release of the simplified
+ * specification ("Simplified Specification") by the SD Card Association and
+ * the SD Group. The Simplified Specification is a subset of the complete SD
+ * Specification which is owned by the SD Card Association and the SD
+ * Group. This Simplified Specification is provided on a non-confidential
+ * basis subject to the disclaimers below. Any implementation of the
+ * Simplified Specification may require a license from the SD Card
+ * Association, SD Group, SD-3C LLC or other third parties.
+ *
+ * Disclaimers:
+ *
+ * The information contained in the Simplified Specification is presented only
+ * as a standard specification for SD Cards and SD Host/Ancillary products and
+ * is provided "AS-IS" without any representations or warranties of any
+ * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD
+ * Card Association for any damages, any infringements of patents or other
+ * right of the SD Group, SD-3C LLC, the SD Card Association or any third
+ * parties, which may result from its use. No license is granted by
+ * implication, estoppel or otherwise under any patent or other rights of the
+ * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
+ * herein shall be construed as an obligation by the SD Group, the SD-3C LLC
+ * or the SD Card Association to disclose or distribute any technical
+ * information, know-how or other confidential information to any third party.
+ *
+ *
+ * CRC routines adapted from public domain code written by Lammert Bies.
+ *
+ *
+ * This is an implementation of mmcbr that communicates with SD/MMC cards in
+ * SPI mode via spibus_if. In order to minimize changes to the existing
+ * MMC/SD stack (and allow for maximal reuse of the same), the behavior of
+ * the SD-bus command set is emulated as much as possible, where required.
+ *
+ * The SPI bus ownership behavior is to acquire the SPI bus for the entire
+ * duration that the MMC host is acquired.
+ *
+ * CRC checking is enabled by default, but can be disabled at runtime
+ * per-card via sysctl (e.g. sysctl dev.mmcspi.0.use_crc=0).
+ *
+ * Considered, but not implemented:
+ * - Card presence detection
+ * - Card power control
+ * - Detection of lock switch state on cards that have them
+ * - Yielding the CPU during long card busy cycles
+ *
+ * Originally developed and tested using a MicroTik RouterBOARD RB450G and
+ * 31 microSD cards available circa 2012.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+
+#include <dev/mmc/bridge.h>
+#include <dev/mmc/mmcreg.h>
+#include <dev/mmc/mmcbrvar.h>
+#include <dev/spibus/spi.h>
+
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include "mmcbr_if.h"
+#include "spibus_if.h"
+
+#define MMCSPI_RETRIES 3
+#define MMCSPI_TIMEOUT_SEC 3
+
+#define MMCSPI_MAX_RSP_LEN 5 /* max length of an Rn response */
+#define MMCSPI_OCR_LEN 4
+
+#define MMCSPI_DATA_BLOCK_LEN 512
+#define MMCSPI_DATA_CRC_LEN 2
+
+#define MMCSPI_POLL_LEN 8 /* amount to read when searching */
+
+#define MMCSPI_R1_MASK 0x80 /* mask used to search for R1 tokens */
+#define MMCSPI_R1_VALUE 0x00 /* value used to search for R1 tokens */
+#define MMCSPI_DR_MASK 0x11 /* mask used to search for data resp tokens */
+#define MMCSPI_DR_VALUE 0x01 /* value used to search for data resp tokens */
+
+#define MMCSPI_DR_ERR_MASK 0x0e
+#define MMCSPI_DR_ERR_NONE 0x04
+#define MMCSPI_DR_ERR_CRC 0x0a
+#define MMCSPI_DR_ERR_WRITE 0x0c
+
+#define MMCSPI_TOKEN_SB 0xfe /* start block token for read single,
+ read multi, and write single */
+#define MMCSPI_TOKEN_SB_WM 0xfc /* start block token for write multi */
+#define MMCSPI_TOKEN_ST 0xfd /* stop transmission token */
+#define MMCSPI_IS_DE_TOKEN(x) (0 == ((x) & 0xf0)) /* detector for data
+ error token */
+
+#define MMCSPI_R1_IDLE 0x01
+#define MMCSPI_R1_ERASE_RST 0x02
+#define MMCSPI_R1_ILL_CMD 0x04
+#define MMCSPI_R1_CRC_ERR 0x08
+#define MMCSPI_R1_ERASE_ERR 0x10
+#define MMCSPI_R1_ADDR_ERR 0x20
+#define MMCSPI_R1_PARAM_ERR 0x40
+
+#define MMCSPI_R1_ERR_MASK (MMCSPI_R1_PARAM_ERR | MMCSPI_R1_ADDR_ERR | \
+ MMCSPI_R1_ERASE_ERR | MMCSPI_R1_CRC_ERR | \
+ MMCSPI_R1_ILL_CMD)
+
+#define MMCSPI_R2_LOCKED 0x01
+#define MMCSPI_R2_WP_ER_LCK 0x02
+#define MMCSPI_R2_ERR 0x04
+#define MMCSPI_R2_CC_ERR 0x08
+#define MMCSPI_R2_ECC_FAIL 0x10
+#define MMCSPI_R2_WP_VIOLATE 0x20
+#define MMCSPI_R2_ERASE_PARAM 0x40
+#define MMCSPI_R2_OOR_CSD_OW 0x80
+
+/* commands that only apply to the SPI interface */
+#define MMCSPI_READ_OCR 58
+#define MMCSPI_CRC_ON_OFF 59
+
+static struct ofw_compat_data compat_data[] = {
+ { "mmc-spi-slot", 1 },
+ { NULL, 0 }
+};
+
+struct mmcspi_command {
+ struct mmc_command *mmc_cmd; /* command passed from mmc layer */
+ uint32_t opcode; /* possibly translated opcode */
+ uint32_t arg; /* possibly translated arg */
+ uint32_t flags; /* possibly translated flags */
+ uint32_t retries; /* possibly translated retry count */
+ struct mmc_data *data; /* possibly redirected data segment */
+ unsigned int error_mask; /* R1 errors check mask */
+ unsigned char use_crc; /* do crc checking for this command */
+ unsigned char rsp_type; /* SPI response type of this command */
+#define MMCSPI_RSP_R1 0
+#define MMCSPI_RSP_R1B 1
+#define MMCSPI_RSP_R2 2
+#define MMCSPI_RSP_R3 3
+#define MMCSPI_RSP_R7 4
+ unsigned char rsp_len; /* response len of this command */
+ unsigned char mmc_rsp_type; /* MMC reponse type to translate to */
+#define MMCSPI_TO_MMC_RSP_NONE 0
+#define MMCSPI_TO_MMC_RSP_R1 1
+#define MMCSPI_TO_MMC_RSP_R1B 2
+#define MMCSPI_TO_MMC_RSP_R2 3
+#define MMCSPI_TO_MMC_RSP_R3 4
+#define MMCSPI_TO_MMC_RSP_R6 5
+#define MMCSPI_TO_MMC_RSP_R7 6
+ struct mmc_data ldata; /* local read data */
+};
+
+struct mmcspi_slot {
+ struct mmcspi_softc *sc; /* back pointer to parent bridge */
+ device_t dev; /* mmc device for slot */
+ boolean_t bus_busy; /* host has been acquired */
+ struct mmc_host host; /* host parameters */
+ struct mtx mtx; /* slot mutex */
+ uint8_t last_ocr[MMCSPI_OCR_LEN]; /* ocr retrieved after CMD8 */
+ uint32_t last_opcode; /* last opcode requested by mmc layer */
+ uint32_t last_flags; /* last flags requested by mmc layer */
+ unsigned int crc_enabled; /* crc checking is enabled */
+ unsigned int crc_init_done; /* whether the initial crc setting has
+ been sent to the card */
+#define MMCSPI_MAX_LDATA_LEN 16
+ uint8_t ldata_buf[MMCSPI_MAX_LDATA_LEN];
+};
+
+struct mmcspi_softc {
+ device_t dev; /* this mmc bridge device */
+ device_t busdev;
+ struct mmcspi_slot slot;
+ unsigned int use_crc; /* command CRC checking */
+};
+
+#if defined(MMCSPI_ENABLE_DEBUG_FUNCS)
+static void mmcspi_dump_data(device_t dev, const char *label, uint8_t *data,
+ unsigned int len);
+static void mmcspi_dump_spi_bus(device_t dev, unsigned int len);
+#endif
+
+#define MMCSPI_LOCK_SLOT(_slot) mtx_lock(&(_slot)->mtx)
+#define MMCSPI_UNLOCK_SLOT(_slot) mtx_unlock(&(_slot)->mtx)
+#define MMCSPI_SLOT_LOCK_INIT(_slot) mtx_init(&(_slot)->mtx, \
+ "SD slot mtx", "mmcspi", MTX_DEF)
+#define MMCSPI_SLOT_LOCK_DESTROY(_slot) mtx_destroy(&(_slot)->mtx);
+#define MMCSPI_ASSERT_SLOT_LOCKED(_slot) mtx_assert(&(_slot)->mtx, \
+ MA_OWNED);
+#define MMCSPI_ASSERT_SLOT_UNLOCKED(_slot) mtx_assert(&(_slot)->mtx, \
+ MA_NOTOWNED);
+
+#define TRACE_ZONE_ENABLED(zone) (trace_zone_mask & TRACE_ZONE_##zone)
+
+#define TRACE_ENTER(dev) \
+ if (TRACE_ZONE_ENABLED(ENTER)) { \
+ device_printf(dev, "%s: enter\n", __func__); \
+ }
+
+#define TRACE_EXIT(dev) \
+ if (TRACE_ZONE_ENABLED(EXIT)) { \
+ device_printf(dev, "%s: exit\n", __func__); \
+ }
+
+#define TRACE(dev, zone, ...) \
+ if (TRACE_ZONE_ENABLED(zone)) { \
+ device_printf(dev, __VA_ARGS__); \
+ }
+
+#define TRACE_ZONE_ENTER (1ul << 0) /* function entrance */
+#define TRACE_ZONE_EXIT (1ul << 1) /* function exit */
+#define TRACE_ZONE_ACTION (1ul << 2) /* for narrating major actions taken */
+#define TRACE_ZONE_RESULT (1ul << 3) /* for narrating results of actions */
+#define TRACE_ZONE_ERROR (1ul << 4) /* for reporting errors */
+#define TRACE_ZONE_DATA (1ul << 5) /* for dumping bus data */
+#define TRACE_ZONE_DETAILS (1ul << 6) /* for narrating minor actions/results */
+
+#define TRACE_ZONE_NONE 0
+#define TRACE_ZONE_ALL 0xffffffff
+
+#define CRC7_INITIAL 0x00
+#define CRC16_INITIAL 0x0000
+
+SYSCTL_NODE(_hw, OID_AUTO, mmcspi, CTLFLAG_RD, 0, "mmcspi driver");
+
+static unsigned int trace_zone_mask = TRACE_ZONE_ERROR;
+
+static uint8_t crc7tab[256];
+static uint16_t crc16tab[256];
+static uint8_t onesbuf[MMCSPI_DATA_BLOCK_LEN]; /* for driving the tx line
+ when receiving */
+static uint8_t junkbuf[MMCSPI_DATA_BLOCK_LEN]; /* for receiving data when
+ transmitting */
+
+static uint8_t
+update_crc7(uint8_t crc, uint8_t *buf, unsigned int len)
+{
+ uint8_t tmp;
+ int i;
+
+ for (i = 0; i < len; i++) {
+ tmp = (crc << 1) ^ buf[i];
+ crc = crc7tab[tmp];
+ }
+
+ return (crc);
+}
+
+static uint16_t
+update_crc16(uint16_t crc, uint8_t *buf, unsigned int len)
+{
+ uint16_t tmp, c16;
+ int i;
+
+ for (i = 0; i < len; i++) {
+ c16 = 0x00ff & (uint16_t)buf[i];
+
+ tmp = (crc >> 8) ^ c16;
+ crc = (crc << 8) ^ crc16tab[tmp];
+ }
+
+ return (crc);
+}
+
+static void
+init_crc7tab(void)
+{
+#define P_CRC7 0x89
+
+ int i, j;
+ uint8_t crc, c;
+
+ for (i = 0; i < 256; i++) {
+
+ c = (uint8_t)i;
+ crc = (c & 0x80) ? c ^ P_CRC7 : c;
+
+ for (j=1; j<8; j++) {
+ crc = crc << 1;
+
+ if (crc & 0x80)
+ crc = crc ^ P_CRC7;
+ }
+
+ crc7tab[i] = crc;
+ }
+}
+
+static void
+init_crc16tab(void)
+{
+#define P_CCITT 0x1021
+
+ int i, j;
+ uint16_t crc, c;
+
+ for (i = 0; i < 256; i++) {
+
+ crc = 0;
+ c = ((uint16_t) i) << 8;
+
+ for (j=0; j<8; j++) {
+
+ if ((crc ^ c) & 0x8000) crc = ( crc << 1 ) ^ P_CCITT;
+ else crc = crc << 1;
+
+ c = c << 1;
+ }
+
+ crc16tab[i] = crc;
+ }
+}
+
+static void
+mmcspi_slot_init(device_t brdev, struct mmcspi_slot *slot)
+{
+ struct mmcspi_softc *sc;
+
+ TRACE_ENTER(brdev);
+
+ sc = device_get_softc(brdev);
+
+ slot->sc = sc;
+ slot->dev = NULL; /* will get real value when card is added */
+ slot->bus_busy = false;
+ slot->host.f_min = 100000; /* this should be as low as we need to go
+ for any card */
+ slot->host.caps = 0;
+ /* SPI mode requires 3.3V operation */
+ slot->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
+
+ MMCSPI_SLOT_LOCK_INIT(slot);
+
+ TRACE_EXIT(brdev);
+}
+
+static void
+mmcspi_slot_fini(device_t brdev, struct mmcspi_slot *slot)
+{
+ TRACE_ENTER(brdev);
+
+ MMCSPI_SLOT_LOCK_DESTROY(slot);
+
+ TRACE_EXIT(brdev);
+}
+
+static void
+mmcspi_card_add(struct mmcspi_slot *slot)
+{
+ device_t brdev;
+ device_t child;
+
+ brdev = slot->sc->dev;
+
+ TRACE_ENTER(brdev);
+
+ child = device_add_child(brdev, "mmc", DEVICE_UNIT_ANY);
+
+ MMCSPI_LOCK_SLOT(slot);
+ slot->dev = child;
+ device_set_ivars(slot->dev, slot);
+ MMCSPI_UNLOCK_SLOT(slot);
+
+ device_probe_and_attach(slot->dev);
+
+ TRACE_EXIT(brdev);
+}
+
+static void
+mmcspi_card_delete(struct mmcspi_slot *slot)
+{
+ device_t brdev;
+ device_t dev;
+
+ brdev = slot->sc->dev;
+
+ TRACE_ENTER(brdev);
+
+ MMCSPI_LOCK_SLOT(slot);
+ dev = slot->dev;
+ slot->dev = NULL;
+ MMCSPI_UNLOCK_SLOT(slot);
+ device_delete_child(brdev, dev);
+
+ TRACE_EXIT(brdev);
+}
+
+static int
+mmcspi_probe(device_t dev)
+{
+
+ if (!ofw_bus_status_okay(dev))
+ return (ENXIO);
+
+ if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
+ return (ENXIO);
+
+ device_set_desc(dev, "MMC SPI mode controller");
+
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+mmcspi_attach(device_t dev)
+{
+ struct mmcspi_softc *sc;
+ struct sysctl_ctx_list *ctx;
+ struct sysctl_oid *tree;
+ struct sysctl_oid_list *child;
+
+ TRACE_ENTER(dev);
+
+ sc = device_get_softc(dev);
+ ctx = device_get_sysctl_ctx(dev);
+ tree = device_get_sysctl_tree(dev);
+ child = SYSCTL_CHILDREN(tree);
+
+ sc->dev = dev;
+ sc->busdev = device_get_parent(dev);
+ sc->use_crc = 1;
+
+ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "use_crc", CTLFLAG_RW,
+ &sc->use_crc, sizeof(sc->use_crc), "Enable/disable crc checking");
+
+ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "trace_mask", CTLFLAG_RW,
+ &trace_zone_mask, sizeof(trace_zone_mask), "Bitmask for adjusting "
+ "trace messages");
+
+ mmcspi_slot_init(dev, &sc->slot);
+
+ /* XXX trigger this from card insert detection */
+ mmcspi_card_add(&sc->slot);
+
+ TRACE_EXIT(dev);
+
+ return (0);
+}
+
+static int
+mmcspi_detach(device_t dev)
+{
+ struct mmcspi_softc *sc;
+
+ TRACE_ENTER(dev);
+
+ sc = device_get_softc(dev);
+
+ /* XXX trigger this from card removal detection */
+ mmcspi_card_delete(&sc->slot);
+
+ mmcspi_slot_fini(dev, &sc->slot);
+
+ TRACE_EXIT(dev);
+
+ return (0);
+}
+
+static int
+mmcspi_suspend(device_t dev)
+{
+ int err;
+
+ TRACE_ENTER(dev);
+ err = bus_generic_suspend(dev);
+ if (err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ TRACE_EXIT(dev);
+
+ return (0);
+}
+
+static int
+mmcspi_resume(device_t dev)
+{
+ int err;
+
+ TRACE_ENTER(dev);
+ err = bus_generic_resume(dev);
+ if (err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ TRACE_EXIT(dev);
+
+ return (0);
+}
+
+static int
+mmcspi_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
+{
+ struct mmcspi_slot *slot;
+
+ TRACE_ENTER(bus);
+
+ slot = device_get_ivars(child);
+
+ switch (which) {
+ case MMCBR_IVAR_BUS_TYPE:
+ *result = bus_type_spi;
+ break;
+ case MMCBR_IVAR_BUS_MODE:
+ *result = slot->host.ios.bus_mode;
+ break;
+ case MMCBR_IVAR_BUS_WIDTH:
+ *result = slot->host.ios.bus_width;
+ break;
+ case MMCBR_IVAR_CHIP_SELECT:
+ *result = slot->host.ios.chip_select;
+ break;
+ case MMCBR_IVAR_CLOCK:
+ *result = slot->host.ios.clock;
+ break;
+ case MMCBR_IVAR_F_MIN:
+ *result = slot->host.f_min;
+ break;
+ case MMCBR_IVAR_F_MAX:
+ *result = slot->host.f_max;
+ break;
+ case MMCBR_IVAR_HOST_OCR:
+ *result = slot->host.host_ocr;
+ break;
+ case MMCBR_IVAR_MODE:
+ *result = slot->host.mode;
+ break;
+ case MMCBR_IVAR_OCR:
+ *result = slot->host.ocr;
+ break;
+ case MMCBR_IVAR_POWER_MODE:
+ *result = slot->host.ios.power_mode;
+ break;
+ case MMCBR_IVAR_VDD:
+ *result = slot->host.ios.vdd;
+ break;
+ case MMCBR_IVAR_VCCQ:
+ *result = slot->host.ios.vccq;
+ break;
+ case MMCBR_IVAR_CAPS:
+ *result = slot->host.caps;
+ break;
+ case MMCBR_IVAR_TIMING:
+ *result = slot->host.ios.timing;
+ break;
+ case MMCBR_IVAR_MAX_DATA:
+ /* seems reasonable, not dictated by anything */
+ *result = 64 * 1024;
+ break;
+ default:
+ return (EINVAL);
+ }
+
+ TRACE_EXIT(bus);
+
+ return (0);
+}
+
+static int
+mmcspi_write_ivar(device_t bus, device_t child, int which, uintptr_t value)
+{
+ struct mmcspi_slot *slot;
+
+ TRACE_ENTER(bus);
+
+ slot = device_get_ivars(child);
+
+ switch (which) {
+ default:
+ return (EINVAL);
+ case MMCBR_IVAR_BUS_MODE:
+ slot->host.ios.bus_mode = value;
+ break;
+ case MMCBR_IVAR_BUS_WIDTH:
+ slot->host.ios.bus_width = value;
+ break;
+ case MMCBR_IVAR_CLOCK:
+ slot->host.ios.clock = value;
+ break;
+ case MMCBR_IVAR_CHIP_SELECT:
+ slot->host.ios.chip_select = value;
+ break;
+ case MMCBR_IVAR_MODE:
+ slot->host.mode = value;
+ break;
+ case MMCBR_IVAR_OCR:
+ slot->host.ocr = value;
+ break;
+ case MMCBR_IVAR_POWER_MODE:
+ slot->host.ios.power_mode = value;
+ break;
+ case MMCBR_IVAR_VDD:
+ slot->host.ios.vdd = value;
+ break;
+ case MMCBR_IVAR_VCCQ:
+ slot->host.ios.vccq = value;
+ break;
+ case MMCBR_IVAR_TIMING:
+ slot->host.ios.timing = value;
+ break;
+ case MMCBR_IVAR_BUS_TYPE:
+ case MMCBR_IVAR_CAPS:
+ case MMCBR_IVAR_HOST_OCR:
+ case MMCBR_IVAR_F_MIN:
+ case MMCBR_IVAR_F_MAX:
+ case MMCBR_IVAR_MAX_DATA:
+ return (EINVAL);
+ }
+ TRACE_EXIT(bus);
+
+ return (0);
+}
+
+static unsigned int
+mmcspi_do_spi_read(device_t dev, uint8_t *data, unsigned int len)
+{
+ struct spi_command spi_cmd;
+ struct mmcspi_softc *sc;
+ int err;
+
+ TRACE_ENTER(dev);
+
+ sc = device_get_softc(dev);
+
+ spi_cmd.tx_cmd = onesbuf;
+ spi_cmd.rx_cmd = data;
+ spi_cmd.tx_cmd_sz = len;
+ spi_cmd.rx_cmd_sz = len;
+ spi_cmd.tx_data = NULL;
+ spi_cmd.rx_data = NULL;
+ spi_cmd.tx_data_sz = 0;
+ spi_cmd.rx_data_sz = 0;
+
+ err = SPIBUS_TRANSFER(sc->busdev, sc->dev, &spi_cmd);
+
+#ifdef DEBUG_RX
+ int i;
+ if (err == 0) {
+ printf("rx val: ");
+ for (i = 0; i < len; i++)
+ printf("%x ", data[i]);
+ printf("\n");
+ }
+#endif
+
+ TRACE_EXIT(dev);
+
+ return (err ? MMC_ERR_FAILED : MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_do_spi_write(device_t dev, uint8_t *cmd, unsigned int cmdlen,
+ uint8_t *data, unsigned int datalen)
+{
+ struct mmcspi_softc *sc;
+ struct spi_command spi_cmd;
+ int err;
+
+ TRACE_ENTER(dev);
+
+ sc = device_get_softc(dev);
+
+ spi_cmd.tx_cmd = cmd;
+ spi_cmd.rx_cmd = junkbuf;
+ spi_cmd.tx_cmd_sz = cmdlen;
+ spi_cmd.rx_cmd_sz = cmdlen;
+ spi_cmd.tx_data = data;
+ spi_cmd.rx_data = junkbuf;
+ spi_cmd.tx_data_sz = datalen;
+ spi_cmd.rx_data_sz = datalen;
+
+ err = SPIBUS_TRANSFER(sc->busdev, sc->dev, &spi_cmd);
+
+ TRACE_EXIT(dev);
+
+ return (err ? MMC_ERR_FAILED : MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_wait_for_not_busy(device_t dev)
+{
+ unsigned int busy_length;
+ uint8_t pollbuf[MMCSPI_POLL_LEN];
+ struct bintime start, elapsed;
+ unsigned int err;
+ int i;
+
+ busy_length = 0;
+
+ TRACE_ENTER(dev);
+ TRACE(dev, ACTION, "waiting for not busy\n");
+
+ getbintime(&start);
+ do {
+ TRACE(dev, DETAILS, "looking for end of busy\n");
+ err = mmcspi_do_spi_read(dev, pollbuf, MMCSPI_POLL_LEN);
+ if (MMC_ERR_NONE != err) {
+ TRACE(dev, ERROR, "spi read failed\n");
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ for (i = 0; i < MMCSPI_POLL_LEN; i++) {
+ if (pollbuf[i] != 0x00) {
+ TRACE(dev, DETAILS,
+ "end of busy found at %d\n", i);
+ break;
+ }
+ busy_length++;
+ }
+
+ getbintime(&elapsed);
+ bintime_sub(&elapsed, &start);
+
+ if (elapsed.sec > MMCSPI_TIMEOUT_SEC) {
+ TRACE(dev, ERROR, "card busy timeout\n");
+ return (MMC_ERR_TIMEOUT);
+ }
+ } while (MMCSPI_POLL_LEN == i);
+
+ TRACE(dev, RESULT, "busy for %u byte slots\n", busy_length);
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static int
+mmcspi_update_ios(device_t brdev, device_t reqdev)
+{
+ struct mmcspi_softc *sc;
+ struct mmcspi_slot *slot;
+ struct spi_command spi_cmd;
+
+ TRACE_ENTER(brdev);
+
+ sc = device_get_softc(brdev);
+ slot = device_get_ivars(reqdev);
+
+ if (power_up == slot->host.ios.power_mode) {
+ /*
+ * This sequence provides the initialization steps required
+ * by the spec after card power is applied, but before any
+ * commands are issued. These operations are harmless if
+ * applied at any other time (after a warm reset, for
+ * example).
+ */
+
+ /*
+ * XXX Power-on portion of implementation of card power
+ * control should go here. Should probably include a power
+ * off first to ensure card is fully reset from any previous
+ * state.
+ */
+
+ /*
+ * Make sure power to card has ramped up. The spec requires
+ * power to ramp up in 35ms or less.
+ */
+ DELAY(35000);
+
+ /*
+ * Provide at least 74 clocks with CS and MOSI high that the
+ * spec requires after card power stabilizes.
+ */
+
+ spi_cmd.tx_cmd = onesbuf;
+ spi_cmd.tx_cmd_sz = 10;
+ spi_cmd.rx_cmd = junkbuf;
+ spi_cmd.rx_cmd_sz = 10;
+ spi_cmd.tx_data = NULL;
+ spi_cmd.rx_data = NULL;
+ spi_cmd.tx_data_sz = 0;
+ spi_cmd.rx_data_sz = 0;
+
+ SPIBUS_TRANSFER(sc->busdev, sc->dev, &spi_cmd);
+
+ /*
+ * Perhaps this was a warm reset and the card is in the
+ * middle of a long operation.
+ */
+ mmcspi_wait_for_not_busy(brdev);
+
+ slot->last_opcode = 0xffffffff;
+ slot->last_flags = 0;
+ memset(slot->last_ocr, 0, MMCSPI_OCR_LEN);
+ slot->crc_enabled = 0;
+ slot->crc_init_done = 0;
+ }
+
+ if (power_off == slot->host.ios.power_mode) {
+ /*
+ * XXX Power-off portion of implementation of card power
+ * control should go here.
+ */
+ }
+
+ TRACE_EXIT(brdev);
+
+ return (0);
+}
+
+static unsigned int
+mmcspi_shift_copy(uint8_t *dest, uint8_t *src, unsigned int dest_len,
+ unsigned int shift)
+{
+ unsigned int i;
+
+ if (0 == shift)
+ memcpy(dest, src, dest_len);
+ else {
+ for (i = 0; i < dest_len; i++) {
+ dest[i] =
+ (src[i] << shift) |
+ (src[i + 1] >> (8 - shift));
+ }
+ }
+
+ return (dest_len);
+}
+
+static unsigned int
+mmcspi_get_response_token(device_t dev, uint8_t mask, uint8_t value,
+ unsigned int len, unsigned int has_busy, uint8_t *rspbuf)
+{
+ uint8_t pollbuf[2 * MMCSPI_MAX_RSP_LEN];
+ struct bintime start, elapsed;
+ boolean_t found;
+ unsigned int err;
+ unsigned int offset;
+ unsigned int shift = 0;
+ unsigned int remaining;
+ uint16_t search_space;
+ uint16_t search_mask;
+ uint16_t search_value;
+ int i;
+
+ TRACE_ENTER(dev);
+
+ /*
+ * This loop searches data clocked out of the card for a response
+ * token matching the given mask and value. It will locate tokens
+ * that are not byte-aligned, as some cards send non-byte-aligned
+ * response tokens in some situations. For example, the following
+ * card consistently sends an unaligned response token to the stop
+ * command used to terminate multi-block reads:
+ *
+ * Transcend 2GB SDSC card, cid:
+ * mid=0x1b oid=0x534d pnm="00000" prv=1.0 mdt=00.2000
+ */
+
+ offset = 0;
+ found = false;
+ getbintime(&start);
+ do {
+ TRACE(dev, DETAILS, "looking for response token with "
+ "mask 0x%02x, value 0x%02x\n", mask, value);
+ err = mmcspi_do_spi_read(dev, &pollbuf[offset], len);
+ if (MMC_ERR_NONE != err) {
+ TRACE(dev, ERROR, "spi read of resp token failed\n");
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ for (i = 0; i < len + offset; i++) {
+ if ((pollbuf[i] & mask) == value) {
+ TRACE(dev, DETAILS, "response token found at "
+ "%d (0x%02x)\n", i, pollbuf[i]);
+ shift = 0;
+ found = true;
+ break;
+ } else if (i < len + offset - 1) {
+ /*
+ * Not the last byte in the buffer, so check
+ * for a non-aligned response.
+ */
+ search_space = ((uint16_t)pollbuf[i] << 8) |
+ pollbuf[i + 1];
+ search_mask = (uint16_t)mask << 8;
+ search_value = (uint16_t)value << 8;
+
+ TRACE(dev, DETAILS, "search: space=0x%04x "
+ " mask=0x%04x val=0x%04x\n", search_space,
+ search_mask, search_value);
+
+ for (shift = 1; shift < 8; shift++) {
+ search_space <<= 1;
+ if ((search_space & search_mask) ==
+ search_value) {
+ found = true;
+ TRACE(dev, DETAILS, "Found mat"
+ "ch at shift %u\n", shift);
+ break;
+ }
+ }
+
+ if (shift < 8)
+ break;
+ } else {
+ /*
+ * Move the last byte to the first position
+ * and go 'round again.
+ */
+ pollbuf[0] = pollbuf[i];
+ }
+ }
+
+ if (!found) {
+ offset = 1;
+
+ getbintime(&elapsed);
+ bintime_sub(&elapsed, &start);
+
+ if (elapsed.sec > MMCSPI_TIMEOUT_SEC) {
+ TRACE(dev, ERROR, "timeout while looking for "
+ "response token\n");
+ return (MMC_ERR_TIMEOUT);
+ }
+ }
+ } while (!found);
+
+ /*
+ * Note that if i == 0 and offset == 1, shift is always greater than
+ * zero.
+ */
+ remaining = i - offset + (shift ? 1 : 0);
+
+ TRACE(dev, DETAILS, "len=%u i=%u rem=%u shift=%u\n",
+ len, i, remaining, shift);
+
+ if (remaining) {
+ err = mmcspi_do_spi_read(dev, &pollbuf[len + offset],
+ remaining);
+ if (MMC_ERR_NONE != err) {
+ TRACE(dev, ERROR, "spi read of remainder of response "
+ "token failed\n");
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ }
+
+ mmcspi_shift_copy(rspbuf, &pollbuf[i], len, shift);
+
+ if (TRACE_ZONE_ENABLED(RESULT)) {
+ TRACE(dev, RESULT, "response =");
+ for (i = 0; i < len; i++)
+ printf(" 0x%02x", rspbuf[i]);
+ printf("\n");
+ }
+
+ if (has_busy) {
+ err = mmcspi_wait_for_not_busy(dev);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ }
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_set_up_command(device_t dev, struct mmcspi_command *mmcspi_cmd,
+ struct mmc_command *mmc_cmd)
+{
+ struct mmcspi_softc *sc;
+ struct mmcspi_slot *slot;
+ uint32_t opcode;
+ uint32_t arg;
+ uint32_t flags;
+ uint32_t retries;
+ unsigned char rsp_type;
+ unsigned char rsp_len;
+ unsigned char mmc_rsp_type;
+ unsigned int ldata_len = 0;
+ unsigned int use_crc;
+
+ sc = device_get_softc(dev);
+ slot = &sc->slot;
+ use_crc = slot->crc_enabled;
+
+ opcode = mmc_cmd->opcode;
+ arg = mmc_cmd->arg;
+ flags = mmc_cmd->flags;
+ retries = mmc_cmd->retries;
+
+ if (flags & MMC_CMD_IS_APP) {
+ switch (opcode) {
+ case ACMD_SD_STATUS:
+ rsp_type = MMCSPI_RSP_R2;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R1;
+ break;
+ case ACMD_SEND_NUM_WR_BLOCKS:
+ case ACMD_SET_WR_BLK_ERASE_COUNT:
+ case ACMD_SET_CLR_CARD_DETECT:
+ case ACMD_SEND_SCR:
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R1;
+ break;
+ case ACMD_SD_SEND_OP_COND:
+ /* only HCS bit is valid in spi mode */
+ arg &= 0x40000000;
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R3;
+ break;
+ default:
+ TRACE(dev, ERROR, "Invalid app command opcode %u\n",
+ opcode);
+ return (MMC_ERR_INVALID);
+ }
+ } else {
+ switch (opcode) {
+ case MMC_GO_IDLE_STATE:
+ use_crc = 1;
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_NONE;
+ break;
+
+ case MMC_SEND_OP_COND:
+ case MMC_SWITCH_FUNC: /* also SD_SWITCH_FUNC */
+ case MMC_SET_BLOCKLEN:
+ case MMC_READ_SINGLE_BLOCK:
+ case MMC_READ_MULTIPLE_BLOCK:
+ case MMC_WRITE_BLOCK:
+ case MMC_WRITE_MULTIPLE_BLOCK:
+ case MMC_PROGRAM_CSD:
+ case MMC_SEND_WRITE_PROT:
+ case SD_ERASE_WR_BLK_START:
+ case SD_ERASE_WR_BLK_END:
+ case MMC_LOCK_UNLOCK:
+ case MMC_GEN_CMD:
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R1;
+ break;
+ case MMCSPI_CRC_ON_OFF:
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_NONE;
+ break;
+
+ case MMC_SEND_CSD:
+ case MMC_SEND_CID:
+ arg = 0; /* no rca in spi mode */
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R2;
+ ldata_len = 16;
+ break;
+
+ case MMC_APP_CMD:
+ arg = 0; /* no rca in spi mode */
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R1;
+ break;
+
+ case MMC_STOP_TRANSMISSION:
+ case MMC_SET_WRITE_PROT:
+ case MMC_CLR_WRITE_PROT:
+ case MMC_ERASE:
+ rsp_type = MMCSPI_RSP_R1B;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R1B;
+ break;
+
+ case MMC_ALL_SEND_CID:
+ /* handle MMC_ALL_SEND_CID as MMC_SEND_CID */
+ opcode = MMC_SEND_CID;
+ rsp_type = MMCSPI_RSP_R1;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R2;
+ ldata_len = 16;
+ break;
+
+ case MMC_SEND_STATUS:
+ arg = 0; /* no rca in spi mode */
+ rsp_type = MMCSPI_RSP_R2;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R1;
+ break;
+
+
+ case MMCSPI_READ_OCR:
+ rsp_type = MMCSPI_RSP_R3;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_NONE;
+ break;
+
+ case SD_SEND_RELATIVE_ADDR:
+ /*
+ * Handle SD_SEND_RELATIVE_ADDR as MMC_SEND_STATUS -
+ * the rca returned to the caller will always be 0.
+ */
+ opcode = MMC_SEND_STATUS;
+ rsp_type = MMCSPI_RSP_R2;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R6;
+ break;
+
+ case SD_SEND_IF_COND:
+ use_crc = 1;
+ rsp_type = MMCSPI_RSP_R7;
+ mmc_rsp_type = MMCSPI_TO_MMC_RSP_R7;
+ break;
+
+ default:
+ TRACE(dev, ERROR, "Invalid cmd opcode %u\n", opcode);
+ return (MMC_ERR_INVALID);
+ }
+ }
+
+ switch (rsp_type) {
+ case MMCSPI_RSP_R1:
+ case MMCSPI_RSP_R1B:
+ rsp_len = 1;
+ break;
+ case MMCSPI_RSP_R2:
+ rsp_len = 2;
+ break;
+ case MMCSPI_RSP_R3:
+ case MMCSPI_RSP_R7:
+ rsp_len = 5;
+ break;
+ default:
+ TRACE(dev, ERROR, "Unknown response type %u\n", rsp_type);
+ return (MMC_ERR_INVALID);
+ }
+
+ mmcspi_cmd->mmc_cmd = mmc_cmd;
+ mmcspi_cmd->opcode = opcode;
+ mmcspi_cmd->arg = arg;
+ mmcspi_cmd->flags = flags;
+ mmcspi_cmd->retries = retries;
+ mmcspi_cmd->use_crc = use_crc;
+ mmcspi_cmd->error_mask = MMCSPI_R1_ERR_MASK;
+ if (!mmcspi_cmd->use_crc)
+ mmcspi_cmd->error_mask &= ~MMCSPI_R1_CRC_ERR;
+ mmcspi_cmd->rsp_type = rsp_type;
+ mmcspi_cmd->rsp_len = rsp_len;
+ mmcspi_cmd->mmc_rsp_type = mmc_rsp_type;
+
+ memset(&mmcspi_cmd->ldata, 0, sizeof(struct mmc_data));
+ mmcspi_cmd->ldata.len = ldata_len;
+ if (ldata_len) {
+ mmcspi_cmd->ldata.data = sc->slot.ldata_buf;
+ mmcspi_cmd->ldata.flags = MMC_DATA_READ;
+
+ mmcspi_cmd->data = &mmcspi_cmd->ldata;
+ } else
+ mmcspi_cmd->data = mmc_cmd->data;
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_send_cmd(device_t dev, struct mmcspi_command *cmd, uint8_t *rspbuf)
+{
+ unsigned int err;
+ uint32_t opcode;
+ uint32_t arg;
+ uint8_t txbuf[8];
+ uint8_t crc;
+
+ TRACE_ENTER(dev);
+
+ opcode = cmd->opcode;
+ arg = cmd->arg;
+
+ TRACE(dev, ACTION, "sending %sMD%u(0x%08x)\n",
+ cmd->flags & MMC_CMD_IS_APP ? "AC": "C", opcode, arg);
+
+ /*
+ * Sending this byte ahead of each command prevents some cards from
+ * responding with unaligned data, and doesn't bother the others.
+ * Examples:
+ *
+ * Sandisk 32GB SDHC card, cid:
+ * mid=0x03 oid=0x5344 pnm="SU32G" prv=8.0 mdt=00.2000
+ */
+ txbuf[0] = 0xff;
+
+ txbuf[1] = 0x40 | (opcode & 0x3f);
+ txbuf[2] = arg >> 24;
+ txbuf[3] = (arg >> 16) & 0xff;
+ txbuf[4] = (arg >> 8) & 0xff;
+ txbuf[5] = arg & 0xff;
+
+ if (cmd->use_crc)
+ crc = update_crc7(CRC7_INITIAL, &txbuf[1], 5);
+ else
+ crc = 0;
+
+ txbuf[6] = (crc << 1) | 0x01;
+
+ /*
+ * Some cards have garbage on the bus in the first byte slot after
+ * the last command byte. This seems to be common with the stop
+ * command. Clocking out an extra byte with the command will
+ * result in that data not being searched for the response token,
+ * which is ok, because no cards respond that fast.
+ */
+ txbuf[7] = 0xff;
+
+ err = mmcspi_do_spi_write(dev, txbuf, sizeof(txbuf), NULL, 0);
+ if (MMC_ERR_NONE != err) {
+ TRACE(dev, ERROR, "spi write of command failed\n");
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ TRACE(dev, DETAILS,
+ "rx cmd bytes 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ junkbuf[0], junkbuf[1], junkbuf[2], junkbuf[3], junkbuf[4],
+ junkbuf[5] );
+ TRACE(dev, DETAILS, "skipped response byte is 0x%02x\n", junkbuf[6]);
+
+ err = mmcspi_get_response_token(dev, MMCSPI_R1_MASK, MMCSPI_R1_VALUE,
+ cmd->rsp_len, MMCSPI_RSP_R1B == cmd->rsp_type, rspbuf);
+
+ if (MMC_ERR_NONE == err) {
+ if (rspbuf[0] & cmd->error_mask & MMCSPI_R1_CRC_ERR)
+ err = MMC_ERR_BADCRC;
+ else if (rspbuf[0] & cmd->error_mask)
+ err = MMC_ERR_INVALID;
+ }
+
+ TRACE_EXIT(dev);
+
+ return (err);
+}
+
+static unsigned int
+mmcspi_read_block(device_t dev, uint8_t *data, unsigned int len,
+ unsigned int check_crc16, unsigned int check_crc7)
+{
+ struct bintime start;
+ struct bintime elapsed;
+ unsigned int non_token_bytes;
+ unsigned int data_captured;
+ unsigned int crc_captured;
+ unsigned int pollbufpos;
+ unsigned int crc16_mismatch;
+ unsigned int err;
+ uint16_t crc16, computed_crc16;
+ uint8_t crc7, computed_crc7;
+ uint8_t pollbuf[MMCSPI_POLL_LEN];
+ uint8_t crcbuf[MMCSPI_DATA_CRC_LEN];
+ int i;
+
+ crc16_mismatch = 0;
+
+ TRACE_ENTER(dev);
+ TRACE(dev, ACTION, "read block(%u)\n", len);
+
+ /*
+ * With this approach, we could pointlessly read up to
+ * (MMCSPI_POLL_LEN - 3 - len) bytes from the spi bus, but only in
+ * the odd situation where MMCSPI_POLL_LEN is greater than len + 3.
+ */
+ getbintime(&start);
+ do {
+ TRACE(dev, DETAILS, "looking for read token\n");
+ err = mmcspi_do_spi_read(dev, pollbuf, MMCSPI_POLL_LEN);
+ if (MMC_ERR_NONE != err) {
+ TRACE(dev, ERROR, "token read on spi failed\n");
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ for (i = 0; i < MMCSPI_POLL_LEN; i++) {
+ if (MMCSPI_TOKEN_SB == pollbuf[i]) {
+ TRACE(dev, RESULT,
+ "found start block token at %d\n", i);
+ break;
+ } else if (MMCSPI_IS_DE_TOKEN(pollbuf[i])) {
+ TRACE(dev, ERROR,
+ "found data error token at %d\n", i);
+ TRACE_EXIT(dev);
+ return (MMC_ERR_FAILED);
+ }
+ }
+
+ getbintime(&elapsed);
+ bintime_sub(&elapsed, &start);
+
+ if (elapsed.sec > MMCSPI_TIMEOUT_SEC) {
+ TRACE(dev, ERROR, "timeout while looking for read "
+ "token\n");
+ return (MMC_ERR_TIMEOUT);
+ }
+ } while (MMCSPI_POLL_LEN == i);
+
+ /* copy any data captured in tail of poll buf to data buf */
+ non_token_bytes = MMCSPI_POLL_LEN - i - 1;
+ data_captured = min(non_token_bytes, len);
+ crc_captured = non_token_bytes - data_captured;
+ pollbufpos = i + 1;
+
+ TRACE(dev, DETAILS, "data bytes captured in pollbuf = %u\n",
+ data_captured);
+
+ memcpy(data, &pollbuf[pollbufpos], data_captured);
+ pollbufpos += data_captured;
+
+ TRACE(dev, DETAILS, "data bytes to read = %u, crc_captured = %u\n",
+ len - data_captured, crc_captured);
+
+ /* get any remaining data from the spi bus */
+ if (data_captured < len) {
+ err = mmcspi_do_spi_read(dev, &data[data_captured],
+ len - data_captured);
+ if (MMC_ERR_NONE != err) {
+ TRACE(dev, ERROR,
+ "spi read of remainder of block failed\n");
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ }
+
+ /* copy any crc captured in the poll buf to the crc buf */
+ memcpy(crcbuf, &pollbuf[pollbufpos], crc_captured);
+
+ /* get any remaining crc */
+ if (crc_captured < MMCSPI_DATA_CRC_LEN) {
+ TRACE(dev, DETAILS, "crc bytes to read = %u\n",
+ MMCSPI_DATA_CRC_LEN - crc_captured);
+
+ err = mmcspi_do_spi_read(dev, &crcbuf[crc_captured],
+ MMCSPI_DATA_CRC_LEN - crc_captured);
+ if (MMC_ERR_NONE != err) {
+ TRACE(dev, ERROR, "spi read of crc failed\n");
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ }
+
+ /*
+ * The following crc checking code is deliberately structured to
+ * allow a passing crc-7 check to override a failing crc-16 check
+ * when both are enabled.
+ */
+ if (check_crc16) {
+ crc16 = ((uint16_t)crcbuf[0] << 8) | crcbuf[1];
+ computed_crc16 = update_crc16(CRC16_INITIAL, data, len);
+ TRACE(dev, RESULT, "sent_crc16=0x%04x computed_crc16=0x%04x\n",
+ crc16, computed_crc16);
+
+ if (computed_crc16 != crc16) {
+ crc16_mismatch = 1;
+
+ TRACE(dev, ERROR, "crc16 mismatch, should be 0x%04x, "
+ " is 0x%04x\n", crc16, computed_crc16);
+
+ if (!check_crc7) {
+ TRACE_EXIT(dev);
+ return (MMC_ERR_BADCRC);
+ }
+ }
+ }
+
+ if (check_crc7) {
+ if (crc16_mismatch) {
+ /*
+ * Let the user know something else is being checked
+ * after announcing an error above.
+ */
+ TRACE(dev, ERROR, "checking crc7\n");
+ }
+
+ crc7 = data[len - 1] >> 1;
+ computed_crc7 = update_crc7(CRC7_INITIAL, data, len - 1);
+ TRACE(dev, RESULT, "sent_crc7=0x%02x computed_crc7=0x%02x\n",
+ crc7, computed_crc7);
+
+ if (computed_crc7 != crc7) {
+ TRACE(dev, ERROR,
+ "crc7 mismatch, should be 0x%02x, is 0x%02x\n",
+ crc7, computed_crc7);
+
+ TRACE_EXIT(dev);
+ return (MMC_ERR_BADCRC);
+ }
+ }
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_send_stop(device_t dev, unsigned int retries)
+{
+ struct mmcspi_command stop;
+ struct mmc_command mmc_stop;
+ uint8_t stop_response;
+ unsigned int err;
+ int i;
+
+ TRACE_ENTER(dev);
+
+ memset(&mmc_stop, 0, sizeof(mmc_stop));
+ mmc_stop.opcode = MMC_STOP_TRANSMISSION;
+ mmc_stop.flags = MMC_RSP_R1B | MMC_CMD_AC;
+
+ err = mmcspi_set_up_command(dev, &stop, &mmc_stop);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ /*
+ * Retry stop commands that fail due to bad crc here because having
+ * the caller retry the entire read/write command due to such a
+ * failure is pointlessly expensive.
+ */
+ for (i = 0; i <= retries; i++) {
+ TRACE(dev, ACTION, "sending stop message\n");
+
+ err = mmcspi_send_cmd(dev, &stop, &stop_response);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ TRACE(dev, RESULT, "stop response=0x%02x\n", stop_response);
+
+ /* retry on crc error */
+ if (stop_response & stop.error_mask & MMCSPI_R1_CRC_ERR) {
+ continue;
+ }
+ }
+
+ if (stop_response & stop.error_mask) {
+ TRACE_EXIT(dev);
+
+ /*
+ * Don't return MMC_ERR_BADCRC here, even if
+ * MMCSPI_R1_CRC_ERR is set, because that would trigger the
+ * caller's retry-on-crc-error mechanism, effectively
+ * squaring the maximum number of retries of the stop
+ * command.
+ */
+ return (MMC_ERR_FAILED);
+ }
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_read_phase(device_t dev, struct mmcspi_command *cmd)
+{
+ struct mmc_data *data;
+ unsigned int data_offset;
+ unsigned int num_blocks;
+ unsigned int len;
+ unsigned int err;
+ uint8_t *data8;
+ int i;
+
+ TRACE_ENTER(dev);
+
+ data = cmd->data;
+ data8 = (uint8_t *)data->data;
+ data_offset = 0;
+
+ if (data->len < MMCSPI_DATA_BLOCK_LEN) {
+ num_blocks = 1;
+ len = data->len;
+ } else {
+ num_blocks = data->len / MMCSPI_DATA_BLOCK_LEN;
+ len = MMCSPI_DATA_BLOCK_LEN;
+ }
+
+ for (i = 0; i < num_blocks; i++) {
+ /*
+ * The CID and CSD data blocks contain both a trailing crc-7
+ * inside the data block and the standard crc-16 following
+ * the data block, so both are checked when use_crc is true.
+ *
+ * When crc checking has been enabled via CMD59, some cards
+ * send CID and CSD data blocks with correct crc-7 values
+ * but incorrect crc-16 values. read_block will accept
+ * those responses as valid as long as the crc-7 is correct.
+ *
+ * Examples:
+ *
+ * Super Talent 1GB SDSC card, cid:
+ * mid=0x1b oid=0x534d pnm="00000" prv=1.0 mdt=02.2010
+ */
+ err = mmcspi_read_block(dev, &data8[data_offset], len,
+ cmd->use_crc, cmd->use_crc && ((MMC_SEND_CID == cmd->opcode)
+ || (MMC_SEND_CSD == cmd->opcode)));
+
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ data_offset += MMCSPI_DATA_BLOCK_LEN;
+ }
+
+ /* multi-block read commands require a stop */
+ if (num_blocks > 1) {
+ err = mmcspi_send_stop(dev, cmd->retries);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ }
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_write_block(device_t dev, uint8_t *data, unsigned int is_multi,
+ unsigned char use_crc, uint8_t *status)
+{
+ uint8_t txbuf[max(MMCSPI_POLL_LEN, 2)];
+ uint8_t response_token;
+ unsigned int err;
+ uint16_t crc;
+
+ TRACE_ENTER(dev);
+
+ if (use_crc)
+ crc = update_crc16(CRC16_INITIAL, data, MMCSPI_DATA_BLOCK_LEN);
+ else
+ crc = 0;
+
+ TRACE(dev, ACTION, "write block(512) crc=0x%04x\n", crc);
+
+ txbuf[0] = is_multi ? MMCSPI_TOKEN_SB_WM : MMCSPI_TOKEN_SB;
+ err = mmcspi_do_spi_write(dev, txbuf, 1, data, MMCSPI_DATA_BLOCK_LEN);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ txbuf[0] = crc >> 8;
+ txbuf[1] = crc & 0xff;
+ err = mmcspi_do_spi_write(dev, txbuf, 2, NULL, 0);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ err = mmcspi_get_response_token(dev, MMCSPI_DR_MASK, MMCSPI_DR_VALUE,
+ 1, 1, &response_token);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ *status = response_token & MMCSPI_DR_ERR_MASK;
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_write_phase(device_t dev, struct mmcspi_command *cmd)
+{
+
+ struct mmc_data *data;
+ unsigned int data_offset;
+ unsigned int num_blocks;
+ unsigned int err;
+ uint8_t *data8;
+ uint8_t token[2];
+ uint8_t status;
+ int i;
+
+ TRACE_ENTER(dev);
+
+ data = cmd->data;
+
+ data8 = (uint8_t *)data->data;
+ data_offset = 0;
+ num_blocks = data->len / MMCSPI_DATA_BLOCK_LEN;
+ for (i = 0; i < num_blocks; i++) {
+ err = mmcspi_write_block(dev, &data8[data_offset],
+ num_blocks > 1, cmd->use_crc, &status);
+
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ if (MMCSPI_DR_ERR_NONE != status) {
+ if (num_blocks > 1) {
+ /*
+ * Ignore any failure reported for the stop
+ * command, as the return status for the
+ * write phase will be whatever error was
+ * indicated in the data respone token.
+ */
+ mmcspi_send_stop(dev, cmd->retries);
+ }
+
+ /*
+ * A CRC error can't be ignored here, even if crc
+ * use is disabled, as there is no way to simply
+ * carry on when a data error token has been sent.
+ */
+ if (MMCSPI_DR_ERR_CRC == status) {
+ TRACE_EXIT(dev);
+ return (MMC_ERR_BADCRC);
+ } else {
+ TRACE_EXIT(dev);
+ return (MMC_ERR_FAILED);
+ }
+ }
+
+ data_offset += MMCSPI_DATA_BLOCK_LEN;
+ }
+
+ /* successful multi-block write commands require a stop token */
+ if (num_blocks > 1) {
+ TRACE(dev, ACTION, "Sending stop token\n");
+
+ /*
+ * Most/all cards are a bit sluggish in assserting busy
+ * after receipt of the STOP_TRAN token. Clocking out an
+ * extra byte here provides a byte of dead time before
+ * looking for not busy, avoiding a premature not-busy
+ * determination with such cards.
+ */
+ token[0] = MMCSPI_TOKEN_ST;
+ token[1] = 0xff;
+
+ err = mmcspi_do_spi_write(dev, token, sizeof(token), NULL, 0);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ err = mmcspi_wait_for_not_busy(dev);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+ }
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_translate_response(device_t dev, struct mmcspi_command *cmd,
+ uint8_t *rspbuf)
+{
+ struct mmc_command *mmc_cmd;
+ uint32_t mmc_rsp_type;
+ uint8_t *ldata;
+
+ mmc_cmd = cmd->mmc_cmd;
+ mmc_rsp_type = cmd->mmc_rsp_type;
+ ldata = cmd->ldata.data;
+
+ TRACE_ENTER(dev);
+
+ TRACE(dev, ACTION, "translating SPI rsp %u to SD rsp %u\n",
+ cmd->rsp_type, mmc_rsp_type);
+
+ if ((MMCSPI_TO_MMC_RSP_R1 == mmc_rsp_type) ||
+ (MMCSPI_TO_MMC_RSP_R1B == mmc_rsp_type)) {
+
+ TRACE(dev, ACTION, "translating SPI-R1/2 to SD-R1\n");
+
+ if ((MMCSPI_RSP_R1 == cmd->rsp_type) ||
+ (MMCSPI_RSP_R1B == cmd->rsp_type) ||
+ (MMCSPI_RSP_R2 == cmd->rsp_type)) {
+ mmc_cmd->resp[0] = 0;
+
+ if (rspbuf[0] & MMCSPI_R1_PARAM_ERR)
+ mmc_cmd->resp[0] |= R1_OUT_OF_RANGE;
+
+ if (rspbuf[0] & MMCSPI_R1_ADDR_ERR)
+ mmc_cmd->resp[0] |= R1_ADDRESS_ERROR;
+
+ if (rspbuf[0] & MMCSPI_R1_ERASE_ERR)
+ mmc_cmd->resp[0] |= R1_ERASE_SEQ_ERROR;
+
+ if (rspbuf[0] & MMCSPI_R1_CRC_ERR)
+ mmc_cmd->resp[0] |= R1_COM_CRC_ERROR;
+
+ if (rspbuf[0] & MMCSPI_R1_ILL_CMD)
+ mmc_cmd->resp[0] |= R1_ILLEGAL_COMMAND;
+
+ if (rspbuf[0] & MMCSPI_R1_ERASE_RST)
+ mmc_cmd->resp[0] |= R1_ERASE_RESET;
+
+ if (rspbuf[0] & MMCSPI_R1_IDLE)
+ mmc_cmd->resp[0] |=
+ (uint32_t)R1_STATE_IDLE << 9;
+ else
+ mmc_cmd->resp[0] |=
+ (uint32_t)R1_STATE_READY << 9;
+
+ /* When MMC_CMD_IS_APP is sent, emulate R1_APP_CMD
+ SD-bus status bit. */
+ if (!(cmd->flags & MMC_CMD_IS_APP) &&
+ (MMC_APP_CMD == cmd->opcode))
+ mmc_cmd->resp[0] |= R1_APP_CMD;
+
+ if (MMCSPI_RSP_R2 == cmd->rsp_type) {
+ if (rspbuf[1] & MMCSPI_R2_OOR_CSD_OW)
+ mmc_cmd->resp[0] |=
+ R1_OUT_OF_RANGE |
+ R1_CSD_OVERWRITE;
+
+ if (rspbuf[1] & MMCSPI_R2_ERASE_PARAM)
+ mmc_cmd->resp[0] |= R1_ERASE_PARAM;
+
+ if (rspbuf[1] & MMCSPI_R2_WP_VIOLATE)
+ mmc_cmd->resp[0] |= R1_WP_VIOLATION;
+
+ if (rspbuf[1] & MMCSPI_R2_ECC_FAIL)
+ mmc_cmd->resp[0] |= R1_CARD_ECC_FAILED;
+
+ if (rspbuf[1] & MMCSPI_R2_CC_ERR)
+ mmc_cmd->resp[0] |= R1_CC_ERROR;
+
+ if (rspbuf[1] & MMCSPI_R2_ERR)
+ mmc_cmd->resp[0] |= R1_ERROR;
+
+ if (rspbuf[1] & MMCSPI_R2_WP_ER_LCK)
+ mmc_cmd->resp[0] |=
+ R1_LOCK_UNLOCK_FAILED |
+ R1_WP_ERASE_SKIP;
+
+ if (rspbuf[1] & MMCSPI_R2_LOCKED)
+ mmc_cmd->resp[0] |= R1_CARD_IS_LOCKED;
+
+ }
+ } else
+ return (MMC_ERR_INVALID);
+
+ } else if (MMCSPI_TO_MMC_RSP_R2 == mmc_rsp_type) {
+
+ if (16 == cmd->ldata.len) {
+
+ TRACE(dev, ACTION, "translating SPI-R1/ldata(16) "
+ "to SD-R2\n");
+
+ /* ldata contains bits 127:0 of the spi response */
+
+ mmc_cmd->resp[0] =
+ (uint32_t)ldata[0] << 24 |
+ (uint32_t)ldata[1] << 16 |
+ (uint32_t)ldata[2] << 8 |
+ (uint32_t)ldata[3];
+
+ mmc_cmd->resp[1] =
+ (uint32_t)ldata[4] << 24 |
+ (uint32_t)ldata[5] << 16 |
+ (uint32_t)ldata[6] << 8 |
+ (uint32_t)ldata[7];
+
+ mmc_cmd->resp[2] =
+ (uint32_t)ldata[8] << 24 |
+ (uint32_t)ldata[9] << 16 |
+ (uint32_t)ldata[10] << 8 |
+ (uint32_t)ldata[11];
+
+ mmc_cmd->resp[3] =
+ (uint32_t)ldata[12] << 24 |
+ (uint32_t)ldata[13] << 16 |
+ (uint32_t)ldata[14] << 8;
+
+ } else
+ return (MMC_ERR_INVALID);
+
+ } else if (MMCSPI_TO_MMC_RSP_R3 == mmc_rsp_type) {
+
+ if (MMCSPI_RSP_R3 == cmd->rsp_type) {
+
+ TRACE(dev, ACTION, "translating SPI-R3 to SD-R3\n");
+
+ /* rspbuf contains a 40-bit spi-R3 from the
+ MMCSPI_READ_OCR response, of which bits 31:0 are
+ the OCR value */
+
+ /* spi response bits 31:0 mapped to
+ sdhc register bits 31:0 */
+ mmc_cmd->resp[0] =
+ (uint32_t)rspbuf[1] << 24 |
+ (uint32_t)rspbuf[2] << 16 |
+ (uint32_t)rspbuf[3] << 8 |
+ (uint32_t)rspbuf[4];
+
+ /* Clear card busy bit (indicating busy) if the
+ SPI-R1 idle bit is set. */
+ if (rspbuf[0] & MMCSPI_R1_IDLE) {
+ mmc_cmd->resp[0] &= ~MMC_OCR_CARD_BUSY;
+ } else {
+ mmc_cmd->resp[0] |= MMC_OCR_CARD_BUSY;
+ }
+
+ TRACE(dev, DETAILS, "ocr=0x%08x\n", mmc_cmd->resp[0]);
+ } else
+ return (MMC_ERR_INVALID);
+
+ } else if (MMCSPI_TO_MMC_RSP_R6 == mmc_rsp_type) {
+ if (MMCSPI_RSP_R2 == cmd->rsp_type) {
+
+ TRACE(dev, ACTION, "translating SPI-R2 to SD-R6\n");
+
+ /* rca returned will always be zero */
+ mmc_cmd->resp[0] = 0;
+
+ if (rspbuf[0] & MMCSPI_R1_CRC_ERR)
+ mmc_cmd->resp[0] |= 0x8000;
+
+ if (rspbuf[0] & MMCSPI_R1_ILL_CMD)
+ mmc_cmd->resp[0] |= 0x4000;
+
+ if (rspbuf[1] & MMCSPI_R2_ERR)
+ mmc_cmd->resp[0] |= 0x2000;
+
+ if (rspbuf[0] & MMCSPI_R1_IDLE)
+ mmc_cmd->resp[0] |=
+ (uint32_t)R1_STATE_IDLE << 9;
+ else
+ mmc_cmd->resp[0] |=
+ (uint32_t)R1_STATE_READY << 9;
+ } else
+ return (MMC_ERR_INVALID);
+
+ } else if (MMCSPI_TO_MMC_RSP_R7 == mmc_rsp_type) {
+ if (MMCSPI_RSP_R7 == cmd->rsp_type) {
+
+ TRACE(dev, ACTION, "translating SPI-R7 to SD-R7\n");
+
+ /* rsp buf contains a 40-bit spi-R7, of which bits
+ 11:0 need to be transferred */
+
+ /* spi response bits 11:0 mapped to
+ sdhc register bits 11:0 */
+ mmc_cmd->resp[0] =
+ (uint32_t)(rspbuf[3] & 0xf) << 8 |
+ (uint32_t)rspbuf[4];
+ } else
+ return (MMC_ERR_INVALID);
+
+ } else if (MMCSPI_TO_MMC_RSP_NONE != mmc_rsp_type)
+ return (MMC_ERR_INVALID);
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_get_ocr(device_t dev, uint8_t *ocrbuf)
+{
+ struct mmc_command mmc_cmd;
+ struct mmcspi_command cmd;
+ unsigned int err;
+ uint8_t r1_status;
+ uint8_t rspbuf[MMCSPI_MAX_RSP_LEN];
+
+ TRACE_ENTER(dev);
+
+ memset(&mmc_cmd, 0, sizeof(struct mmc_command));
+ mmc_cmd.opcode = MMCSPI_READ_OCR;
+ mmc_cmd.flags = MMC_RSP_R3 | MMC_CMD_AC;
+
+ err = mmcspi_set_up_command(dev, &cmd, &mmc_cmd);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ err = mmcspi_send_cmd(dev, &cmd, rspbuf);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ r1_status = rspbuf[0] & cmd.error_mask;
+ if (r1_status) {
+ if (r1_status & MMCSPI_R1_CRC_ERR)
+ err = MMC_ERR_BADCRC;
+ else
+ err = MMC_ERR_INVALID;
+
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ memcpy(ocrbuf, &rspbuf[1], MMCSPI_OCR_LEN);
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_set_crc_on_off(device_t dev, unsigned int crc_on)
+{
+ struct mmc_command mmc_cmd;
+ struct mmcspi_command cmd;
+ unsigned int err;
+ uint8_t r1_status;
+ uint8_t rspbuf[MMCSPI_MAX_RSP_LEN];
+
+ TRACE_ENTER(dev);
+
+ memset(&mmc_cmd, 0, sizeof(struct mmc_command));
+ mmc_cmd.opcode = MMCSPI_CRC_ON_OFF;
+ mmc_cmd.arg = crc_on ? 1 : 0;
+ mmc_cmd.flags = MMC_RSP_NONE | MMC_CMD_AC;
+
+ err = mmcspi_set_up_command(dev, &cmd, &mmc_cmd);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ err = mmcspi_send_cmd(dev, &cmd, rspbuf);
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ r1_status = rspbuf[0] & cmd.error_mask;
+ if (r1_status) {
+ if (r1_status & MMCSPI_R1_CRC_ERR)
+ err = MMC_ERR_BADCRC;
+ else
+ err = MMC_ERR_INVALID;
+
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ TRACE_EXIT(dev);
+ return (MMC_ERR_NONE);
+}
+
+static unsigned int
+mmcspi_update_crc_setting(device_t dev, unsigned int crc_on)
+{
+ struct mmcspi_softc *sc;
+ struct mmcspi_slot *slot;
+ unsigned int err;
+ int i;
+
+ TRACE_ENTER(dev);
+
+ sc = device_get_softc(dev);
+ slot = &sc->slot;
+
+ for (i = 0; i <= MMCSPI_RETRIES; i++) {
+ err = mmcspi_set_crc_on_off(dev, crc_on);
+ if (MMC_ERR_BADCRC != err)
+ break;
+ }
+
+ if (MMC_ERR_NONE != err) {
+ TRACE_EXIT(dev);
+ return (err);
+ }
+
+ if (crc_on)
+ slot->crc_enabled = 1;
+ else
+ slot->crc_enabled = 0;
+
+ TRACE_EXIT(dev);
+
+ return (MMC_ERR_NONE);
+}
+
+static int
+mmcspi_request(device_t brdev, device_t reqdev, struct mmc_request *req)
+{
+ TRACE_ENTER(brdev);
+
+ struct mmcspi_softc *sc = device_get_softc(brdev);
+ struct mmcspi_slot *slot = &sc->slot;
+ struct mmcspi_command cmd;
+ struct mmc_command *mmc_cmd = req->cmd;
+ struct mmc_data *data;
+ unsigned int err;
+ unsigned int use_crc_sample;
+ int i, j;
+ uint32_t opcode;
+ uint32_t flags;
+ uint32_t last_opcode;
+ uint32_t last_flags;
+ uint8_t rspbuf[MMCSPI_MAX_RSP_LEN];
+
+#define IS_CMD(code, cmd, flags) \
+ (!((flags) & MMC_CMD_IS_APP) && ((code) == (cmd)))
+#define IS_ACMD(code, cmd, flags) \
+ (((flags) & MMC_CMD_IS_APP) && ((code) == (cmd)))
+
+ if (power_on != slot->host.ios.power_mode)
+ return (MMC_ERR_INVALID);
+
+ /*
+ * Sample use_crc sysctl and adjust card setting if required and
+ * appropriate.
+ */
+ use_crc_sample = sc->use_crc;
+ if (slot->crc_init_done &&
+ (use_crc_sample != slot->crc_enabled)) {
+ err = mmcspi_update_crc_setting(brdev, use_crc_sample);
+ if (MMC_ERR_NONE != err)
+ goto out;
+ slot->crc_init_done = 1;
+ }
+
+ err = mmcspi_set_up_command(brdev, &cmd, mmc_cmd);
+ if (MMC_ERR_NONE != err)
+ goto out;
+
+ opcode = cmd.opcode;
+ flags = cmd.flags;
+ data = cmd.data;
+
+ last_opcode = slot->last_opcode;
+ last_flags = slot->last_flags;
+
+ /* enforce restrictions on request parameters */
+ if (data) {
+ /*
+ * All writes must be a multiple of the block length. All
+ * reads greater than the block length must be a multiple of
+ * the block length.
+ */
+ if ((data->len % MMCSPI_DATA_BLOCK_LEN) &&
+ !((data->flags & MMC_DATA_READ) &&
+ (data->len < MMCSPI_DATA_BLOCK_LEN))) {
+ TRACE(brdev, ERROR,
+ "requested data phase not a multiple of %u\n",
+ MMCSPI_DATA_BLOCK_LEN);
+ err = MMC_ERR_INVALID;
+ goto out;
+ }
+
+ if (((data->flags & MMC_DATA_READ) &&
+ (data->flags & MMC_DATA_WRITE)) ||
+ (data->flags & MMC_DATA_STREAM)) {
+ TRACE(brdev, ERROR, "illegal data phase flags 0x%02x\n",
+ data->flags);
+ err = MMC_ERR_INVALID;
+ goto out;
+ }
+ }
+
+ for (i = 0; i <= cmd.retries; i++) {
+ /*
+ * On the next command following a CMD8, collect the OCR and
+ * save it off for use in the next ACMD41.
+ */
+ if (IS_CMD(SD_SEND_IF_COND, last_opcode, last_flags)) {
+ err = mmcspi_get_ocr(brdev, slot->last_ocr);
+ if (MMC_ERR_NONE != err) {
+ if (MMC_ERR_BADCRC == err)
+ continue;
+ goto out;
+ }
+ }
+
+ err = mmcspi_send_cmd(brdev, &cmd, rspbuf);
+ if (MMC_ERR_NONE != err) {
+ if (MMC_ERR_BADCRC == err)
+ continue;
+ goto out;
+ }
+
+ if (data) {
+ if (data->flags & MMC_DATA_READ)
+ err = mmcspi_read_phase(brdev, &cmd);
+ else /* MMC_DATA_WRITE */
+ err = mmcspi_write_phase(brdev, &cmd);
+ if (MMC_ERR_NONE != err) {
+ if (MMC_ERR_BADCRC == err)
+ continue;
+ goto out;
+ }
+ }
+ break;
+ }
+
+ if (MMC_ERR_NONE != err)
+ goto out;
+
+ /*
+ * If this was an ACMD_SD_SEND_OP_COND or MMC_SEND_OP_COND, we need
+ * to return an OCR value in the result. If the response from the
+ * card indicates it is still in the IDLE state, supply the OCR
+ * value obtained after the last CMD8, otherwise issue an
+ * MMCSPI_READ_OCR to get the current value, which will have a valid
+ * CCS bit.
+ *
+ * This dance is required under this emulation approach because the
+ * spec stipulates that no other commands should be sent while
+ * ACMD_SD_SEND_OP_COND is being used to poll for the end of the
+ * IDLE state, and some cards do enforce that requirement.
+ */
+ if (IS_ACMD(ACMD_SD_SEND_OP_COND, opcode, flags) ||
+ IS_CMD(MMC_SEND_OP_COND, opcode, flags)) {
+
+ if (rspbuf[0] & MMCSPI_R1_IDLE)
+ memcpy(&rspbuf[1], slot->last_ocr, MMCSPI_OCR_LEN);
+ else {
+
+ /*
+ * Some cards won't accept the MMCSPI_CRC_ON_OFF
+ * command until initialization is complete.
+ *
+ * Examples:
+ *
+ * Super Talent 1GB SDSC card, cid:
+ * mid=0x1b oid=0x534d pnm="00000" prv=1.0 mdt=02.2010
+ */
+ if (!slot->crc_init_done) {
+ err = mmcspi_update_crc_setting(brdev,
+ sc->use_crc);
+ if (MMC_ERR_NONE != err)
+ goto out;
+ slot->crc_init_done = 1;
+ }
+
+ for (j = 0; j <= cmd.retries; j++) {
+ /*
+ * Note that in this case, we pass on the R1
+ * from READ_OCR.
+ */
+ err = mmcspi_get_ocr(brdev, rspbuf);
+ if (MMC_ERR_NONE != err) {
+ if (MMC_ERR_BADCRC == err)
+ continue;
+
+ goto out;
+ }
+
+ }
+
+ if (MMC_ERR_NONE != err)
+ goto out;
+
+ }
+
+ /* adjust the SPI response type to include the OCR */
+ cmd.rsp_type = MMCSPI_RSP_R3;
+ }
+
+ err = mmcspi_translate_response(brdev, &cmd, rspbuf);
+ if (MMC_ERR_NONE != err)
+ goto out;
+
+ out:
+ slot->last_opcode = mmc_cmd->opcode;
+ slot->last_flags = mmc_cmd->flags;
+
+ mmc_cmd->error = err;
+
+ if (req->done)
+ req->done(req);
+
+ TRACE_EXIT(brdev);
+
+ return (err);
+}
+
+static int
+mmcspi_get_ro(device_t brdev, device_t reqdev)
+{
+
+ TRACE_ENTER(brdev);
+ TRACE_EXIT(brdev);
+
+ /* XXX no support for this currently */
+ return (0);
+}
+
+static int
+mmcspi_acquire_host(device_t brdev, device_t reqdev)
+{
+ struct mmcspi_slot *slot;
+ int err;
+
+ TRACE_ENTER(brdev);
+ err = 0;
+
+ slot = device_get_ivars(reqdev);
+
+ MMCSPI_LOCK_SLOT(slot);
+ while (slot->bus_busy)
+ mtx_sleep(slot, &slot->mtx, 0, "mmcspiah", 0);
+ slot->bus_busy++;
+ MMCSPI_UNLOCK_SLOT(slot);
+
+ TRACE_EXIT(brdev);
+
+ return (err);
+}
+
+static int
+mmcspi_release_host(device_t brdev, device_t reqdev)
+{
+ struct mmcspi_slot *slot;
+
+ TRACE_ENTER(brdev);
+
+ slot = device_get_ivars(reqdev);
+
+ MMCSPI_LOCK_SLOT(slot);
+ slot->bus_busy--;
+ MMCSPI_UNLOCK_SLOT(slot);
+
+ wakeup(slot);
+
+ TRACE_EXIT(brdev);
+
+ return (0);
+}
+
+static int
+mmcspi_modevent_handler(module_t mod, int what, void *arg)
+{
+
+ switch (what) {
+ case MOD_LOAD:
+ init_crc7tab();
+ init_crc16tab();
+ memset(onesbuf, 0xff, sizeof(onesbuf));
+ break;
+ default:
+ return (EOPNOTSUPP);
+ }
+
+ return (0);
+}
+
+static int
+mmcspi_switch_vccq(device_t bus, device_t child)
+{
+
+ return (0);
+}
+
+#if defined(MMCSPI_ENABLE_DEBUG_FUNCS)
+static void
+mmcspi_dump_data(device_t dev, const char *label, uint8_t *data,
+ unsigned int len)
+{
+ unsigned int i, j;
+ unsigned int num_lines;
+ unsigned int residual;
+
+ TRACE_ENTER(dev);
+
+ num_lines = len / 16;
+ residual = len - 16 * num_lines;
+
+ for(i = 0; i < num_lines; i++) {
+ device_printf(dev, "%s:", label);
+ for(j = 0; j < 16; j++)
+ printf(" %02x", data[i * 16 + j]);
+ printf("\n");
+ }
+
+ if (residual) {
+ device_printf(dev, "%s:", label);
+ for(j = 0; j < residual; j++)
+ printf(" %02x", data[num_lines * 16 + j]);
+ printf("\n");
+ }
+
+ TRACE_EXIT(dev);
+}
+
+static void
+mmcspi_dump_spi_bus(device_t dev, unsigned int len)
+{
+ unsigned int num_blocks;
+ unsigned int residual;
+ unsigned int i;
+
+ TRACE_ENTER(dev);
+
+ num_blocks = len / MMCSPI_DATA_BLOCK_LEN;
+ residual = len - num_blocks * MMCSPI_DATA_BLOCK_LEN;
+
+ for (i = 0; i < num_blocks; i++) {
+ if (MMC_ERR_NONE != mmcspi_do_spi_read(dev, junkbuf,
+ MMCSPI_DATA_BLOCK_LEN)) {
+ device_printf(dev, "spi read failed\n");
+ return;
+ }
+
+ mmcspi_dump_data(dev, "bus_data", junkbuf,
+ MMCSPI_DATA_BLOCK_LEN);
+ }
+
+ if (residual) {
+ if (MMC_ERR_NONE != mmcspi_do_spi_read(dev, junkbuf,
+ residual)) {
+ device_printf(dev, "spi read failed\n");
+ return;
+ }
+
+ mmcspi_dump_data(dev, "bus_data", junkbuf, residual);
+ }
+
+ TRACE_EXIT(dev);
+}
+#endif
+
+static device_method_t mmcspi_methods[] = {
+ /* device_if */
+ DEVMETHOD(device_probe, mmcspi_probe),
+ DEVMETHOD(device_attach, mmcspi_attach),
+ DEVMETHOD(device_detach, mmcspi_detach),
+ DEVMETHOD(device_suspend, mmcspi_suspend),
+ DEVMETHOD(device_resume, mmcspi_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_read_ivar, mmcspi_read_ivar),
+ DEVMETHOD(bus_write_ivar, mmcspi_write_ivar),
+
+ /* mmcbr_if */
+ DEVMETHOD(mmcbr_update_ios, mmcspi_update_ios),
+ DEVMETHOD(mmcbr_request, mmcspi_request),
+ DEVMETHOD(mmcbr_get_ro, mmcspi_get_ro),
+ DEVMETHOD(mmcbr_acquire_host, mmcspi_acquire_host),
+ DEVMETHOD(mmcbr_release_host, mmcspi_release_host),
+ DEVMETHOD(mmcbr_switch_vccq, mmcspi_switch_vccq),
+
+ {0, 0},
+};
+
+static driver_t mmcspi_driver = {
+ "mmcspi",
+ mmcspi_methods,
+ sizeof(struct mmcspi_softc),
+};
+
+DRIVER_MODULE(mmcspi, spibus, mmcspi_driver, mmcspi_modevent_handler, NULL);
+MODULE_DEPEND(mmcspi, spibus, 1, 1, 1);
+MMC_DECLARE_BRIDGE(mmcspi);
+#ifdef FDT
+SPIBUS_FDT_PNP_INFO(compat_data);
+#endif
diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c
index f12632e7205b..324ead5e8b87 100644
--- a/sys/dev/pci/pci_host_generic_acpi.c
+++ b/sys/dev/pci/pci_host_generic_acpi.c
@@ -411,7 +411,8 @@ generic_pcie_get_iommu(device_t pci, device_t child, uintptr_t *id)
{
struct generic_pcie_acpi_softc *sc;
struct pci_id_ofw_iommu *iommu;
- u_int iommu_sid, iommu_xref;
+ uint64_t iommu_xref;
+ u_int iommu_sid;
uintptr_t rid;
int err;
diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c
index 73c6201dc14b..ffe63b82a234 100644
--- a/sys/dev/pci/pci_host_generic_fdt.c
+++ b/sys/dev/pci/pci_host_generic_fdt.c
@@ -367,7 +367,7 @@ generic_pcie_get_iommu(device_t pci, device_t child, uintptr_t *id)
{
struct pci_id_ofw_iommu *iommu;
uint32_t iommu_rid;
- uint32_t iommu_xref;
+ phandle_t iommu_xref;
uint16_t pci_rid;
phandle_t node;
int err;
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 14cb577dbedf..d1b7d28eae91 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -122,8 +122,8 @@ struct pcicfg_msix {
};
struct pci_id_ofw_iommu {
+ uintptr_t xref;
uint32_t id;
- uint32_t xref;
};
/* Interesting values for HyperTransport */
diff --git a/sys/dev/qcom_dwc3/qcom_dwc3.c b/sys/dev/qcom_dwc3/qcom_dwc3.c
index 5c5a47989441..7352d658d326 100644
--- a/sys/dev/qcom_dwc3/qcom_dwc3.c
+++ b/sys/dev/qcom_dwc3/qcom_dwc3.c
@@ -58,7 +58,7 @@ static struct ofw_compat_data compat_data[] = {
struct qcom_dwc3_softc {
struct simplebus_softc sc;
device_t dev;
- clk_t clk_master;
+ clk_t clk_core;
clk_t clk_sleep;
clk_t clk_mock_utmi;
int type;
@@ -98,8 +98,8 @@ qcom_dwc3_attach(device_t dev)
sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
/* Mandatory clocks */
- if (clk_get_by_ofw_name(dev, 0, "master", &sc->clk_master) != 0) {
- device_printf(dev, "Cannot get master clock\n");
+ if (clk_get_by_ofw_name(dev, 0, "core", &sc->clk_core) != 0) {
+ device_printf(dev, "Cannot get core clock\n");
return (ENXIO);
}
@@ -121,10 +121,10 @@ qcom_dwc3_attach(device_t dev)
/*
* Now, iterate over the clocks and enable them.
*/
- err = clk_enable(sc->clk_master);
+ err = clk_enable(sc->clk_core);
if (err != 0) {
device_printf(dev, "Could not enable clock %s\n",
- clk_get_name(sc->clk_master));
+ clk_get_name(sc->clk_core));
return (ENXIO);
}
err = clk_enable(sc->clk_sleep);
diff --git a/sys/dev/qcom_gcc/qcom_gcc_clock.c b/sys/dev/qcom_gcc/qcom_gcc_clock.c
new file mode 100644
index 000000000000..c8c10b0c5172
--- /dev/null
+++ b/sys/dev/qcom_gcc/qcom_gcc_clock.c
@@ -0,0 +1,98 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025, Adrian Chadd <adrian@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sglist.h>
+#include <sys/random.h>
+#include <sys/stdatomic.h>
+#include <sys/mutex.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include "qcom_gcc_var.h"
+
+int
+qcom_gcc_clock_read(device_t dev, bus_addr_t addr, uint32_t *val)
+{
+ struct qcom_gcc_softc *sc;
+
+ sc = device_get_softc(dev);
+ *val = bus_read_4(sc->reg, addr);
+ return (0);
+}
+
+int
+qcom_gcc_clock_write(device_t dev, bus_addr_t addr, uint32_t val)
+{
+ struct qcom_gcc_softc *sc;
+
+ sc = device_get_softc(dev);
+ bus_write_4(sc->reg, addr, val);
+ return (0);
+}
+
+int
+qcom_gcc_clock_modify(device_t dev, bus_addr_t addr,
+ uint32_t clear_mask, uint32_t set_mask)
+{
+ struct qcom_gcc_softc *sc;
+ uint32_t reg;
+
+ sc = device_get_softc(dev);
+ reg = bus_read_4(sc->reg, addr);
+ reg &= clear_mask;
+ reg |= set_mask;
+ bus_write_4(sc->reg, addr, reg);
+ return (0);
+}
+
+void
+qcom_gcc_clock_lock(device_t dev)
+{
+ struct qcom_gcc_softc *sc;
+
+ sc = device_get_softc(dev);
+ mtx_lock(&sc->mtx);
+}
+
+void
+qcom_gcc_clock_unlock(device_t dev)
+{
+ struct qcom_gcc_softc *sc;
+
+ sc = device_get_softc(dev);
+ mtx_unlock(&sc->mtx);
+}
diff --git a/sys/dev/qcom_gcc/qcom_gcc_ipq4018.h b/sys/dev/qcom_gcc/qcom_gcc_ipq4018.h
new file mode 100644
index 000000000000..2b5bfa453766
--- /dev/null
+++ b/sys/dev/qcom_gcc/qcom_gcc_ipq4018.h
@@ -0,0 +1,41 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Adrian Chadd <adrian@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __QCOM_GCC_IPQ4018_H__
+#define __QCOM_GCC_IPQ4018_H__
+
+/*
+ * reset block
+ */
+extern void qcom_gcc_ipq4018_hwreset_init(struct qcom_gcc_softc *);
+
+/*
+ * clock block
+ */
+extern void qcom_gcc_ipq4018_clock_setup(struct qcom_gcc_softc *);
+
+#endif /* __QCOM_GCC_IPQ4018_H__ */
diff --git a/sys/dev/qcom_gcc/qcom_gcc_ipq4018_clock.c b/sys/dev/qcom_gcc/qcom_gcc_ipq4018_clock.c
index 6441cf3e6ae5..ce67b2898efb 100644
--- a/sys/dev/qcom_gcc/qcom_gcc_ipq4018_clock.c
+++ b/sys/dev/qcom_gcc/qcom_gcc_ipq4018_clock.c
@@ -59,8 +59,8 @@
#include <dev/qcom_clk/qcom_clk_branch2.h>
#include <dev/qcom_clk/qcom_clk_ro_div.h>
-#include "qcom_gcc_ipq4018_var.h"
-
+#include "qcom_gcc_var.h"
+#include "qcom_gcc_ipq4018.h"
/* Fixed rate clock. */
#define F_RATE(_id, cname, _freq) \
@@ -578,7 +578,7 @@ static struct qcom_clk_branch2_def branch2_tbl[] = {
0x1e00c, 0, 0, 0, 0x1e00c, QCOM_CLK_BRANCH2_BRANCH_HALT,
false, 0),
F_BRANCH2(GCC_USB2_SLEEP_CLK, "gcc_usb2_sleep_clk",
- "gcc_sleep_clk_src", 0x1e010, 0, 0, 0, 0x1e010,
+ "sleep_clk", 0x1e010, 0, 0, 0, 0x1e010,
QCOM_CLK_BRANCH2_BRANCH_HALT,
false, 0),
F_BRANCH2(GCC_USB2_MOCK_UTMI_CLK, "gcc_usb2_mock_utmi_clk",
@@ -588,7 +588,7 @@ static struct qcom_clk_branch2_def branch2_tbl[] = {
F_BRANCH2(GCC_USB3_MASTER_CLK, "gcc_usb3_master_clk", "fepll125",
0x1e028, 0, 0, 0, 0x1e028, QCOM_CLK_BRANCH2_BRANCH_HALT,
false, 0),
- F_BRANCH2(GCC_USB3_SLEEP_CLK, "gcc_usb3_sleep_clk", "gcc_sleep_clk_src",
+ F_BRANCH2(GCC_USB3_SLEEP_CLK, "gcc_usb3_sleep_clk", "sleep_clk",
0x1e02c, 0, 0, 0, 0x1e02c, QCOM_CLK_BRANCH2_BRANCH_HALT,
false, 0),
F_BRANCH2(GCC_USB3_MOCK_UTMI_CLK, "gcc_usb3_mock_utmi_clk",
@@ -602,7 +602,12 @@ static struct qcom_clk_branch2_def branch2_tbl[] = {
F_BRANCH2(GCC_WCSS2G_REF_CLK, "gcc_wcss2g_ref_clk", "xo",
0x1f00c, 0, 0, 0, 0x1f00c, QCOM_CLK_BRANCH2_BRANCH_HALT,
false, QCOM_CLK_BRANCH2_FLAGS_SET_RATE_PARENT),
- F_BRANCH2(GCC_WCSS2G_RTC_CLK, "gcc_wcss2g_rtc_clk", "gcc_sleep_clk_src",
+ /*
+ * TODO: figure out whether gcc_sleep_clk_src -> sleep_clk is right;
+ * will need to go consult the openwrt ipq4018 device tree / code
+ * again!
+ */
+ F_BRANCH2(GCC_WCSS2G_RTC_CLK, "gcc_wcss2g_rtc_clk", "sleep_clk",
0x1f010, 0, 0, 0, 0x1f010, QCOM_CLK_BRANCH2_BRANCH_HALT,
false, 0),
@@ -613,7 +618,7 @@ static struct qcom_clk_branch2_def branch2_tbl[] = {
F_BRANCH2(GCC_WCSS5G_REF_CLK, "gcc_wcss5g_ref_clk", "xo",
0x1f00c, 0, 0, 0, 0x2000c, QCOM_CLK_BRANCH2_BRANCH_HALT,
false, QCOM_CLK_BRANCH2_FLAGS_SET_RATE_PARENT),
- F_BRANCH2(GCC_WCSS5G_RTC_CLK, "gcc_wcss5g_rtc_clk", "gcc_sleep_clk_src",
+ F_BRANCH2(GCC_WCSS5G_RTC_CLK, "gcc_wcss5g_rtc_clk", "sleep_clk",
0x1f010, 0, 0, 0, 0x20010, QCOM_CLK_BRANCH2_BRANCH_HALT,
false, 0),
@@ -624,7 +629,7 @@ static struct qcom_clk_branch2_def branch2_tbl[] = {
};
static void
-qcom_gcc_ipq4018_clock_init_fepll(struct qcom_gcc_ipq4018_softc *sc)
+qcom_gcc_ipq4018_clock_init_fepll(struct qcom_gcc_softc *sc)
{
int i, rv;
@@ -636,7 +641,7 @@ qcom_gcc_ipq4018_clock_init_fepll(struct qcom_gcc_ipq4018_softc *sc)
}
static void
-qcom_gcc_ipq4018_clock_init_fdiv(struct qcom_gcc_ipq4018_softc *sc)
+qcom_gcc_ipq4018_clock_init_fdiv(struct qcom_gcc_softc *sc)
{
int i, rv;
@@ -648,7 +653,7 @@ qcom_gcc_ipq4018_clock_init_fdiv(struct qcom_gcc_ipq4018_softc *sc)
}
static void
-qcom_gcc_ipq4018_clock_init_apssdiv(struct qcom_gcc_ipq4018_softc *sc)
+qcom_gcc_ipq4018_clock_init_apssdiv(struct qcom_gcc_softc *sc)
{
int i, rv;
@@ -660,7 +665,7 @@ qcom_gcc_ipq4018_clock_init_apssdiv(struct qcom_gcc_ipq4018_softc *sc)
}
static void
-qcom_gcc_ipq4018_clock_init_rcg2(struct qcom_gcc_ipq4018_softc *sc)
+qcom_gcc_ipq4018_clock_init_rcg2(struct qcom_gcc_softc *sc)
{
int i, rv;
@@ -672,7 +677,7 @@ qcom_gcc_ipq4018_clock_init_rcg2(struct qcom_gcc_ipq4018_softc *sc)
}
static void
-qcom_gcc_ipq4018_clock_init_branch2(struct qcom_gcc_ipq4018_softc *sc)
+qcom_gcc_ipq4018_clock_init_branch2(struct qcom_gcc_softc *sc)
{
int i, rv;
@@ -684,7 +689,7 @@ qcom_gcc_ipq4018_clock_init_branch2(struct qcom_gcc_ipq4018_softc *sc)
}
static void
-qcom_gcc_ipq4018_clock_init_ro_div(struct qcom_gcc_ipq4018_softc *sc)
+qcom_gcc_ipq4018_clock_init_ro_div(struct qcom_gcc_softc *sc)
{
int i, rv;
@@ -695,43 +700,8 @@ qcom_gcc_ipq4018_clock_init_ro_div(struct qcom_gcc_ipq4018_softc *sc)
}
}
-int
-qcom_gcc_ipq4018_clock_read(device_t dev, bus_addr_t addr, uint32_t *val)
-{
- struct qcom_gcc_ipq4018_softc *sc;
-
- sc = device_get_softc(dev);
- *val = bus_read_4(sc->reg, addr);
- return (0);
-}
-
-int
-qcom_gcc_ipq4018_clock_write(device_t dev, bus_addr_t addr, uint32_t val)
-{
- struct qcom_gcc_ipq4018_softc *sc;
-
- sc = device_get_softc(dev);
- bus_write_4(sc->reg, addr, val);
- return (0);
-}
-
-int
-qcom_gcc_ipq4018_clock_modify(device_t dev, bus_addr_t addr,
- uint32_t clear_mask, uint32_t set_mask)
-{
- struct qcom_gcc_ipq4018_softc *sc;
- uint32_t reg;
-
- sc = device_get_softc(dev);
- reg = bus_read_4(sc->reg, addr);
- reg &= clear_mask;
- reg |= set_mask;
- bus_write_4(sc->reg, addr, reg);
- return (0);
-}
-
void
-qcom_gcc_ipq4018_clock_setup(struct qcom_gcc_ipq4018_softc *sc)
+qcom_gcc_ipq4018_clock_setup(struct qcom_gcc_softc *sc)
{
sc->clkdom = clkdom_create(sc->dev);
@@ -747,21 +717,3 @@ qcom_gcc_ipq4018_clock_setup(struct qcom_gcc_ipq4018_softc *sc)
/* Finalise clock tree */
clkdom_finit(sc->clkdom);
}
-
-void
-qcom_gcc_ipq4018_clock_lock(device_t dev)
-{
- struct qcom_gcc_ipq4018_softc *sc;
-
- sc = device_get_softc(dev);
- mtx_lock(&sc->mtx);
-}
-
-void
-qcom_gcc_ipq4018_clock_unlock(device_t dev)
-{
- struct qcom_gcc_ipq4018_softc *sc;
-
- sc = device_get_softc(dev);
- mtx_unlock(&sc->mtx);
-}
diff --git a/sys/dev/qcom_gcc/qcom_gcc_ipq4018_reset.c b/sys/dev/qcom_gcc/qcom_gcc_ipq4018_reset.c
index ae2236d7fca7..f99d1d9ad9f1 100644
--- a/sys/dev/qcom_gcc/qcom_gcc_ipq4018_reset.c
+++ b/sys/dev/qcom_gcc/qcom_gcc_ipq4018_reset.c
@@ -50,10 +50,10 @@
#include <dt-bindings/clock/qcom,gcc-ipq4019.h>
-#include "qcom_gcc_ipq4018_var.h"
+#include "qcom_gcc_var.h"
+#include "qcom_gcc_ipq4018.h"
-
-static const struct qcom_gcc_ipq4018_reset_entry gcc_ipq4019_reset_list[] = {
+static const struct qcom_gcc_reset_entry gcc_ipq4019_reset_list[] = {
[WIFI0_CPU_INIT_RESET] = { 0x1f008, 5 },
[WIFI0_RADIO_SRIF_RESET] = { 0x1f008, 4 },
[WIFI0_RADIO_WARM_RESET] = { 0x1f008, 3 },
@@ -127,10 +127,10 @@ static const struct qcom_gcc_ipq4018_reset_entry gcc_ipq4019_reset_list[] = {
[GCC_SPDM_BCR] = {0x25000, 0},
};
-int
+static int
qcom_gcc_ipq4018_hwreset_assert(device_t dev, intptr_t id, bool reset)
{
- struct qcom_gcc_ipq4018_softc *sc;
+ struct qcom_gcc_softc *sc;
uint32_t reg;
sc = device_get_softc(dev);
@@ -151,10 +151,10 @@ qcom_gcc_ipq4018_hwreset_assert(device_t dev, intptr_t id, bool reset)
return (0);
}
-int
+static int
qcom_gcc_ipq4018_hwreset_is_asserted(device_t dev, intptr_t id, bool *reset)
{
- struct qcom_gcc_ipq4018_softc *sc;
+ struct qcom_gcc_softc *sc;
uint32_t reg;
sc = device_get_softc(dev);
@@ -175,3 +175,9 @@ qcom_gcc_ipq4018_hwreset_is_asserted(device_t dev, intptr_t id, bool *reset)
return (0);
}
+void
+qcom_gcc_ipq4018_hwreset_init(struct qcom_gcc_softc *sc)
+{
+ sc->sc_cb.hw_reset_assert = qcom_gcc_ipq4018_hwreset_assert;
+ sc->sc_cb.hw_reset_is_asserted = qcom_gcc_ipq4018_hwreset_is_asserted;
+}
diff --git a/sys/dev/qcom_gcc/qcom_gcc_ipq4018.c b/sys/dev/qcom_gcc/qcom_gcc_main.c
index 5980d8ebe893..3950bd985feb 100644
--- a/sys/dev/qcom_gcc/qcom_gcc_ipq4018.c
+++ b/sys/dev/qcom_gcc/qcom_gcc_main.c
@@ -1,7 +1,7 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
- * Copyright (c) 2021, Adrian Chadd <adrian@FreeBSD.org>
+ * Copyright (c) 2025, Adrian Chadd <adrian@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* Driver for Qualcomm IPQ4018 clock and reset device */
+/* Driver for Qualcomm clock/reset trees */
#include <sys/param.h>
#include <sys/kernel.h>
@@ -49,19 +49,29 @@
#include "clkdev_if.h"
#include "hwreset_if.h"
-#include <dt-bindings/clock/qcom,gcc-ipq4019.h>
+#include "qcom_gcc_var.h"
+#include "qcom_gcc_ipq4018.h"
-#include "qcom_gcc_ipq4018_var.h"
+static int qcom_gcc_modevent(module_t, int, void *);
+static int qcom_gcc_probe(device_t);
+static int qcom_gcc_attach(device_t);
+static int qcom_gcc_detach(device_t);
-static int qcom_gcc_ipq4018_modevent(module_t, int, void *);
+struct qcom_gcc_chipset_list_entry {
+ const char *ofw;
+ const char *desc;
+ qcom_gcc_chipset_t chipset;
+};
-static int qcom_gcc_ipq4018_probe(device_t);
-static int qcom_gcc_ipq4018_attach(device_t);
-static int qcom_gcc_ipq4018_detach(device_t);
+static struct qcom_gcc_chipset_list_entry qcom_gcc_chipset_list[] = {
+ { "qcom,gcc-ipq4019", "Qualcomm IPQ4018 Clock/Reset Controller",
+ QCOM_GCC_CHIPSET_IPQ4018 },
+ { NULL, NULL, 0 },
+};
static int
-qcom_gcc_ipq4018_modevent(module_t mod, int type, void *unused)
+qcom_gcc_modevent(module_t mod, int type, void *unused)
{
int error;
@@ -81,37 +91,64 @@ qcom_gcc_ipq4018_modevent(module_t mod, int type, void *unused)
}
static int
-qcom_gcc_ipq4018_probe(device_t dev)
+qcom_gcc_probe(device_t dev)
{
+ struct qcom_gcc_softc *sc;
+ int i;
+
+ sc = device_get_softc(dev);
+
if (! ofw_bus_status_okay(dev))
return (ENXIO);
- if (ofw_bus_is_compatible(dev, "qcom,gcc-ipq4019") == 0)
- return (ENXIO);
+ for (i = 0; qcom_gcc_chipset_list[i].ofw != NULL; i++) {
+ const struct qcom_gcc_chipset_list_entry *ce;
- return (0);
+ ce = &qcom_gcc_chipset_list[i];
+ if (ofw_bus_is_compatible(dev, ce->ofw) == 0)
+ continue;
+ device_set_desc(dev, ce->desc);
+ sc->sc_chipset = ce->chipset;
+ return (0);
+ }
+
+ return (ENXIO);
}
static int
-qcom_gcc_ipq4018_attach(device_t dev)
+qcom_gcc_attach(device_t dev)
{
- struct qcom_gcc_ipq4018_softc *sc;
+ struct qcom_gcc_softc *sc;
+ size_t mem_sz;
sc = device_get_softc(dev);
/* Found a compatible device! */
sc->dev = dev;
+ /*
+ * Setup the hardware callbacks, before any further initialisation
+ * is performed.
+ */
+ switch (sc->sc_chipset) {
+ case QCOM_GCC_CHIPSET_IPQ4018:
+ qcom_gcc_ipq4018_hwreset_init(sc);
+ mem_sz = 0x60000;
+ break;
+ case QCOM_GCC_CHIPSET_NONE:
+ device_printf(dev, "Invalid chipset (%d)\n", sc->sc_chipset);
+ return (ENXIO);
+ }
+
sc->reg_rid = 0;
+
sc->reg = bus_alloc_resource_anywhere(dev, SYS_RES_MEMORY,
- &sc->reg_rid, 0x60000, RF_ACTIVE);
+ &sc->reg_rid, mem_sz, RF_ACTIVE);
if (sc->reg == NULL) {
device_printf(dev, "Couldn't allocate memory resource!\n");
return (ENXIO);
}
- device_set_desc(dev, "Qualcomm IPQ4018 Clock/Reset Controller");
-
mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF);
/*
@@ -122,15 +159,22 @@ qcom_gcc_ipq4018_attach(device_t dev)
/*
* Setup and register as a clock provider.
*/
- qcom_gcc_ipq4018_clock_setup(sc);
+ switch (sc->sc_chipset) {
+ case QCOM_GCC_CHIPSET_IPQ4018:
+ qcom_gcc_ipq4018_clock_setup(sc);
+ break;
+ case QCOM_GCC_CHIPSET_NONE:
+ device_printf(dev, "Invalid chipset (%d)\n", sc->sc_chipset);
+ return (ENXIO);
+ }
return (0);
}
static int
-qcom_gcc_ipq4018_detach(device_t dev)
+qcom_gcc_detach(device_t dev)
{
- struct qcom_gcc_ipq4018_softc *sc;
+ struct qcom_gcc_softc *sc;
sc = device_get_softc(dev);
@@ -145,34 +189,34 @@ qcom_gcc_ipq4018_detach(device_t dev)
return (0);
}
-static device_method_t qcom_gcc_ipq4018_methods[] = {
+static device_method_t qcom_gcc_methods[] = {
/* Device methods. */
- DEVMETHOD(device_probe, qcom_gcc_ipq4018_probe),
- DEVMETHOD(device_attach, qcom_gcc_ipq4018_attach),
- DEVMETHOD(device_detach, qcom_gcc_ipq4018_detach),
+ DEVMETHOD(device_probe, qcom_gcc_probe),
+ DEVMETHOD(device_attach, qcom_gcc_attach),
+ DEVMETHOD(device_detach, qcom_gcc_detach),
/* Reset interface */
- DEVMETHOD(hwreset_assert, qcom_gcc_ipq4018_hwreset_assert),
- DEVMETHOD(hwreset_is_asserted, qcom_gcc_ipq4018_hwreset_is_asserted),
+ DEVMETHOD(hwreset_assert, qcom_gcc_hwreset_assert),
+ DEVMETHOD(hwreset_is_asserted, qcom_gcc_hwreset_is_asserted),
/* Clock interface */
- DEVMETHOD(clkdev_read_4, qcom_gcc_ipq4018_clock_read),
- DEVMETHOD(clkdev_write_4, qcom_gcc_ipq4018_clock_write),
- DEVMETHOD(clkdev_modify_4, qcom_gcc_ipq4018_clock_modify),
- DEVMETHOD(clkdev_device_lock, qcom_gcc_ipq4018_clock_lock),
- DEVMETHOD(clkdev_device_unlock, qcom_gcc_ipq4018_clock_unlock),
+ DEVMETHOD(clkdev_read_4, qcom_gcc_clock_read),
+ DEVMETHOD(clkdev_write_4, qcom_gcc_clock_write),
+ DEVMETHOD(clkdev_modify_4, qcom_gcc_clock_modify),
+ DEVMETHOD(clkdev_device_lock, qcom_gcc_clock_lock),
+ DEVMETHOD(clkdev_device_unlock, qcom_gcc_clock_unlock),
DEVMETHOD_END
};
-static driver_t qcom_gcc_ipq4018_driver = {
+static driver_t qcom_gcc_driver = {
"qcom_gcc",
- qcom_gcc_ipq4018_methods,
- sizeof(struct qcom_gcc_ipq4018_softc)
+ qcom_gcc_methods,
+ sizeof(struct qcom_gcc_softc)
};
-EARLY_DRIVER_MODULE(qcom_gcc_ipq4018, simplebus, qcom_gcc_ipq4018_driver,
- qcom_gcc_ipq4018_modevent, NULL, BUS_PASS_CPU + BUS_PASS_ORDER_EARLY);
-EARLY_DRIVER_MODULE(qcom_gcc_ipq4018, ofwbus, qcom_gcc_ipq4018_driver,
- qcom_gcc_ipq4018_modevent, NULL, BUS_PASS_CPU + BUS_PASS_ORDER_EARLY);
-MODULE_VERSION(qcom_gcc_ipq4018, 1);
+EARLY_DRIVER_MODULE(qcom_gcc, simplebus, qcom_gcc_driver,
+ qcom_gcc_modevent, NULL, BUS_PASS_CPU + BUS_PASS_ORDER_EARLY);
+EARLY_DRIVER_MODULE(qcom_gcc, ofwbus, qcom_gcc_driver,
+ qcom_gcc_modevent, NULL, BUS_PASS_CPU + BUS_PASS_ORDER_EARLY);
+MODULE_VERSION(qcom_gcc, 1);
diff --git a/sys/dev/qcom_gcc/qcom_gcc_reset.c b/sys/dev/qcom_gcc/qcom_gcc_reset.c
new file mode 100644
index 000000000000..05ea817fbcc4
--- /dev/null
+++ b/sys/dev/qcom_gcc/qcom_gcc_reset.c
@@ -0,0 +1,64 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2021, Adrian Chadd <adrian@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/sglist.h>
+#include <sys/random.h>
+#include <sys/stdatomic.h>
+#include <sys/mutex.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include <dev/hwreset/hwreset.h>
+
+#include "hwreset_if.h"
+
+#include "qcom_gcc_var.h"
+
+int
+qcom_gcc_hwreset_assert(device_t dev, intptr_t id, bool reset)
+{
+ struct qcom_gcc_softc *sc = device_get_softc(dev);
+ return (sc->sc_cb.hw_reset_assert(dev, id, reset));
+}
+
+int
+qcom_gcc_hwreset_is_asserted(device_t dev, intptr_t id, bool *reset)
+{
+ struct qcom_gcc_softc *sc = device_get_softc(dev);
+
+ return (sc->sc_cb.hw_reset_is_asserted(dev, id, reset));
+}
diff --git a/sys/dev/qcom_gcc/qcom_gcc_ipq4018_var.h b/sys/dev/qcom_gcc/qcom_gcc_var.h
index b3c54f1a7f73..2d4e969e1134 100644
--- a/sys/dev/qcom_gcc/qcom_gcc_ipq4018_var.h
+++ b/sys/dev/qcom_gcc/qcom_gcc_var.h
@@ -25,41 +25,56 @@
* SUCH DAMAGE.
*/
-#ifndef __QCOM_GCC_IPQ4018_VAR_H__
-#define __QCOM_GCC_IPQ4018_VAR_H__
+#ifndef __QCOM_GCC_VAR_H__
+#define __QCOM_GCC_VAR_H__
-struct qcom_gcc_ipq4018_reset_entry {
+typedef enum {
+ QCOM_GCC_CHIPSET_NONE = 0,
+ QCOM_GCC_CHIPSET_IPQ4018 = 1,
+} qcom_gcc_chipset_t;
+
+struct qcom_gcc_reset_entry {
uint32_t reg;
uint32_t bit;
};
-struct qcom_gcc_ipq4018_softc {
+struct qcom_gcc_hw_callbacks {
+ /* Reset block */
+ int (*hw_reset_assert)(device_t, intptr_t, bool);
+ int (*hw_reset_is_asserted)(device_t, intptr_t, bool *);
+
+ /* Clock block */
+};
+
+struct qcom_gcc_softc {
device_t dev;
int reg_rid;
struct resource *reg;
struct mtx mtx;
struct clkdom *clkdom;
+ qcom_gcc_chipset_t sc_chipset;
+ struct qcom_gcc_hw_callbacks sc_cb;
};
/*
* reset block
*/
-extern int qcom_gcc_ipq4018_hwreset_assert(device_t dev, intptr_t id,
+extern int qcom_gcc_hwreset_assert(device_t dev, intptr_t id,
bool reset);
-extern int qcom_gcc_ipq4018_hwreset_is_asserted(device_t dev, intptr_t id,
+extern int qcom_gcc_hwreset_is_asserted(device_t dev, intptr_t id,
bool *reset);
/*
* clock block
*/
-extern int qcom_gcc_ipq4018_clock_read(device_t dev, bus_addr_t addr,
+extern int qcom_gcc_clock_read(device_t dev, bus_addr_t addr,
uint32_t *val);
-extern int qcom_gcc_ipq4018_clock_write(device_t dev, bus_addr_t addr,
+extern int qcom_gcc_clock_write(device_t dev, bus_addr_t addr,
uint32_t val);
-extern int qcom_gcc_ipq4018_clock_modify(device_t dev, bus_addr_t addr,
+extern int qcom_gcc_clock_modify(device_t dev, bus_addr_t addr,
uint32_t clear_mask, uint32_t set_mask);
-extern void qcom_gcc_ipq4018_clock_setup(struct qcom_gcc_ipq4018_softc *sc);
-extern void qcom_gcc_ipq4018_clock_lock(device_t dev);
-extern void qcom_gcc_ipq4018_clock_unlock(device_t dev);
+extern void qcom_gcc_clock_setup(struct qcom_gcc_softc *sc);
+extern void qcom_gcc_clock_lock(device_t dev);
+extern void qcom_gcc_clock_unlock(device_t dev);
-#endif /* __QCOM_GCC_IPQ4018_VAR_H__ */
+#endif /* __QCOM_GCC_VAR_H__ */
diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c
index 1fdeeaae2a96..aa84d3970698 100644
--- a/sys/dev/virtio/p9fs/virtio_p9fs.c
+++ b/sys/dev/virtio/p9fs/virtio_p9fs.c
@@ -488,7 +488,7 @@ vt9p_modevent(module_t mod, int type, void *unused)
return (error);
}
-DRIVER_MODULE(virtio_p9fs, virtio_pci, vt9p_drv, vt9p_modevent, 0);
+VIRTIO_DRIVER_MODULE(virtio_p9fs, vt9p_drv, vt9p_modevent, NULL);
MODULE_VERSION(virtio_p9fs, 1);
MODULE_DEPEND(virtio_p9fs, virtio, 1, 1, 1);
MODULE_DEPEND(virtio_p9fs, p9fs, 1, 1, 1);
diff --git a/sys/dts/arm/qcom-ipq4018-rt-ac58u.dts b/sys/dts/arm/qcom-ipq4018-rt-ac58u.dts
index baaa4c2e9d5f..9000bb95155e 100644
--- a/sys/dts/arm/qcom-ipq4018-rt-ac58u.dts
+++ b/sys/dts/arm/qcom-ipq4018-rt-ac58u.dts
@@ -67,10 +67,10 @@
qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
};
- usb3@8af8800 {
+ usb@8af8800 {
status = "okay";
- dwc3@8a00000 {
+ usb@8a00000 {
#address-cells = <1>;
#size-cells = <0>;
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 37be0b762579..1237f6b92cdb 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -443,7 +443,7 @@ tmpfs_set_reserve_from_percent(void)
}
SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, memory_percent,
- CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &tmpfs_mem_percent, 0,
+ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, &tmpfs_mem_percent, 0,
sysctl_mem_percent, "I",
"Percent of available memory that can be used if no size limit");
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c
index 37c0bd49490f..5dd07fbf77d1 100644
--- a/sys/kern/kern_jail.c
+++ b/sys/kern/kern_jail.c
@@ -4018,6 +4018,11 @@ prison_priv_check(struct ucred *cred, int priv)
case PRIV_PROC_SETRLIMIT:
/*
+ * Debuggers should work in jails.
+ */
+ case PRIV_PROC_MEM_WRITE:
+
+ /*
* System V and POSIX IPC privileges are granted in jail.
*/
case PRIV_IPC_READ:
diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c
index e862816c4613..cbd32d13248a 100644
--- a/sys/kern/kern_ktr.c
+++ b/sys/kern/kern_ktr.c
@@ -251,9 +251,12 @@ SYSCTL_PROC(_debug_ktr, OID_AUTO, entries,
#ifdef KTR_VERBOSE
int ktr_verbose = KTR_VERBOSE;
-TUNABLE_INT("debug.ktr.verbose", &ktr_verbose);
-SYSCTL_INT(_debug_ktr, OID_AUTO, verbose, CTLFLAG_RW, &ktr_verbose, 0, "");
+#else
+int ktr_verbose = 0;
#endif
+TUNABLE_INT("debug.ktr.verbose", &ktr_verbose);
+SYSCTL_INT(_debug_ktr, OID_AUTO, verbose, CTLFLAG_RWTUN, &ktr_verbose, 0,
+ "Print extra info when logging to the console");
#ifdef KTR_ALQ
struct alq *ktr_alq;
@@ -375,7 +378,6 @@ ktr_tracepoint(uint64_t mask, const char *file, int line, const char *format,
file += 3;
entry->ktr_file = file;
entry->ktr_line = line;
-#ifdef KTR_VERBOSE
if (ktr_verbose) {
#ifdef SMP
printf("cpu%d ", cpu);
@@ -387,7 +389,6 @@ ktr_tracepoint(uint64_t mask, const char *file, int line, const char *format,
printf(format, arg1, arg2, arg3, arg4, arg5, arg6);
printf("\n");
}
-#endif
entry->ktr_desc = format;
entry->ktr_parms[0] = arg1;
entry->ktr_parms[1] = arg2;
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 0b76e633b04a..879220be050b 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1142,6 +1142,9 @@ malloc_usable_size(const void *addr)
case SLAB_COOKIE_MALLOC_LARGE:
size = malloc_large_size(slab);
break;
+ case SLAB_COOKIE_CONTIG_MALLOC:
+ size = round_page(contigmalloc_size(slab));
+ break;
default:
__assert_unreachable();
size = 0;
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 8cf8e7b19c89..46226cc31980 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -516,7 +516,7 @@ sysctl_register_oid(struct sysctl_oid *oidp)
/* check for non-auto OID number collision */
if (oidp->oid_number >= 0 && oidp->oid_number < CTL_AUTO_START &&
oid_number >= CTL_AUTO_START) {
- printf("sysctl: OID number(%d) is already in use for '%s'\n",
+ panic("sysctl: OID number(%d) is already in use for '%s'\n",
oidp->oid_number, oidp->oid_name);
}
/* update the OID number, if any */
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index b4016e9dd6bf..7004e4f1c6ea 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -481,7 +481,10 @@ shm_write(struct file *fp, struct uio *uio, struct ucred *active_cred,
struct shmfd *shmfd;
void *rl_cookie;
int error;
- off_t size;
+ off_t newsize;
+
+ KASSERT((flags & FOF_OFFSET) == 0 || uio->uio_offset >= 0,
+ ("%s: negative offset", __func__));
shmfd = fp->f_data;
#ifdef MAC
@@ -503,21 +506,23 @@ shm_write(struct file *fp, struct uio *uio, struct ucred *active_cred,
return (EFBIG);
}
- size = shmfd->shm_size;
+ newsize = atomic_load_64(&shmfd->shm_size);
} else {
- size = uio->uio_offset + uio->uio_resid;
+ newsize = uio->uio_offset + uio->uio_resid;
}
if ((flags & FOF_OFFSET) == 0)
rl_cookie = shm_rangelock_wlock(shmfd, 0, OFF_MAX);
else
- rl_cookie = shm_rangelock_wlock(shmfd, uio->uio_offset, size);
+ rl_cookie = shm_rangelock_wlock(shmfd, uio->uio_offset,
+ MAX(newsize, uio->uio_offset));
if ((shmfd->shm_seals & F_SEAL_WRITE) != 0) {
error = EPERM;
} else {
error = 0;
if ((shmfd->shm_flags & SHM_GROW_ON_WRITE) != 0 &&
- size > shmfd->shm_size) {
- error = shm_dotruncate_cookie(shmfd, size, rl_cookie);
+ newsize > shmfd->shm_size) {
+ error = shm_dotruncate_cookie(shmfd, newsize,
+ rl_cookie);
}
if (error == 0)
error = uiomove_object(shmfd->shm_object,
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 1a3400a87eeb..3f1462d354fd 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1151,6 +1151,61 @@ sys_openat(struct thread *td, struct openat_args *uap)
}
/*
+ * Validate open(2) flags and convert access mode flags (O_RDONLY etc.) to their
+ * in-kernel representations (FREAD etc.).
+ */
+static int
+openflags(int *flagsp)
+{
+ int flags;
+
+ /*
+ * Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR flags
+ * may be specified. On the other hand, for O_PATH any mode
+ * except O_EXEC is ignored.
+ */
+ flags = *flagsp;
+ if ((flags & O_PATH) != 0) {
+ flags &= ~O_ACCMODE;
+ } else if ((flags & O_EXEC) != 0) {
+ if ((flags & O_ACCMODE) != 0)
+ return (EINVAL);
+ } else if ((flags & O_ACCMODE) == O_ACCMODE) {
+ return (EINVAL);
+ } else {
+ flags = FFLAGS(flags);
+ }
+ *flagsp = flags;
+ return (0);
+}
+
+static void
+finit_open(struct file *fp, struct vnode *vp, int flags)
+{
+ /*
+ * Store the vnode, for any f_type. Typically, the vnode use count is
+ * decremented by a direct call to vnops.fo_close() for files that
+ * switched type.
+ */
+ fp->f_vnode = vp;
+
+ /*
+ * If the file wasn't claimed by devfs or fifofs, bind it to the normal
+ * vnode operations here.
+ */
+ if (fp->f_ops == &badfileops) {
+ KASSERT(vp->v_type != VFIFO || (flags & O_PATH) != 0,
+ ("Unexpected fifo fp %p vp %p", fp, vp));
+ if ((flags & O_PATH) != 0) {
+ finit(fp, (flags & FMASK) | (fp->f_flag & FKQALLOWED),
+ DTYPE_VNODE, NULL, &path_fileops);
+ } else {
+ finit_vnode(fp, flags, NULL, &vnops);
+ }
+ }
+}
+
+/*
* If fpp != NULL, opened file is not installed into the file
* descriptor table, instead it is returned in *fpp. This is
* incompatible with fdopen(), in which case we return EINVAL.
@@ -1179,21 +1234,9 @@ openatfp(struct thread *td, int dirfd, const char *path,
cap_rights_init_one(&rights, CAP_LOOKUP);
flags_to_rights(flags, &rights);
- /*
- * Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR flags
- * may be specified. On the other hand, for O_PATH any mode
- * except O_EXEC is ignored.
- */
- if ((flags & O_PATH) != 0) {
- flags &= ~O_ACCMODE;
- } else if ((flags & O_EXEC) != 0) {
- if (flags & O_ACCMODE)
- return (EINVAL);
- } else if ((flags & O_ACCMODE) == O_ACCMODE) {
- return (EINVAL);
- } else {
- flags = FFLAGS(flags);
- }
+ error = openflags(&flags);
+ if (error != 0)
+ return (error);
/*
* Allocate a file structure. The descriptor to reference it
@@ -1244,28 +1287,7 @@ openatfp(struct thread *td, int dirfd, const char *path,
NDFREE_PNBUF(&nd);
vp = nd.ni_vp;
- /*
- * Store the vnode, for any f_type. Typically, the vnode use
- * count is decremented by direct call to vn_closefile() for
- * files that switched type in the cdevsw fdopen() method.
- */
- fp->f_vnode = vp;
-
- /*
- * If the file wasn't claimed by devfs bind it to the normal
- * vnode operations here.
- */
- if (fp->f_ops == &badfileops) {
- KASSERT(vp->v_type != VFIFO || (flags & O_PATH) != 0,
- ("Unexpected fifo fp %p vp %p", fp, vp));
- if ((flags & O_PATH) != 0) {
- finit(fp, (flags & FMASK) | (fp->f_flag & FKQALLOWED),
- DTYPE_VNODE, NULL, &path_fileops);
- } else {
- finit_vnode(fp, flags, NULL, &vnops);
- }
- }
-
+ finit_open(fp, vp, flags);
VOP_UNLOCK(vp);
if (flags & O_TRUNC) {
error = fo_truncate(fp, 0, td->td_ucred, td);
@@ -4653,21 +4675,22 @@ kern_fhopen(struct thread *td, const struct fhandle *u_fhp, int flags)
struct vnode *vp;
struct fhandle fhp;
struct file *fp;
- int fmode, error;
- int indx;
+ int error, indx;
bool named_attr;
error = priv_check(td, PRIV_VFS_FHOPEN);
if (error != 0)
return (error);
+
indx = -1;
- fmode = FFLAGS(flags);
- /* why not allow a non-read/write open for our lockd? */
- if (((fmode & (FREAD | FWRITE)) == 0) || (fmode & O_CREAT))
+ if ((flags & O_CREAT) != 0)
return (EINVAL);
+ error = openflags(&flags);
+ if (error != 0)
+ return (error);
error = copyin(u_fhp, &fhp, sizeof(fhp));
if (error != 0)
- return(error);
+ return (error);
/* find the mount point */
mp = vfs_busyfs(&fhp.fh_fsid);
if (mp == NULL)
@@ -4685,8 +4708,8 @@ kern_fhopen(struct thread *td, const struct fhandle *u_fhp, int flags)
*/
named_attr = (vn_irflag_read(vp) &
(VIRF_NAMEDDIR | VIRF_NAMEDATTR)) != 0;
- if ((named_attr && (fmode & O_NAMEDATTR) == 0) ||
- (!named_attr && (fmode & O_NAMEDATTR) != 0)) {
+ if ((named_attr && (flags & O_NAMEDATTR) == 0) ||
+ (!named_attr && (flags & O_NAMEDATTR) != 0)) {
vput(vp);
return (ENOATTR);
}
@@ -4696,15 +4719,13 @@ kern_fhopen(struct thread *td, const struct fhandle *u_fhp, int flags)
vput(vp);
return (error);
}
- /*
- * An extra reference on `fp' has been held for us by
- * falloc_noinstall().
- */
+ /* Set the flags early so the finit in devfs can pick them up. */
+ fp->f_flag = flags & FMASK;
#ifdef INVARIANTS
td->td_dupfd = -1;
#endif
- error = vn_open_vnode(vp, fmode, td->td_ucred, td, fp);
+ error = vn_open_vnode(vp, flags, td->td_ucred, td, fp);
if (error != 0) {
KASSERT(fp->f_ops == &badfileops,
("VOP_OPEN in fhopen() set f_ops"));
@@ -4717,16 +4738,15 @@ kern_fhopen(struct thread *td, const struct fhandle *u_fhp, int flags)
#ifdef INVARIANTS
td->td_dupfd = 0;
#endif
- fp->f_vnode = vp;
- finit_vnode(fp, fmode, NULL, &vnops);
+ finit_open(fp, vp, flags);
VOP_UNLOCK(vp);
- if ((fmode & O_TRUNC) != 0) {
+ if ((flags & O_TRUNC) != 0) {
error = fo_truncate(fp, 0, td->td_ucred, td);
if (error != 0)
goto bad;
}
- error = finstall(td, fp, &indx, fmode, NULL);
+ error = finstall(td, fp, &indx, flags, NULL);
bad:
fdrop(fp, td);
td->td_retval[0] = indx;
@@ -5076,6 +5096,15 @@ kern_copy_file_range(struct thread *td, int infd, off_t *inoffp, int outfd,
goto out;
/*
+ * Make sure that the ranges we check and lock below are valid. Note
+ * that len is clamped to SSIZE_MAX above.
+ */
+ if (inoff < 0 || outoff < 0) {
+ error = EINVAL;
+ goto out;
+ }
+
+ /*
* If infp and outfp refer to the same file, the byte ranges cannot
* overlap.
*/
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index c448d62e9920..4a369559111e 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -432,6 +432,9 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred,
accmode_t accmode;
int error;
+ KASSERT((fmode & O_PATH) == 0 || (fmode & O_ACCMODE) == 0,
+ ("%s: O_PATH and O_ACCMODE are mutually exclusive", __func__));
+
if (vp->v_type == VLNK) {
if ((fmode & O_PATH) == 0 || (fmode & FEXEC) != 0)
return (EMLINK);
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 71193e3559be..1608e47891e1 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -196,7 +196,6 @@ SUBDIR= \
${_iwi} \
${_iwifw} \
${_iwlwifi} \
- ${_iwlwififw} \
${_iwm} \
${_iwn} \
${_iwnfw} \
@@ -571,9 +570,6 @@ _mlx5ib= mlx5ib
_ena= ena
_gve= gve
_iwlwifi= iwlwifi
-.if ${MK_SOURCELESS_UCODE} != "no"
-_iwlwififw= iwlwififw
-.endif
_rtw88= rtw88
_rtw89= rtw89
_vmware= vmware
diff --git a/sys/modules/dtb/qcom/Makefile b/sys/modules/dtb/qcom/Makefile
new file mode 100644
index 000000000000..7a70e823a2e1
--- /dev/null
+++ b/sys/modules/dtb/qcom/Makefile
@@ -0,0 +1,4 @@
+.if ${MACHINE_ARCH} == "aarch64"
+DTS= qcom/x1e78100-lenovo-thinkpad-t14s.dts
+.endif
+.include <bsd.dtb.mk>
diff --git a/sys/modules/i2c/controllers/Makefile b/sys/modules/i2c/controllers/Makefile
index 2faf6d51a2ba..0d58e305ffef 100644
--- a/sys/modules/i2c/controllers/Makefile
+++ b/sys/modules/i2c/controllers/Makefile
@@ -6,5 +6,8 @@ SUBDIR += imcsmb
.if ${MACHINE_CPUARCH} == "riscv"
SUBDIR += iicoc
.endif
+.if ${MACHINE_CPUARCH} == "aarch64"
+SUBDIR += geni_iic
+.endif
.include <bsd.subdir.mk>
diff --git a/sys/modules/i2c/controllers/geni_iic/Makefile b/sys/modules/i2c/controllers/geni_iic/Makefile
new file mode 100644
index 000000000000..c2f4a7cc7b11
--- /dev/null
+++ b/sys/modules/i2c/controllers/geni_iic/Makefile
@@ -0,0 +1,10 @@
+.PATH: ${SRCTOP}/sys/dev/iicbus/controller/qcom
+
+KMOD= geni_iic
+
+SRCS= geni_iic.c geni_iic_var.h
+SRCS+= geni_iic_acpi.c acpi_if.h
+SRCS+= device_if.h bus_if.h iicbus_if.h
+SRCS+= opt_acpi.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/Makefile b/sys/modules/iwlwififw/Makefile
deleted file mode 100644
index dcecb2072d0c..000000000000
--- a/sys/modules/iwlwififw/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-SUBDIR= \
- iwlwifi-3160-fw \
- iwlwifi-3168-fw \
- iwlwifi-7260-fw \
- iwlwifi-7265-fw \
- iwlwifi-7265D-fw \
- iwlwifi-8000C-fw \
- iwlwifi-8265-fw \
- iwlwifi-9000-pu-b0-jf-b0-fw \
- iwlwifi-9260-th-b0-jf-b0-fw \
- iwlwifi-Qu-b0-hr-b0-fw \
- iwlwifi-Qu-b0-jf-b0-fw \
- iwlwifi-Qu-c0-hr-b0-fw \
- iwlwifi-Qu-c0-jf-b0-fw \
- iwlwifi-QuZ-a0-hr-b0-fw \
- iwlwifi-QuZ-a0-jf-b0-fw \
- iwlwifi-cc-a0-fw \
- iwlwifi-gl-c0-fm-c0-fw \
- iwlwifi-gl-c0-fm-c0-pnvm \
- iwlwifi-so-a0-gf-a0-fw \
- iwlwifi-so-a0-gf4-a0-fw \
- iwlwifi-so-a0-hr-b0-fw \
- iwlwifi-so-a0-jf-b0-fw \
- iwlwifi-ty-a0-gf-a0-fw \
- iwlwifi-so-a0-gf-a0-pnvm \
- iwlwifi-so-a0-gf4-a0-pnvm \
- iwlwifi-ty-a0-gf-a0-pnvm
-
-
-.include <bsd.subdir.mk>
diff --git a/sys/modules/iwlwififw/Makefile.inc b/sys/modules/iwlwififw/Makefile.inc
deleted file mode 100644
index 1fe51a087f58..000000000000
--- a/sys/modules/iwlwififw/Makefile.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-# Common rules for building iwlwifi firmware.
-
-EXT?= ucode
-_NAME?= iwlwifi-${NAME}-${FWVERSION}.${EXT}
-
-IMG= ${_NAME}
-KMOD= ${_NAME}
-
-CLEANFILES+= ${IMG}
-
-FIRMWS= ${IMG}:${IMG}:${FWVERSION}
-
-# License ack is not needed for iwlwifi (same as iwn/iwm).
-#FIRMWARE_LICENSE=
-
-${IMG}: ${SRCTOP}/sys/contrib/dev/iwlwififw/${IMG}
- cp ${.ALLSRC} ${.TARGET}
-
diff --git a/sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile
deleted file mode 100644
index 22817a070537..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 17
-NAME= 3160
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile
deleted file mode 100644
index 8f5ab6a15110..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 29
-NAME= 3168
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile
deleted file mode 100644
index d18dca802cba..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 17
-NAME= 7260
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile
deleted file mode 100644
index 3058f7e26d2e..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 17
-NAME= 7265
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile
deleted file mode 100644
index 30d1788fa0bf..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 29
-NAME= 7265D
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile
deleted file mode 100644
index d0e9113028be..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 36
-NAME= 8000C
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile
deleted file mode 100644
index 344c76d69db0..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 36
-NAME= 8265
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile
deleted file mode 100644
index 4475367933e5..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 46
-NAME= 9000-pu-b0-jf-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile
deleted file mode 100644
index b33ac5a53f7b..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 46
-NAME= 9260-th-b0-jf-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile
deleted file mode 100644
index d991ff20e099..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= Qu-b0-hr-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile
deleted file mode 100644
index 2876476060bc..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= Qu-b0-jf-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile
deleted file mode 100644
index dc3f899e52ce..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= Qu-c0-hr-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile
deleted file mode 100644
index 3d8ab9d436ae..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= Qu-c0-jf-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile
deleted file mode 100644
index 387813717cd5..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= QuZ-a0-hr-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile
deleted file mode 100644
index b4198a3068b9..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= QuZ-a0-jf-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile
deleted file mode 100644
index b6949c29c30d..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= cc-a0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile
deleted file mode 100644
index e44c7c406e82..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 83
-NAME= gl-c0-fm-c0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile
deleted file mode 100644
index 4fc1b42284d1..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-FWVERSION= 83
-NAME= gl-c0-fm-c0
-EXT= pnvm
-_NAME= iwlwifi-${NAME}.${EXT}
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile
deleted file mode 100644
index 5c1d26d1e8c9..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 83
-NAME= so-a0-gf-a0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile
deleted file mode 100644
index bf14a597c5b4..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-FWVERSION= 83
-NAME= so-a0-gf-a0
-EXT= pnvm
-_NAME= iwlwifi-${NAME}.${EXT}
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile
deleted file mode 100644
index c75525c620e9..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 83
-NAME= so-a0-gf4-a0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile
deleted file mode 100644
index 49eae25d5e5d..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-FWVERSION= 83
-NAME= so-a0-gf4-a0
-EXT= pnvm
-_NAME= iwlwifi-${NAME}.${EXT}
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile
deleted file mode 100644
index 4c056fcfd3c4..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 81
-NAME= so-a0-hr-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile
deleted file mode 100644
index 1ffc42d0ea13..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 77
-NAME= so-a0-jf-b0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile
deleted file mode 100644
index 032c3a9d2171..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-FWVERSION= 83
-NAME= ty-a0-gf-a0
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile
deleted file mode 100644
index 83a7b625d64a..000000000000
--- a/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-FWVERSION= 83
-NAME= ty-a0-gf-a0
-EXT= pnvm
-_NAME= iwlwifi-${NAME}.${EXT}
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/lindebugfs/Makefile b/sys/modules/lindebugfs/Makefile
index 90713a634b4b..44041011b407 100644
--- a/sys/modules/lindebugfs/Makefile
+++ b/sys/modules/lindebugfs/Makefile
@@ -14,6 +14,7 @@ EXPORT_SYMS+= debugfs_create_file
EXPORT_SYMS+= debugfs_create_file_size
EXPORT_SYMS+= debugfs_create_file_unsafe
EXPORT_SYMS+= debugfs_create_mode_unsafe
+EXPORT_SYMS+= debugfs_create_str
EXPORT_SYMS+= debugfs_create_symlink
EXPORT_SYMS+= debugfs_create_u8
EXPORT_SYMS+= debugfs_create_u16
@@ -24,6 +25,7 @@ EXPORT_SYMS+= debugfs_create_x8
EXPORT_SYMS+= debugfs_create_x16
EXPORT_SYMS+= debugfs_create_x32
EXPORT_SYMS+= debugfs_create_x64
+EXPORT_SYMS+= debugfs_lookup
EXPORT_SYMS+= debugfs_remove
EXPORT_SYMS+= debugfs_remove_recursive
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 263f241bcf5f..a347dbe2eb73 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1110,13 +1110,15 @@ bpfread(struct cdev *dev, struct uio *uio, int ioflag)
error = bpf_uiomove(d, d->bd_hbuf, d->bd_hlen, uio);
BPFD_LOCK(d);
- KASSERT(d->bd_hbuf != NULL, ("bpfread: lost bd_hbuf"));
- d->bd_fbuf = d->bd_hbuf;
- d->bd_hbuf = NULL;
- d->bd_hlen = 0;
- bpf_buf_reclaimed(d);
- d->bd_hbuf_in_use = 0;
- wakeup(&d->bd_hbuf_in_use);
+ if (d->bd_hbuf_in_use) {
+ KASSERT(d->bd_hbuf != NULL, ("bpfread: lost bd_hbuf"));
+ d->bd_fbuf = d->bd_hbuf;
+ d->bd_hbuf = NULL;
+ d->bd_hlen = 0;
+ bpf_buf_reclaimed(d);
+ d->bd_hbuf_in_use = 0;
+ wakeup(&d->bd_hbuf_in_use);
+ }
BPFD_UNLOCK(d);
return (error);
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index c67f1efe3d88..b5a863641de7 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -57,6 +57,7 @@
#include <net/if_types.h>
#include <net/if_llc.h>
#include <net/if_media.h>
+#include <net/if_bridgevar.h>
#include <net/vnet.h>
#include <netinet/in.h>
@@ -2059,6 +2060,7 @@ bstp_reinit(struct bstp_state *bs)
mif = NULL;
bridgeptr = LIST_FIRST(&bs->bs_bplist)->bp_ifp->if_bridge;
KASSERT(bridgeptr != NULL, ("Invalid bridge pointer"));
+ KASSERT(bridge_same_p != NULL, ("if_bridge not loaded"));
/*
* Search through the Ethernet adapters and find the one with the
* lowest value. Make sure the adapter which we take the MAC address
@@ -2070,7 +2072,7 @@ bstp_reinit(struct bstp_state *bs)
if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN)
continue; /* Not Ethernet */
- if (ifp->if_bridge != bridgeptr)
+ if (!bridge_same_p(ifp->if_bridge, bridgeptr))
continue; /* Not part of our bridge */
if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0)
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 5cb4a033e325..0dd261e6529b 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -238,12 +238,15 @@
#define BRIDGE_RT_LOCK_OR_NET_EPOCH_ASSERT(_sc) \
MPASS(in_epoch(net_epoch_preempt) || mtx_owned(&(_sc)->sc_rt_mtx))
+struct bridge_softc;
+
/*
* Bridge interface list entry.
*/
struct bridge_iflist {
CK_LIST_ENTRY(bridge_iflist) bif_next;
struct ifnet *bif_ifp; /* member if */
+ struct bridge_softc *bif_sc; /* parent bridge */
struct bstp_port bif_stp; /* STP state */
uint32_t bif_flags; /* member if flags */
int bif_savedcaps; /* saved capabilities */
@@ -314,6 +317,8 @@ static void bridge_set_ifcap(struct bridge_softc *, struct bridge_iflist *,
static void bridge_ifdetach(void *arg __unused, struct ifnet *);
static void bridge_init(void *);
static void bridge_dummynet(struct mbuf *, struct ifnet *);
+static bool bridge_same(const void *, const void *);
+static void *bridge_get_softc(struct ifnet *);
static void bridge_stop(struct ifnet *, int);
static int bridge_transmit(struct ifnet *, struct mbuf *);
#ifdef ALTQ
@@ -419,7 +424,7 @@ static void bridge_linkcheck(struct bridge_softc *sc);
* to indicate untagged frames.
*/
#define VLANTAGOF(_m) \
- (_m->m_flags & M_VLANTAG) ? EVL_VLANOFTAG(_m->m_pkthdr.ether_vtag) : DOT1Q_VID_NULL
+ ((_m->m_flags & M_VLANTAG) ? EVL_VLANOFTAG(_m->m_pkthdr.ether_vtag) : DOT1Q_VID_NULL)
static struct bstp_cb_ops bridge_ops = {
.bcb_state = bridge_state_change,
@@ -658,6 +663,8 @@ bridge_modevent(module_t mod, int type, void *data)
switch (type) {
case MOD_LOAD:
bridge_dn_p = bridge_dummynet;
+ bridge_same_p = bridge_same;
+ bridge_get_softc_p = bridge_get_softc;
bridge_detach_cookie = EVENTHANDLER_REGISTER(
ifnet_departure_event, bridge_ifdetach, NULL,
EVENTHANDLER_PRI_ANY);
@@ -666,6 +673,8 @@ bridge_modevent(module_t mod, int type, void *data)
EVENTHANDLER_DEREGISTER(ifnet_departure_event,
bridge_detach_cookie);
bridge_dn_p = NULL;
+ bridge_same_p = NULL;
+ bridge_get_softc_p = NULL;
break;
default:
return (EOPNOTSUPP);
@@ -741,6 +750,43 @@ bridge_reassign(struct ifnet *ifp, struct vnet *newvnet, char *arg)
#endif
/*
+ * bridge_get_softc:
+ *
+ * Return the bridge softc for an ifnet.
+ */
+static void *
+bridge_get_softc(struct ifnet *ifp)
+{
+ struct bridge_iflist *bif;
+
+ NET_EPOCH_ASSERT();
+
+ bif = ifp->if_bridge;
+ if (bif == NULL)
+ return (NULL);
+ return (bif->bif_sc);
+}
+
+/*
+ * bridge_same:
+ *
+ * Return true if two interfaces are in the same bridge. This is only used by
+ * bridgestp via bridge_same_p.
+ */
+static bool
+bridge_same(const void *bifap, const void *bifbp)
+{
+ const struct bridge_iflist *bifa = bifap, *bifb = bifbp;
+
+ NET_EPOCH_ASSERT();
+
+ if (bifa == NULL || bifb == NULL)
+ return (false);
+
+ return (bifa->bif_sc == bifb->bif_sc);
+}
+
+/*
* bridge_clone_create:
*
* Create a new bridge instance.
@@ -1116,16 +1162,8 @@ bridge_lookup_member(struct bridge_softc *sc, const char *name)
static struct bridge_iflist *
bridge_lookup_member_if(struct bridge_softc *sc, struct ifnet *member_ifp)
{
- struct bridge_iflist *bif;
-
BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(sc);
-
- CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
- if (bif->bif_ifp == member_ifp)
- return (bif);
- }
-
- return (NULL);
+ return (member_ifp->if_bridge);
}
static void
@@ -1257,11 +1295,13 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
if (ifs == bif->bif_ifp)
return (EBUSY);
- if (ifs->if_bridge == sc)
- return (EEXIST);
+ if (ifs->if_bridge) {
+ struct bridge_iflist *sbif = ifs->if_bridge;
+ if (sbif->bif_sc == sc)
+ return (EEXIST);
- if (ifs->if_bridge != NULL)
return (EBUSY);
+ }
switch (ifs->if_type) {
case IFT_ETHER:
@@ -1336,6 +1376,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
if (bif == NULL)
return (ENOMEM);
+ bif->bif_sc = sc;
bif->bif_ifp = ifs;
bif->bif_flags = IFBIF_LEARNING | IFBIF_DISCOVER;
bif->bif_savedcaps = ifs->if_capenable;
@@ -1352,7 +1393,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp);
}
- ifs->if_bridge = sc;
+ ifs->if_bridge = bif;
ifs->if_bridge_output = bridge_output;
ifs->if_bridge_input = bridge_input;
ifs->if_bridge_linkstate = bridge_linkstate;
@@ -1979,8 +2020,11 @@ bridge_ioctl_stxhc(struct bridge_softc *sc, void *arg)
static void
bridge_ifdetach(void *arg __unused, struct ifnet *ifp)
{
- struct bridge_softc *sc = ifp->if_bridge;
- struct bridge_iflist *bif;
+ struct bridge_iflist *bif = ifp->if_bridge;
+ struct bridge_softc *sc = NULL;
+
+ if (bif)
+ sc = bif->bif_sc;
if (ifp->if_flags & IFF_RENAMING)
return;
@@ -1994,11 +2038,7 @@ bridge_ifdetach(void *arg __unused, struct ifnet *ifp)
/* Check if the interface is a bridge member */
if (sc != NULL) {
BRIDGE_LOCK(sc);
-
- bif = bridge_lookup_member_if(sc, ifp);
- if (bif != NULL)
- bridge_delete_member(sc, bif, 1);
-
+ bridge_delete_member(sc, bif, 1);
BRIDGE_UNLOCK(sc);
return;
}
@@ -2136,9 +2176,11 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m)
static void
bridge_dummynet(struct mbuf *m, struct ifnet *ifp)
{
- struct bridge_softc *sc;
+ struct bridge_iflist *bif = ifp->if_bridge;
+ struct bridge_softc *sc = NULL;
- sc = ifp->if_bridge;
+ if (bif)
+ sc = bif->bif_sc;
/*
* The packet didnt originate from a member interface. This should only
@@ -2175,6 +2217,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
struct rtentry *rt)
{
struct ether_header *eh;
+ struct bridge_iflist *sbif;
struct ifnet *bifp, *dst_if;
struct bridge_softc *sc;
uint16_t vlan;
@@ -2187,12 +2230,13 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
return (0);
}
+ sbif = ifp->if_bridge;
+ sc = sbif->bif_sc;
+ bifp = sc->sc_ifp;
+
eh = mtod(m, struct ether_header *);
- sc = ifp->if_bridge;
vlan = VLANTAGOF(m);
- bifp = sc->sc_ifp;
-
/*
* If bridge is down, but the original output interface is up,
* go ahead and send out that interface. Otherwise, the packet
@@ -2503,7 +2547,7 @@ drop:
static struct mbuf *
bridge_input(struct ifnet *ifp, struct mbuf *m)
{
- struct bridge_softc *sc;
+ struct bridge_softc *sc = NULL;
struct bridge_iflist *bif, *bif2;
struct ifnet *bifp;
struct ether_header *eh;
@@ -2516,7 +2560,10 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
eh = mtod(m, struct ether_header *);
vlan = VLANTAGOF(m);
- sc = ifp->if_bridge;
+ bif = ifp->if_bridge;
+ if (bif)
+ sc = bif->bif_sc;
+
if (sc == NULL) {
/*
* This packet originated from the bridge itself, so it must
@@ -2553,10 +2600,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
m_freem(m);
return (NULL);
}
- bif = bridge_lookup_member_if(sc, ifp);
- if (bif == NULL) {
- return (m);
- }
bridge_span(sc, m);
@@ -3329,10 +3372,16 @@ bridge_rtnode_destroy(struct bridge_softc *sc, struct bridge_rtnode *brt)
static void
bridge_rtable_expire(struct ifnet *ifp, int age)
{
- struct bridge_softc *sc = ifp->if_bridge;
+ struct bridge_iflist *bif = NULL;
+ struct bridge_softc *sc = NULL;
struct bridge_rtnode *brt;
CURVNET_SET(ifp->if_vnet);
+
+ bif = ifp->if_bridge;
+ if (bif)
+ sc = bif->bif_sc;
+ MPASS(sc != NULL);
BRIDGE_RT_LOCK(sc);
/*
@@ -3362,7 +3411,8 @@ bridge_rtable_expire(struct ifnet *ifp, int age)
static void
bridge_state_change(struct ifnet *ifp, int state)
{
- struct bridge_softc *sc = ifp->if_bridge;
+ struct bridge_iflist *bif = ifp->if_bridge;
+ struct bridge_softc *sc = bif->bif_sc;
static const char *stpstates[] = {
"disabled",
"listening",
@@ -3877,20 +3927,20 @@ dropit:
static void
bridge_linkstate(struct ifnet *ifp)
{
- struct bridge_softc *sc = ifp->if_bridge;
+ struct bridge_softc *sc = NULL;
struct bridge_iflist *bif;
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
- bif = bridge_lookup_member_if(sc, ifp);
- if (bif == NULL) {
- NET_EPOCH_EXIT(et);
- return;
- }
- bridge_linkcheck(sc);
+ bif = ifp->if_bridge;
+ if (bif)
+ sc = bif->bif_sc;
- bstp_linkstate(&bif->bif_stp);
+ if (sc != NULL) {
+ bridge_linkcheck(sc);
+ bstp_linkstate(&bif->bif_stp);
+ }
NET_EPOCH_EXIT(et);
}
diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h
index 01ac96e8d5b0..048d9fb1a18f 100644
--- a/sys/net/if_bridgevar.h
+++ b/sys/net/if_bridgevar.h
@@ -74,6 +74,9 @@
* Data structure and control definitions for bridge interfaces.
*/
+#ifndef _NET_IF_BRIDGEVAR_H_
+#define _NET_IF_BRIDGEVAR_H_
+
#include <sys/types.h>
#include <sys/callout.h>
#include <sys/queue.h>
@@ -320,5 +323,9 @@ struct ifbpstpconf {
} while (0)
extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *);
+extern bool (*bridge_same_p)(const void *, const void *);
+extern void *(*bridge_get_softc_p)(struct ifnet *);
#endif /* _KERNEL */
+
+#endif /* _NET_IF_BRIDGEVAR_H_ */
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index ddaa94414ca5..2397b5ff2090 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -110,6 +110,8 @@ void (*vlan_input_p)(struct ifnet *, struct mbuf *);
/* if_bridge(4) support */
void (*bridge_dn_p)(struct mbuf *, struct ifnet *);
+bool (*bridge_same_p)(const void *, const void *);
+void *(*bridge_get_softc_p)(struct ifnet *);
/* if_lagg(4) support */
struct mbuf *(*lagg_input_ethernet_p)(struct ifnet *, struct mbuf *);
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index c511d61d6cc1..e3a8412bde73 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -2331,7 +2331,7 @@ extern void pf_unload_vnet_purge(void);
extern void pf_intr(void *);
extern void pf_purge_expired_src_nodes(void);
-extern int pf_unlink_state(struct pf_kstate *);
+extern int pf_remove_state(struct pf_kstate *);
extern int pf_state_insert(struct pfi_kkif *,
struct pfi_kkif *,
struct pf_state_key *,
@@ -2475,7 +2475,7 @@ void pf_normalize_cleanup(void);
int pf_normalize_tcp(struct pf_pdesc *);
void pf_normalize_tcp_cleanup(struct pf_kstate *);
int pf_normalize_tcp_init(struct pf_pdesc *,
- struct tcphdr *, struct pf_state_peer *, struct pf_state_peer *);
+ struct tcphdr *, struct pf_state_peer *);
int pf_normalize_tcp_stateful(struct pf_pdesc *,
u_short *, struct tcphdr *, struct pf_kstate *,
struct pf_state_peer *, struct pf_state_peer *, int *);
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
index 744d69ce3d1d..6b636da9fa2c 100644
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -398,6 +398,21 @@ ieee80211_crypto_newkey(struct ieee80211vap *vap,
flags |= IEEE80211_KEY_SWCRYPT;
}
/*
+ * Check if the software cipher is available; if not then
+ * fail it early.
+ *
+ * Some devices do not support all ciphers in software
+ * (for example they don't support a "raw" data path.)
+ */
+ if ((flags & IEEE80211_KEY_SWCRYPT) &&
+ (ic->ic_sw_cryptocaps & (1<<cipher)) == 0) {
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
+ "%s: no s/w support for cipher %s, rejecting\n",
+ __func__, cip->ic_name);
+ vap->iv_stats.is_crypto_swcipherfail++;
+ return (0);
+ }
+ /*
* Hardware TKIP with software MIC is an important
* combination; we handle it by flagging each key,
* the cipher modules honor it.
@@ -900,3 +915,100 @@ ieee80211_crypto_set_deftxkey(struct ieee80211vap *vap, ieee80211_keyix kid)
vap->iv_update_deftxkey(vap, kid);
}
+
+/**
+ * @brief Calculate the AAD required for this frame for AES-GCM/AES-CCM.
+ *
+ * The contents are described in 802.11-2020 12.5.3.3.3 (Construct AAD)
+ * under AES-CCM and are shared with AES-GCM as covered in 12.5.5.3.3
+ * (Construct AAD) (AES-GCM).
+ *
+ * NOTE: the first two bytes are a 16 bit big-endian length, which are used
+ * by AES-CCM as part of the Adata field (RFC 3610, section 2.2
+ * (Authentication)) to indicate the length of the Adata field itself.
+ * Since this is small and fits in 0xfeff bytes, the length field
+ * uses the two byte big endian option.
+ *
+ * AES-GCM doesn't require the length at the beginning and will need to
+ * skip it.
+ *
+ * TODO: net80211 currently doesn't support negotiating SPP (Signaling
+ * and Payload Protected A-MSDUs) and thus bit 7 of the QoS control field
+ * is always masked.
+ *
+ * TODO: net80211 currently doesn't support DMG (802.11ad) so bit 7
+ * (A-MSDU present) and bit 8 (A-MSDU type) are always masked.
+ *
+ * @param wh 802.11 frame to calculate the AAD over
+ * @param aad AAD (additional authentication data) buffer
+ * @param len The AAD buffer length in bytes.
+ * @returns The number of AAD payload bytes (ignoring the first two
+ * bytes, which are the AAD payload length in big-endian).
+ */
+uint16_t
+ieee80211_crypto_init_aad(const struct ieee80211_frame *wh, uint8_t *aad,
+ int len)
+{
+ uint16_t aad_len;
+
+ memset(aad, 0, len);
+
+ /*
+ * AAD for PV0 MPDUs:
+ *
+ * FC with bits 4..6 and 11..13 masked to zero; 14 is always one
+ * A1 | A2 | A3
+ * SC with bits 4..15 (seq#) masked to zero
+ * A4 (if present)
+ * QC (if present)
+ */
+ aad[0] = 0; /* AAD length >> 8 */
+ /* NB: aad[1] set below */
+ aad[2] = wh->i_fc[0] & 0x8f; /* see above for bitfields */
+ aad[3] = wh->i_fc[1] & 0xc7; /* see above for bitfields */
+ /* mask aad[3] b7 if frame is data frame w/ QoS control field */
+ if (IEEE80211_IS_QOS_ANY(wh))
+ aad[3] &= 0x7f;
+
+ /* NB: we know 3 addresses are contiguous */
+ memcpy(aad + 4, wh->i_addr1, 3 * IEEE80211_ADDR_LEN);
+ aad[22] = wh->i_seq[0] & IEEE80211_SEQ_FRAG_MASK;
+ aad[23] = 0; /* all bits masked */
+ /*
+ * Construct variable-length portion of AAD based
+ * on whether this is a 4-address frame/QOS frame.
+ * We always zero-pad to 32 bytes before running it
+ * through the cipher.
+ */
+ if (IEEE80211_IS_DSTODS(wh)) {
+ IEEE80211_ADDR_COPY(aad + 24,
+ ((const struct ieee80211_frame_addr4 *)wh)->i_addr4);
+ if (IEEE80211_IS_QOS_ANY(wh)) {
+ const struct ieee80211_qosframe_addr4 *qwh4 =
+ (const struct ieee80211_qosframe_addr4 *) wh;
+ /* TODO: SPP A-MSDU / A-MSDU present bit */
+ aad[30] = qwh4->i_qos[0] & 0x0f;/* just priority bits */
+ aad[31] = 0;
+ aad_len = aad[1] = 22 + IEEE80211_ADDR_LEN + 2;
+ } else {
+ *(uint16_t *)&aad[30] = 0;
+ aad_len = aad[1] = 22 + IEEE80211_ADDR_LEN;
+ }
+ } else {
+ if (IEEE80211_IS_QOS_ANY(wh)) {
+ const struct ieee80211_qosframe *qwh =
+ (const struct ieee80211_qosframe*) wh;
+ /* TODO: SPP A-MSDU / A-MSDU present bit */
+ aad[24] = qwh->i_qos[0] & 0x0f; /* just priority bits */
+ aad[25] = 0;
+ aad_len = aad[1] = 22 + 2;
+ } else {
+ *(uint16_t *)&aad[24] = 0;
+ aad_len = aad[1] = 22;
+ }
+ *(uint16_t *)&aad[26] = 0;
+ *(uint32_t *)&aad[28] = 0;
+ }
+
+ return (aad_len);
+}
diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h
index fa0d3fc3272a..89b8b4f9daa4 100644
--- a/sys/net80211/ieee80211_crypto.h
+++ b/sys/net80211/ieee80211_crypto.h
@@ -295,5 +295,10 @@ void ieee80211_notify_replay_failure(struct ieee80211vap *,
uint64_t rsc, int tid);
void ieee80211_notify_michael_failure(struct ieee80211vap *,
const struct ieee80211_frame *, ieee80211_keyix keyix);
+
+/* AAD assembly for CCMP/GCMP. */
+uint16_t ieee80211_crypto_init_aad(const struct ieee80211_frame *,
+ uint8_t *, int);
+
#endif /* defined(__KERNEL__) || defined(_KERNEL) */
#endif /* _NET80211_IEEE80211_CRYPTO_H_ */
diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c
index 87730679c47f..01bc50f885f2 100644
--- a/sys/net80211/ieee80211_crypto_ccmp.c
+++ b/sys/net80211/ieee80211_crypto_ccmp.c
@@ -54,6 +54,9 @@
#define AES_BLOCK_LEN 16
+#define CCMP_128_MIC_LEN 8
+#define CCMP_256_MIC_LEN 16
+
struct ccmp_ctx {
struct ieee80211vap *cc_vap; /* for diagnostics+statistics */
struct ieee80211com *cc_ic;
@@ -74,7 +77,24 @@ static const struct ieee80211_cipher ccmp = {
.ic_cipher = IEEE80211_CIPHER_AES_CCM,
.ic_header = IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN +
IEEE80211_WEP_EXTIVLEN,
- .ic_trailer = IEEE80211_WEP_MICLEN,
+ .ic_trailer = CCMP_128_MIC_LEN,
+ .ic_miclen = 0,
+ .ic_attach = ccmp_attach,
+ .ic_detach = ccmp_detach,
+ .ic_setkey = ccmp_setkey,
+ .ic_setiv = ccmp_setiv,
+ .ic_encap = ccmp_encap,
+ .ic_decap = ccmp_decap,
+ .ic_enmic = ccmp_enmic,
+ .ic_demic = ccmp_demic,
+};
+
+static const struct ieee80211_cipher ccmp_256 = {
+ .ic_name = "AES-CCM-256",
+ .ic_cipher = IEEE80211_CIPHER_AES_CCM_256,
+ .ic_header = IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN +
+ IEEE80211_WEP_EXTIVLEN,
+ .ic_trailer = CCMP_256_MIC_LEN,
.ic_miclen = 0,
.ic_attach = ccmp_attach,
.ic_detach = ccmp_detach,
@@ -121,14 +141,69 @@ ccmp_detach(struct ieee80211_key *k)
}
static int
+ccmp_get_trailer_len(struct ieee80211_key *k)
+{
+ return (k->wk_cipher->ic_trailer);
+}
+
+static int
+ccmp_get_header_len(struct ieee80211_key *k)
+{
+ return (k->wk_cipher->ic_header);
+}
+
+/**
+ * @brief Return the M parameter to use for CCMP block0 initialisation.
+ *
+ * M is defined as the number of bytes in the authentication
+ * field.
+ *
+ * See RFC3610, Section 2 (CCM Mode Specification) for more
+ * information.
+ *
+ * The MIC size is defined in 802.11-2020 12.5.3
+ * (CTR with CBC-MAC Protocol (CCMP)).
+ *
+ * CCM-128 - M=8, MIC is 8 octets.
+ * CCM-256 - M=16, MIC is 16 octets.
+ *
+ * @param key ieee80211_key to calculate M for
+ * @retval the number of bytes in the authentication field
+ */
+static int
+ccmp_get_ccm_m(struct ieee80211_key *k)
+{
+ if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_AES_CCM)
+ return (8);
+ if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_AES_CCM_256)
+ return (16);
+ return (8); /* XXX default */
+}
+
+static int
ccmp_setkey(struct ieee80211_key *k)
{
+ uint32_t keylen;
struct ccmp_ctx *ctx = k->wk_private;
- if (k->wk_keylen != (128/NBBY)) {
+ switch (k->wk_cipher->ic_cipher) {
+ case IEEE80211_CIPHER_AES_CCM:
+ keylen = 128;
+ break;
+ case IEEE80211_CIPHER_AES_CCM_256:
+ keylen = 256;
+ break;
+ default:
+ IEEE80211_DPRINTF(ctx->cc_vap, IEEE80211_MSG_CRYPTO,
+ "%s: Unexpected cipher (%u)",
+ __func__, k->wk_cipher->ic_cipher);
+ return (0);
+ }
+
+ if (k->wk_keylen != (keylen/NBBY)) {
IEEE80211_DPRINTF(ctx->cc_vap, IEEE80211_MSG_CRYPTO,
"%s: Invalid key length %u, expecting %u\n",
- __func__, k->wk_keylen, 128/NBBY);
+ __func__, k->wk_keylen, keylen/NBBY);
return 0;
}
if (k->wk_flags & IEEE80211_KEY_SWENCRYPT)
@@ -187,11 +262,11 @@ ccmp_encap(struct ieee80211_key *k, struct mbuf *m)
/*
* Copy down 802.11 header and add the IV, KeyID, and ExtIV.
*/
- M_PREPEND(m, ccmp.ic_header, IEEE80211_M_NOWAIT);
+ M_PREPEND(m, ccmp_get_header_len(k), IEEE80211_M_NOWAIT);
if (m == NULL)
return 0;
ivp = mtod(m, uint8_t *);
- ovbcopy(ivp + ccmp.ic_header, ivp, hdrlen);
+ ovbcopy(ivp + ccmp_get_header_len(k), ivp, hdrlen);
ivp += hdrlen;
ccmp_setiv(k, ivp);
@@ -290,13 +365,14 @@ finish:
* Copy up 802.11 header and strip crypto bits.
*/
if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) {
- ovbcopy(mtod(m, void *), mtod(m, uint8_t *) + ccmp.ic_header,
+ ovbcopy(mtod(m, void *),
+ mtod(m, uint8_t *) + ccmp_get_header_len(k),
hdrlen);
- m_adj(m, ccmp.ic_header);
+ m_adj(m, ccmp_get_header_len(k));
}
if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MIC_STRIP) == 0)
- m_adj(m, -ccmp.ic_trailer);
+ m_adj(m, -ccmp_get_trailer_len(k));
/*
* Ok to update rsc now.
@@ -332,6 +408,79 @@ xor_block(uint8_t *b, const uint8_t *a, size_t len)
b[i] ^= a[i];
}
+/**
+ * @brief Initialise the AES-CCM nonce flag field in the b0 CCMP block.
+ *
+ * The B_0 block is defined in RFC 3610 section 2.2 (Authentication).
+ * b0[0] is the CCM flags field, so the nonce used for B_0 starts at
+ * b0[1]. Amusingly, b0[1] is also flags, but it's the 802.11 AES-CCM
+ * nonce flags field, NOT the CCM flags field.
+ *
+ * The AES-CCM nonce flags field is defined in 802.11-2020 12.5.3.3.4
+ * (Construct CCM nonce).
+ *
+ * TODO: net80211 currently doesn't support MFP (management frame protection)
+ * and so bit 4 is never set. This routine and ccmp_init_blocks() will
+ * need a pointer to the ieee80211_node or a flag that explicitly states
+ * the frame will be sent w/ MFP encryption / received w/ MFP decryption.
+ *
+ * @param wh the 802.11 header to populate
+ * @param b0 the CCM nonce to update (remembering b0[0] is the CCM
+ * nonce flags, and b0[1] is the AES-CCM nonce flags).
+ */
+static void
+ieee80211_crypto_ccmp_init_nonce_flags(const struct ieee80211_frame *wh,
+ char *b0)
+{
+ if (IEEE80211_IS_DSTODS(wh)) {
+ /*
+ * 802.11-2020 12.5.33.3.4 (Construct CCM nonce) mentions
+ * that the low four bits of this byte are the "MPDU priority."
+ * This is defined in 5.1.1.2 (Determination of UP) and
+ * 5.1.1.3 (Interpretation of Priority Parameter in MAC
+ * service primitives).
+ *
+ * The former says "The QoS facility supports eight priority
+ * values, referred to as UPs. The values a UP may take are
+ * the integer values from 0 to 7 and are identical to the
+ * 802.11D priority tags."
+ *
+ * The latter specifically calls out that "Priority parameter
+ * and TID subfield values 0 to 7 are interpreted aas UPs for
+ * the MSDUs" .. and " .. TID subfield values 8 to 15 specify
+ * TIDs that are TS identifiers (TSIDs)" which are used for
+ * TSPEC. There's a bunch of extra work to be done with frames
+ * received in TIDs 8..15 with no TSPEC, "then the MSDU shall
+ * be sent with priority parameter set to 0."
+ *
+ * All QoS frames (not just QoS data) have TID fields and
+ * thus priorities. However, the code straight up
+ * copies the 4 bit TID field, rather than a 3 bit MPDU
+ * priority value. For now, as net80211 doesn't specifically
+ * support TSPEC negotiation, this likely never gets checked.
+ * However as part of any future TSPEC work, this will likely
+ * need to be looked at and checked with interoperability
+ * with other stacks.
+ */
+ if (IEEE80211_IS_QOS_ANY(wh)) {
+ const struct ieee80211_qosframe_addr4 *qwh4 =
+ (const struct ieee80211_qosframe_addr4 *) wh;
+ b0[1] = qwh4->i_qos[0] & 0x0f; /* prio bits */
+ } else {
+ b0[1] = 0;
+ }
+ } else {
+ if (IEEE80211_IS_QOS_ANY(wh)) {
+ const struct ieee80211_qosframe *qwh =
+ (const struct ieee80211_qosframe *) wh;
+ b0[1] = qwh->i_qos[0] & 0x0f; /* prio bits */
+ } else {
+ b0[1] = 0;
+ }
+ }
+ /* TODO: populate MFP flag */
+}
+
/*
* Host AP crypt: host-based CCMP encryption implementation for Host AP driver
*
@@ -348,19 +497,28 @@ xor_block(uint8_t *b, const uint8_t *a, size_t len)
static void
ccmp_init_blocks(rijndael_ctx *ctx, struct ieee80211_frame *wh,
- u_int64_t pn, size_t dlen,
+ uint32_t m, u_int64_t pn, size_t dlen,
uint8_t b0[AES_BLOCK_LEN], uint8_t aad[2 * AES_BLOCK_LEN],
uint8_t auth[AES_BLOCK_LEN], uint8_t s0[AES_BLOCK_LEN])
{
-#define IS_QOS_DATA(wh) IEEE80211_QOS_HAS_SEQ(wh)
+ /*
+ * Map M parameter to encoding
+ * RFC3610, Section 2 (CCM Mode Specification)
+ */
+ m = (m - 2) / 2;
/* CCM Initial Block:
- * Flag (Include authentication header, M=3 (8-octet MIC),
- * L=1 (2-octet Dlen))
+ *
+ * Flag (Include authentication header,
+ * M=3 or 7 (8 or 16 octet auth field),
+ * L=1 (2-octet Dlen))
+ * Adata=1 (one or more auth blocks present)
* Nonce: 0x00 | A2 | PN
- * Dlen */
- b0[0] = 0x59;
- /* NB: b0[1] set below */
+ * Dlen
+ */
+ b0[0] = 0x40 | 0x01 | (m << 3);
+ /* Init b0[1] (CCM nonce flags) */
+ ieee80211_crypto_ccmp_init_nonce_flags(wh, b0);
IEEE80211_ADDR_COPY(b0 + 2, wh->i_addr2);
b0[8] = pn >> 40;
b0[9] = pn >> 32;
@@ -371,62 +529,8 @@ ccmp_init_blocks(rijndael_ctx *ctx, struct ieee80211_frame *wh,
b0[14] = (dlen >> 8) & 0xff;
b0[15] = dlen & 0xff;
- /* AAD:
- * FC with bits 4..6 and 11..13 masked to zero; 14 is always one
- * A1 | A2 | A3
- * SC with bits 4..15 (seq#) masked to zero
- * A4 (if present)
- * QC (if present)
- */
- aad[0] = 0; /* AAD length >> 8 */
- /* NB: aad[1] set below */
- aad[2] = wh->i_fc[0] & 0x8f; /* XXX magic #s */
- aad[3] = wh->i_fc[1] & 0xc7; /* XXX magic #s */
- /* NB: we know 3 addresses are contiguous */
- memcpy(aad + 4, wh->i_addr1, 3 * IEEE80211_ADDR_LEN);
- aad[22] = wh->i_seq[0] & IEEE80211_SEQ_FRAG_MASK;
- aad[23] = 0; /* all bits masked */
- /*
- * Construct variable-length portion of AAD based
- * on whether this is a 4-address frame/QOS frame.
- * We always zero-pad to 32 bytes before running it
- * through the cipher.
- *
- * We also fill in the priority bits of the CCM
- * initial block as we know whether or not we have
- * a QOS frame.
- */
- if (IEEE80211_IS_DSTODS(wh)) {
- IEEE80211_ADDR_COPY(aad + 24,
- ((struct ieee80211_frame_addr4 *)wh)->i_addr4);
- if (IS_QOS_DATA(wh)) {
- struct ieee80211_qosframe_addr4 *qwh4 =
- (struct ieee80211_qosframe_addr4 *) wh;
- aad[30] = qwh4->i_qos[0] & 0x0f;/* just priority bits */
- aad[31] = 0;
- b0[1] = aad[30];
- aad[1] = 22 + IEEE80211_ADDR_LEN + 2;
- } else {
- *(uint16_t *)&aad[30] = 0;
- b0[1] = 0;
- aad[1] = 22 + IEEE80211_ADDR_LEN;
- }
- } else {
- if (IS_QOS_DATA(wh)) {
- struct ieee80211_qosframe *qwh =
- (struct ieee80211_qosframe*) wh;
- aad[24] = qwh->i_qos[0] & 0x0f; /* just priority bits */
- aad[25] = 0;
- b0[1] = aad[24];
- aad[1] = 22 + 2;
- } else {
- *(uint16_t *)&aad[24] = 0;
- b0[1] = 0;
- aad[1] = 22;
- }
- *(uint16_t *)&aad[26] = 0;
- *(uint32_t *)&aad[28] = 0;
- }
+ /* Init AAD */
+ (void) ieee80211_crypto_init_aad(wh, aad, 2 * AES_BLOCK_LEN);
/* Start with the first block and AAD */
rijndael_encrypt(ctx, b0, auth);
@@ -437,7 +541,6 @@ ccmp_init_blocks(rijndael_ctx *ctx, struct ieee80211_frame *wh,
b0[0] &= 0x07;
b0[14] = b0[15] = 0;
rijndael_encrypt(ctx, b0, s0);
-#undef IS_QOS_DATA
}
#define CCMP_ENCRYPT(_i, _b, _b0, _pos, _e, _len) do { \
@@ -465,14 +568,14 @@ ccmp_encrypt(struct ieee80211_key *key, struct mbuf *m0, int hdrlen)
ctx->cc_vap->iv_stats.is_crypto_ccmp++;
wh = mtod(m, struct ieee80211_frame *);
- data_len = m->m_pkthdr.len - (hdrlen + ccmp.ic_header);
- ccmp_init_blocks(&ctx->cc_aes, wh, key->wk_keytsc,
- data_len, b0, aad, b, s0);
+ data_len = m->m_pkthdr.len - (hdrlen + ccmp_get_header_len(key));
+ ccmp_init_blocks(&ctx->cc_aes, wh, ccmp_get_ccm_m(key),
+ key->wk_keytsc, data_len, b0, aad, b, s0);
i = 1;
- pos = mtod(m, uint8_t *) + hdrlen + ccmp.ic_header;
+ pos = mtod(m, uint8_t *) + hdrlen + ccmp_get_header_len(key);
/* NB: assumes header is entirely in first mbuf */
- space = m->m_len - (hdrlen + ccmp.ic_header);
+ space = m->m_len - (hdrlen + ccmp_get_header_len(key));
for (;;) {
if (space > data_len)
space = data_len;
@@ -580,8 +683,8 @@ ccmp_encrypt(struct ieee80211_key *key, struct mbuf *m0, int hdrlen)
}
done:
/* tack on MIC */
- xor_block(b, s0, ccmp.ic_trailer);
- return m_append(m0, ccmp.ic_trailer, b);
+ xor_block(b, s0, ccmp_get_trailer_len(key));
+ return m_append(m0, ccmp_get_trailer_len(key), b);
}
#undef CCMP_ENCRYPT
@@ -618,14 +721,17 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen
ctx->cc_vap->iv_stats.is_crypto_ccmp++;
wh = mtod(m, struct ieee80211_frame *);
- data_len = m->m_pkthdr.len - (hdrlen + ccmp.ic_header + ccmp.ic_trailer);
- ccmp_init_blocks(&ctx->cc_aes, wh, pn, data_len, b0, aad, a, b);
- m_copydata(m, m->m_pkthdr.len - ccmp.ic_trailer, ccmp.ic_trailer, mic);
- xor_block(mic, b, ccmp.ic_trailer);
+ data_len = m->m_pkthdr.len -
+ (hdrlen + ccmp_get_header_len(key) + ccmp_get_trailer_len(key));
+ ccmp_init_blocks(&ctx->cc_aes, wh, ccmp_get_ccm_m(key), pn,
+ data_len, b0, aad, a, b);
+ m_copydata(m, m->m_pkthdr.len - ccmp_get_trailer_len(key),
+ ccmp_get_trailer_len(key), mic);
+ xor_block(mic, b, ccmp_get_trailer_len(key));
i = 1;
- pos = mtod(m, uint8_t *) + hdrlen + ccmp.ic_header;
- space = m->m_len - (hdrlen + ccmp.ic_header);
+ pos = mtod(m, uint8_t *) + hdrlen + ccmp_get_header_len(key);
+ space = m->m_len - (hdrlen + ccmp_get_header_len(key));
for (;;) {
if (space > data_len)
space = data_len;
@@ -684,7 +790,7 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen
if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MIC_STRIP) != 0)
return (1);
- if (memcmp(mic, a, ccmp.ic_trailer) != 0) {
+ if (memcmp(mic, a, ccmp_get_trailer_len(key)) != 0) {
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2,
"%s", "AES-CCM decrypt failed; MIC mismatch");
vap->iv_stats.is_rx_ccmpmic++;
@@ -698,3 +804,4 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen
* Module glue.
*/
IEEE80211_CRYPTO_MODULE(ccmp, 1);
+IEEE80211_CRYPTO_MODULE_ADD(ccmp_256);
diff --git a/sys/net80211/ieee80211_crypto_gcmp.c b/sys/net80211/ieee80211_crypto_gcmp.c
index 290111235b4e..28e1cc5dab46 100644
--- a/sys/net80211/ieee80211_crypto_gcmp.c
+++ b/sys/net80211/ieee80211_crypto_gcmp.c
@@ -380,90 +380,6 @@ gcmp_demic(struct ieee80211_key *k, struct mbuf *m, int force)
return (1);
}
-/**
- * @brief Calculate the AAD required for this frame for AES-GCM.
- *
- * Note: This code was first copied over from ieee80211_crypto_ccmp.c, so
- * it has some CCMP-isms.
- *
- * NOTE: the first two bytes are a 16 bit big-endian length, which are used
- * by AES-CCM. AES-GCM doesn't require the length at the beginning.
- *
- * @param wh 802.11 frame to calculate the AAD over
- * @param aad AAD buffer, GCM_AAD_LEN bytes
- * @param The AAD length in bytes.
- */
-static int
-gcmp_init_aad(const struct ieee80211_frame *wh, uint8_t *aad)
-{
- int aad_len;
-
- memset(aad, 0, GCM_AAD_LEN);
-
-#define IS_QOS_DATA(wh) IEEE80211_QOS_HAS_SEQ(wh)
- /* AAD:
- * FC with bits 4..6 and 11..13 masked to zero; 14 is always one
- * A1 | A2 | A3
- * SC with bits 4..15 (seq#) masked to zero
- * A4 (if present)
- * QC (if present)
- */
- aad[0] = 0; /* AAD length >> 8 */
- /* NB: aad[1] set below */
-
- /*
- * TODO: go back over this in 802.11-2020 and triple check
- * the AAD assembly with regards to packet flags.
- */
-
- aad[2] = wh->i_fc[0] & 0x8f; /* XXX magic #s */
- /*
- * TODO: 12.5.3.3.3 - bit 14 should always be set; bit 15 masked to 0
- * if QoS control field, unmasked otherwise
- */
- aad[3] = wh->i_fc[1] & 0xc7; /* XXX magic #s */
- /* NB: we know 3 addresses are contiguous */
- memcpy(aad + 4, wh->i_addr1, 3 * IEEE80211_ADDR_LEN);
- aad[22] = wh->i_seq[0] & IEEE80211_SEQ_FRAG_MASK;
- aad[23] = 0; /* all bits masked */
- /*
- * Construct variable-length portion of AAD based
- * on whether this is a 4-address frame/QOS frame.
- * We always zero-pad to 32 bytes before running it
- * through the cipher.
- */
- if (IEEE80211_IS_DSTODS(wh)) {
- IEEE80211_ADDR_COPY(aad + 24,
- ((const struct ieee80211_frame_addr4 *)wh)->i_addr4);
- if (IS_QOS_DATA(wh)) {
- const struct ieee80211_qosframe_addr4 *qwh4 =
- (const struct ieee80211_qosframe_addr4 *) wh;
- aad[30] = qwh4->i_qos[0] & 0x0f;/* just priority bits */
- aad[31] = 0;
- aad_len = aad[1] = 22 + IEEE80211_ADDR_LEN + 2;
- } else {
- *(uint16_t *)&aad[30] = 0;
- aad_len = aad[1] = 22 + IEEE80211_ADDR_LEN;
- }
- } else {
- if (IS_QOS_DATA(wh)) {
- const struct ieee80211_qosframe *qwh =
- (const struct ieee80211_qosframe*) wh;
- aad[24] = qwh->i_qos[0] & 0x0f; /* just priority bits */
- aad[25] = 0;
- aad_len = aad[1] = 22 + 2;
- } else {
- *(uint16_t *)&aad[24] = 0;
- aad_len = aad[1] = 22;
- }
- *(uint16_t *)&aad[26] = 0;
- *(uint32_t *)&aad[28] = 0;
- }
-#undef IS_QOS_DATA
-
- return (aad_len);
-}
-
/*
* Populate the 12 byte / 96 bit IV buffer.
*/
@@ -538,7 +454,7 @@ gcmp_encrypt(struct ieee80211_key *key, struct mbuf *m0, int hdrlen)
}
/* Initialise AAD */
- aad_len = gcmp_init_aad(wh, aad);
+ aad_len = ieee80211_crypto_init_aad(wh, aad, GCM_AAD_LEN);
/* Initialise local Nonce to work on */
/* TODO: rename iv stuff here to nonce */
@@ -629,7 +545,7 @@ gcmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m,
}
/* Initialise AAD */
- aad_len = gcmp_init_aad(wh, aad);
+ aad_len = ieee80211_crypto_init_aad(wh, aad, GCM_AAD_LEN);
/* Initialise local IV copy to work on */
iv_len = gcmp_init_iv(iv, wh, pn);
diff --git a/sys/net80211/ieee80211_ioctl.h b/sys/net80211/ieee80211_ioctl.h
index 6064f586c923..d542d75312b9 100644
--- a/sys/net80211/ieee80211_ioctl.h
+++ b/sys/net80211/ieee80211_ioctl.h
@@ -259,6 +259,7 @@ struct ieee80211_stats {
uint32_t is_rx_gcmpmic; /* rx MIC check failed (GCMP) */
uint32_t is_crypto_gcmp_nomem; /* gcmp crypto failed; no mem */
uint32_t is_crypto_gcmp_nospc; /* gcmp crypto failed; no mbuf space */
+ uint32_t is_crypto_swcipherfail; /* no support for SW cipher */
uint32_t is_spare[5];
};
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index e87192a8a5ae..c83eee04a8dc 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -342,7 +342,7 @@ MALLOC_DECLARE(M_80211_NODE_IE);
#define IEEE80211_NODE_BITS \
"\20\1AUTH\2QOS\3ERP\5PWR_MGT\6AREF\7HT\10HTCOMPAT\11WPS\12TSN" \
"\13AMPDU_RX\14AMPDU_TX\15MIMO_PS\16MIMO_RTS\17RIFS\20SGI20\21SGI40" \
- "\22ASSOCID"
+ "\22ASSOCID\23AMSDU_RX\24AMSDU_TX\25VHT\26LDPC\27UAPSD"
#define IEEE80211_NODE_AID(ni) IEEE80211_AID(ni->ni_associd)
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 4f3ed5e4a3d8..6c52fd22f29e 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -754,7 +754,7 @@ MALLOC_DECLARE(M_80211_VAP);
IEEE80211_FVHT_STBC_TX | IEEE80211_FVHT_STBC_RX)
#define IEEE80211_VFHT_BITS \
- "\20\1VHT\2VHT40\3VHT80\4VHT160\5VHT80P80\6STBC_TX\7STBC_RX"
+ "\20\1VHT\2VHT40\3VHT80\4VHT80P80\5VHT160\6STBC_TX\7STBC_RX"
#define IEEE80211_COM_DETACHED 0x00000001 /* ieee80211_ifdetach called */
#define IEEE80211_COM_REF_ADD 0x00000002 /* add / remove reference */
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 88da1b139b1f..dc6ef343662d 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -56,6 +56,7 @@
#include <net/if_dl.h>
#include <net/if_private.h>
#include <net/if_types.h>
+#include <net/if_bridgevar.h>
#include <net/netisr.h>
#include <net/ethernet.h>
#include <net/route.h>
@@ -832,7 +833,7 @@ in_arpinput(struct mbuf *m)
* when we have clusters of interfaces).
*/
CK_LIST_FOREACH(ia, INADDR_HASH(itaddr.s_addr), ia_hash) {
- if (((bridged && ia->ia_ifp->if_bridge == ifp->if_bridge) ||
+ if (((bridged && bridge_same_p(ia->ia_ifp->if_bridge, ifp->if_bridge)) ||
ia->ia_ifp == ifp) &&
itaddr.s_addr == ia->ia_addr.sin_addr.s_addr &&
(ia->ia_ifa.ifa_carp == NULL ||
@@ -842,7 +843,7 @@ in_arpinput(struct mbuf *m)
}
}
CK_LIST_FOREACH(ia, INADDR_HASH(isaddr.s_addr), ia_hash)
- if (((bridged && ia->ia_ifp->if_bridge == ifp->if_bridge) ||
+ if (((bridged && bridge_same_p(ia->ia_ifp->if_bridge, ifp->if_bridge)) ||
ia->ia_ifp == ifp) &&
isaddr.s_addr == ia->ia_addr.sin_addr.s_addr) {
ifa_ref(&ia->ia_ifa);
@@ -850,7 +851,7 @@ in_arpinput(struct mbuf *m)
}
#define BDG_MEMBER_MATCHES_ARP(addr, ifp, ia) \
- (ia->ia_ifp->if_bridge == ifp->if_softc && \
+ (bridge_get_softc_p(ia->ia_ifp) == ifp->if_softc && \
!bcmp(IF_LLADDR(ia->ia_ifp), IF_LLADDR(ifp), ifp->if_addrlen) && \
addr == ia->ia_addr.sin_addr.s_addr)
/*
diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h
index 8d205ba07cf5..44db466912d0 100644
--- a/sys/netinet/ip.h
+++ b/sys/netinet/ip.h
@@ -33,7 +33,8 @@
#ifndef _NETINET_IP_H_
#define _NETINET_IP_H_
-#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <netinet/in.h>
/*
* Definitions for internet protocol version 4.
diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c
index 5b39c94e0e58..91f8251589e4 100644
--- a/sys/netinet/tcp_hpts.c
+++ b/sys/netinet/tcp_hpts.c
@@ -440,7 +440,7 @@ tcp_hpts_log(struct tcp_hpts_entry *hpts, struct tcpcb *tp, struct timeval *tv,
* 16 bit - cwnd_gain
* 8 bit - bbr_state, bbr_substate, inhpts;
*/
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = hpts->p_nxt_slot;
log.u_bbr.flex2 = hpts->p_cur_slot;
log.u_bbr.flex3 = hpts->p_prev_slot;
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 29a6b431f311..a9b5f5374503 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1453,7 +1453,7 @@ drop:
* is at least 3/8 of the current socket buffer size.
* 3. receive buffer size has not hit maximal automatic size;
*
- * If all of the criteria are met we increaset the socket buffer
+ * If all of the criteria are met, we increase the socket buffer
* by a 1/2 (bounded by the max). This allows us to keep ahead
* of slow-start but also makes it so our peer never gets limited
* by our rwnd which we then open up causing a burst.
diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c
index e9ad05382b81..f540c7d3e70e 100644
--- a/sys/netinet/tcp_log_buf.c
+++ b/sys/netinet/tcp_log_buf.c
@@ -1840,40 +1840,36 @@ retry:
log_buf->tlb_txbuf.tls_sb_ccc = 0;
}
/* Copy values from tp to the log entry. */
-#define COPY_STAT(f) log_buf->tlb_ ## f = tp->f
-#define COPY_STAT_T(f) log_buf->tlb_ ## f = tp->t_ ## f
- COPY_STAT_T(state);
- COPY_STAT_T(starttime);
- COPY_STAT(iss);
- COPY_STAT_T(flags);
- COPY_STAT(snd_una);
- COPY_STAT(snd_max);
- COPY_STAT(snd_cwnd);
- COPY_STAT(snd_nxt);
- COPY_STAT(snd_recover);
- COPY_STAT(snd_wnd);
- COPY_STAT(snd_ssthresh);
- COPY_STAT_T(srtt);
- COPY_STAT_T(rttvar);
- COPY_STAT(rcv_up);
- COPY_STAT(rcv_adv);
- COPY_STAT_T(flags2);
- COPY_STAT(rcv_nxt);
- COPY_STAT(rcv_wnd);
- COPY_STAT_T(dupacks);
- COPY_STAT_T(segqlen);
- COPY_STAT(snd_numholes);
+ log_buf->tlb_state = tp->t_state;
+ log_buf->tlb_starttime = tp->t_starttime;
+ log_buf->tlb_iss = tp->iss;
+ log_buf->tlb_flags = tp->t_flags;
+ log_buf->tlb_snd_una = tp->snd_una;
+ log_buf->tlb_snd_max = tp->snd_max;
+ log_buf->tlb_snd_cwnd = tp->snd_cwnd;
+ log_buf->tlb_snd_nxt = tp->snd_nxt;
+ log_buf->tlb_snd_recover = tp->snd_recover;
+ log_buf->tlb_snd_wnd = tp->snd_wnd;
+ log_buf->tlb_snd_ssthresh = tp->snd_ssthresh;
+ log_buf->tlb_srtt = tp->t_srtt;
+ log_buf->tlb_rttvar = tp->t_rttvar;
+ log_buf->tlb_rcv_up = tp->rcv_up;
+ log_buf->tlb_rcv_adv = tp->rcv_adv;
+ log_buf->tlb_flags2 = tp->t_flags2;
+ log_buf->tlb_rcv_nxt = tp->rcv_nxt;
+ log_buf->tlb_rcv_wnd = tp->rcv_wnd;
+ log_buf->tlb_dupacks = tp->t_dupacks;
+ log_buf->tlb_segqlen = tp->t_segqlen;
+ log_buf->tlb_snd_numholes = tp->snd_numholes;
log_buf->tlb_flex1 = 0;
log_buf->tlb_flex2 = 0;
- COPY_STAT_T(fbyte_in);
- COPY_STAT_T(fbyte_out);
- COPY_STAT(snd_scale);
- COPY_STAT(rcv_scale);
+ log_buf->tlb_fbyte_in = tp->t_fbyte_in;
+ log_buf->tlb_fbyte_out = tp->t_fbyte_out;
+ log_buf->tlb_snd_scale = tp->snd_scale;
+ log_buf->tlb_rcv_scale = tp->rcv_scale;
log_buf->_pad[0] = 0;
log_buf->_pad[1] = 0;
log_buf->_pad[2] = 0;
-#undef COPY_STAT
-#undef COPY_STAT_T
/* Copy stack-specific info. */
if (stackinfo != NULL) {
memcpy(&log_buf->tlb_stackinfo, stackinfo,
@@ -2878,6 +2874,7 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags)
struct timeval tv;
tcp_log_eventspecific_t log;
+ memset(&log, 0, sizeof(log));
microuptime(&tv);
log.u_sf.offset = offset;
log.u_sf.length = nbytes;
diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h
index 9ee2d97d47c2..06b2998b19ed 100644
--- a/sys/netinet/tcp_log_buf.h
+++ b/sys/netinet/tcp_log_buf.h
@@ -60,14 +60,6 @@ struct tcp_log_verbose
uint8_t _pad[4];
} ALIGN_TCP_LOG;
-/* Internal RACK state variables. */
-struct tcp_log_rack
-{
- uint32_t tlr_rack_rtt; /* rc_rack_rtt */
- uint8_t tlr_state; /* Internal RACK state */
- uint8_t _pad[3]; /* Padding */
-};
-
struct tcp_log_bbr {
uint64_t cur_del_rate;
uint64_t delRate;
@@ -126,7 +118,6 @@ struct tcp_log_sendfile {
*/
union tcp_log_stackspecific
{
- struct tcp_log_rack u_rack;
struct tcp_log_bbr u_bbr;
struct tcp_log_sendfile u_sf;
struct tcp_log_raw u_raw; /* "raw" log access */
@@ -185,7 +176,6 @@ struct tcp_log_buffer
uint8_t _pad[3]; /* Padding */
/* Per-stack info */
union tcp_log_stackspecific tlb_stackinfo;
-#define tlb_rack tlb_stackinfo.u_rack
/* The packet */
uint32_t tlb_len; /* The packet's data length */
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index f5bc435890e7..cb4e22401c12 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -684,7 +684,7 @@ out:
struct newreno *ptr;
ptr = ((struct newreno *)tp->t_ccv.cc_data);
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = ptr->beta;
log.u_bbr.flex2 = ptr->beta_ecn;
@@ -2678,7 +2678,7 @@ rack_log_retran_reason(struct tcp_rack *rack, struct rack_sendmap *rsm, uint32_t
*/
return;
}
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = tsused;
log.u_bbr.flex2 = thresh;
log.u_bbr.flex3 = rsm->r_flags;
@@ -2709,7 +2709,7 @@ rack_log_to_start(struct tcp_rack *rack, uint32_t cts, uint32_t to, int32_t slot
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = rack->rc_tp->t_srtt;
log.u_bbr.flex2 = to;
log.u_bbr.flex3 = rack->r_ctl.rc_hpts_flags;
@@ -2752,7 +2752,7 @@ rack_log_to_event(struct tcp_rack *rack, int32_t to_num, struct rack_sendmap *rs
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex8 = to_num;
log.u_bbr.flex1 = rack->r_ctl.rc_rack_min_rtt;
@@ -2792,7 +2792,7 @@ rack_log_map_chg(struct tcpcb *tp, struct tcp_rack *rack,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex8 = flag;
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.cur_del_rate = (uintptr_t)prev;
@@ -2840,7 +2840,7 @@ rack_log_rtt_upd(struct tcpcb *tp, struct tcp_rack *rack, uint32_t t, uint32_t l
if (tcp_bblogging_on(tp)) {
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = t;
log.u_bbr.flex2 = len;
@@ -3013,7 +3013,7 @@ rack_log_progress_event(struct tcp_rack *rack, struct tcpcb *tp, uint32_t tick,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = line;
log.u_bbr.flex2 = tick;
@@ -3042,7 +3042,7 @@ rack_log_type_bbrsnd(struct tcp_rack *rack, uint32_t len, uint32_t slot, uint32_
if (rack_verbose_logging && tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = slot;
if (rack->rack_no_prr)
@@ -3149,7 +3149,7 @@ rack_log_type_just_return(struct tcp_rack *rack, uint32_t cts, uint32_t tlen, ui
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = slot;
log.u_bbr.flex2 = rack->r_ctl.rc_hpts_flags;
@@ -3185,7 +3185,7 @@ rack_log_to_cancel(struct tcp_rack *rack, int32_t hpts_removed, int line, uint32
if (tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = line;
log.u_bbr.flex2 = rack->r_ctl.rc_last_output_to;
@@ -3230,7 +3230,7 @@ rack_log_alt_to_to_cancel(struct tcp_rack *rack,
/* No you can't use 1, its for the real to cancel */
return;
}
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = flex1;
log.u_bbr.flex2 = flex2;
@@ -3255,7 +3255,7 @@ rack_log_to_processing(struct tcp_rack *rack, uint32_t cts, int32_t ret, int32_t
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = timers;
log.u_bbr.flex2 = ret;
log.u_bbr.flex3 = rack->r_ctl.rc_timer_exp;
@@ -3285,7 +3285,7 @@ rack_log_to_prr(struct tcp_rack *rack, int frm, int orig_cwnd, int line)
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = rack->r_ctl.rc_prr_out;
log.u_bbr.flex2 = rack->r_ctl.rc_prr_recovery_fs;
if (rack->rack_no_prr)
@@ -4118,7 +4118,7 @@ rack_log_rtt_shrinks(struct tcp_rack *rack, uint32_t us_cts,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = line;
log.u_bbr.flex2 = rack->r_ctl.rc_time_probertt_starts;
log.u_bbr.flex3 = rack->r_ctl.rc_lower_rtt_us_cts;
@@ -4864,7 +4864,7 @@ rack_log_gp_calc(struct tcp_rack *rack, uint32_t add_part, uint32_t sub_part, ui
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = add_part;
log.u_bbr.flex2 = sub_part;
@@ -5214,7 +5214,7 @@ rack_do_goodput_measurement(struct tcpcb *tp, struct tcp_rack *rack,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = rack->r_ctl.current_round;
log.u_bbr.flex2 = rack->r_ctl.last_rnd_of_gp_rise;
@@ -5250,7 +5250,7 @@ rack_do_goodput_measurement(struct tcpcb *tp, struct tcp_rack *rack,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = rack->r_ctl.current_round;
log.u_bbr.flex2 = (uint32_t)gp_est;
@@ -5533,7 +5533,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, uint32_t th_ack, uint
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = th_ack;
log.u_bbr.flex2 = tp->t_ccv.flags;
@@ -5648,7 +5648,7 @@ rack_post_recovery(struct tcpcb *tp, uint32_t th_ack)
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = th_ack;
log.u_bbr.flex2 = tp->t_ccv.flags;
@@ -6481,7 +6481,7 @@ rack_log_hpts_diag(struct tcp_rack *rack, uint32_t cts,
if (rack_verbose_logging && tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = diag->p_nxt_slot;
log.u_bbr.flex2 = diag->p_cur_slot;
log.u_bbr.flex3 = diag->slot_req;
@@ -6520,7 +6520,7 @@ rack_log_wakeup(struct tcpcb *tp, struct tcp_rack *rack, struct sockbuf *sb, uin
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex1 = sb->sb_flags;
log.u_bbr.flex2 = len;
log.u_bbr.flex3 = sb->sb_state;
@@ -14227,7 +14227,7 @@ rack_log_chg_info(struct tcpcb *tp, struct tcp_rack *rack, uint8_t mod,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex8 = mod;
log.u_bbr.flex1 = flex1;
@@ -15117,7 +15117,7 @@ rack_fini(struct tcpcb *tp, int32_t tcb_is_purged)
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.flex8 = 10;
log.u_bbr.flex1 = rack->r_ctl.rc_num_maps_alloced;
log.u_bbr.flex2 = rack->rc_free_cnt;
@@ -15361,7 +15361,7 @@ rack_log_input_packet(struct tcpcb *tp, struct tcp_rack *rack, struct tcp_ackent
tcp_req = tcp_req_find_req_for_seq(tp, ae->ack);
}
#endif
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr == 0)
log.u_bbr.flex1 = rack->r_ctl.rc_prr_sndcnt;
@@ -15564,7 +15564,7 @@ rack_log_pcm(struct tcp_rack *rack, uint8_t mod, uint32_t flex1, uint32_t flex2,
struct timeval tv;
(void)tcp_get_usecs(&tv);
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_tv_to_usectick(&tv);
log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked);
log.u_bbr.flex8 = mod;
@@ -15647,7 +15647,7 @@ rack_new_round_setup(struct tcpcb *tp, struct tcp_rack *rack, uint32_t high_seq)
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = rack->r_ctl.current_round;
log.u_bbr.flex2 = rack->r_ctl.last_rnd_of_gp_rise;
@@ -16570,7 +16570,7 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th,
tcp_req = tcp_req_find_req_for_seq(tp, th->th_ack);
}
#endif
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr == 0)
log.u_bbr.flex1 = rack->r_ctl.rc_prr_sndcnt;
@@ -17344,7 +17344,7 @@ at_lt_bw:
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.flex1 = rack_bw_multipler;
log.u_bbr.flex2 = len;
@@ -18102,7 +18102,7 @@ rack_log_fsb(struct tcp_rack *rack, struct tcpcb *tp, struct socket *so, uint32_
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = error;
log.u_bbr.flex2 = flags;
@@ -18367,7 +18367,7 @@ rack_log_queue_level(struct tcpcb *tp, struct tcp_rack *rack,
err = in_pcbquery_txrlevel(rack->rc_inp, &p_queue);
err = in_pcbquery_txrtlmt(rack->rc_inp, &p_rate);
#endif
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
log.u_bbr.flex1 = p_rate;
log.u_bbr.flex2 = p_queue;
@@ -18820,7 +18820,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma
counter_u64_add(rack_collapsed_win_rxt, 1);
counter_u64_add(rack_collapsed_win_rxt_bytes, (rsm->r_end - rsm->r_start));
}
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr)
log.u_bbr.flex1 = 0;
@@ -19369,7 +19369,7 @@ again:
if (tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr)
log.u_bbr.flex1 = 0;
@@ -21886,7 +21886,7 @@ send:
if (tcp_bblogging_on(rack->rc_tp)) {
union tcp_log_stackspecific log;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(rack->rc_tp);
if (rack->rack_no_prr)
log.u_bbr.flex1 = 0;
diff --git a/sys/netinet/tcp_stacks/rack_pcm.c b/sys/netinet/tcp_stacks/rack_pcm.c
index 09e90da88895..b0e300847c4a 100644
--- a/sys/netinet/tcp_stacks/rack_pcm.c
+++ b/sys/netinet/tcp_stacks/rack_pcm.c
@@ -241,7 +241,7 @@ skip_ack_accounting:
for (i=0; i<rack->r_ctl.pcm_i.cnt; i++) {
e = &rack->r_ctl.pcm_s[i];
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.timeStamp = tcp_tv_to_usectick(&tv);
log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked);
log.u_bbr.flex8 = 1;
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 34964ed8283c..f3f28f54c459 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2086,7 +2086,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(tp);
log.u_bbr.flex8 = 4;
log.u_bbr.pkts_out = tp->t_maxseg;
@@ -4364,7 +4364,7 @@ tcp_req_log_req_info(struct tcpcb *tp, struct tcp_sendfile_track *req,
union tcp_log_stackspecific log;
struct timeval tv;
- memset(&log.u_bbr, 0, sizeof(log.u_bbr));
+ memset(&log, 0, sizeof(log));
log.u_bbr.inhpts = tcp_in_hpts(tp);
log.u_bbr.flex8 = val;
log.u_bbr.rttProp = req->timestamp;
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index ffbe64f4de80..00a0b40154d2 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -587,7 +587,7 @@ in6_control_ioctl(u_long cmd, void *data,
#endif
error = in6_addifaddr(ifp, ifra, ia);
ia = NULL;
- break;
+ goto out;
case SIOCDIFADDR_IN6:
in6_purgeifaddr(ia);
diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h
index faaeebe52eac..586716776bc5 100644
--- a/sys/netlink/netlink_snl.h
+++ b/sys/netlink/netlink_snl.h
@@ -1327,9 +1327,4 @@ snl_send_msgs(struct snl_writer *nw)
return (snl_send(nw->ss, nw->base, offset));
}
-static const struct snl_hdr_parser *snl_all_core_parsers[] = {
- &snl_errmsg_parser, &snl_donemsg_parser,
- &_nla_bit_parser, &_nla_bitset_parser,
-};
-
#endif
diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h
index acf483ac0243..10e98a0266e0 100644
--- a/sys/netlink/netlink_snl_generic.h
+++ b/sys/netlink/netlink_snl_generic.h
@@ -172,8 +172,4 @@ snl_get_genl_mcast_group(struct snl_state *ss, const char *family_name,
return (0);
}
-static const struct snl_hdr_parser *snl_all_genl_parsers[] = {
- &_genl_ctrl_getfam_parser, &_genl_ctrl_mc_parser,
-};
-
#endif
diff --git a/sys/netlink/netlink_snl_route_parsers.h b/sys/netlink/netlink_snl_route_parsers.h
index 256edfec297d..6b7a8188180d 100644
--- a/sys/netlink/netlink_snl_route_parsers.h
+++ b/sys/netlink/netlink_snl_route_parsers.h
@@ -389,11 +389,4 @@ _cb_p_nh(struct snl_state *ss __unused, void *_target)
SNL_DECLARE_PARSER_EXT(snl_nhmsg_parser, sizeof(struct nhmsg),
sizeof(struct snl_parsed_nhop), _fp_p_nh, _nla_p_nh, _cb_p_nh);
-static const struct snl_hdr_parser *snl_all_route_parsers[] = {
- &_metrics_mp_nh_parser, &_mpath_nh_parser, &_metrics_parser, &snl_rtm_route_parser,
- &_link_fbsd_parser, &snl_rtm_link_parser, &snl_rtm_link_parser_simple,
- &_neigh_fbsd_parser, &snl_rtm_neigh_parser,
- &_addr_fbsd_parser, &snl_rtm_addr_parser, &_nh_fbsd_parser, &snl_nhmsg_parser,
-};
-
#endif
diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index b2aaf3add25c..0795c75e8de0 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -1051,7 +1051,7 @@ relock:
LIST_FOREACH(s, &ih->states, entry) {
if (s->creatorid == creatorid) {
s->state_flags |= PFSTATE_NOSYNC;
- pf_unlink_state(s);
+ pf_remove_state(s);
goto relock;
}
}
@@ -1440,7 +1440,7 @@ pfsync_in_del_c(struct mbuf *m, int offset, int count, int flags, int action)
}
st->state_flags |= PFSTATE_NOSYNC;
- pf_unlink_state(st);
+ pf_remove_state(st);
}
return (len);
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index c343512b20dd..fdd412a92135 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -614,7 +614,7 @@ pf_is_loopback(sa_family_t af, struct pf_addr *addr)
#ifdef INET
case AF_INET:
return IN_LOOPBACK(ntohl(addr->v4.s_addr));
-#endif
+#endif /* INET */
case AF_INET6:
return IN6_IS_ADDR_LOOPBACK(&addr->v6);
default:
@@ -776,7 +776,7 @@ pf_state_hash(struct pf_kstate *s)
hv = 1;
return (hv);
}
-#endif
+#endif /* ALTQ */
static __inline void
pf_set_protostate(struct pf_kstate *s, int which, u_int8_t newstate)
@@ -915,13 +915,13 @@ pf_overload_task(void *v, int pending)
p.pfra_net = 32;
p.pfra_ip4addr = pfoe->addr.v4;
break;
-#endif
+#endif /* INET */
#ifdef INET6
case AF_INET6:
p.pfra_net = 128;
p.pfra_ip6addr = pfoe->addr.v6;
break;
-#endif
+#endif /* INET6 */
default:
unhandled_af(pfoe->af);
}
@@ -1631,7 +1631,7 @@ pf_state_key_detach(struct pf_kstate *s, int idx)
struct pf_keyhash *kh = &V_pf_keyhash[pf_hashkey(sk)];
PF_HASHROW_ASSERT(kh);
-#endif
+#endif /* INVARIANTS */
TAILQ_REMOVE(&sk->states[idx], s, key_list[idx]);
s->key[idx] = NULL;
@@ -1701,7 +1701,7 @@ pf_state_key_addr_setup(struct pf_pdesc *pd,
}
}
copy:
-#endif
+#endif /* INET6 */
if (saddr)
PF_ACPY(&key->addr[pd->sidx], saddr, pd->af);
if (daddr)
@@ -1910,7 +1910,7 @@ pf_find_state(struct pfi_kkif *kif, const struct pf_state_key_cmp *key,
if (__predict_false(s->timeout >= PFTM_MAX)) {
/*
* State is either being processed by
- * pf_unlink_state() in an other thread, or
+ * pf_remove_state() in an other thread, or
* is scheduled for immediate expiry.
*/
PF_STATE_UNLOCK(s);
@@ -1930,7 +1930,7 @@ pf_find_state(struct pfi_kkif *kif, const struct pf_state_key_cmp *key,
if (__predict_false(s->timeout >= PFTM_MAX)) {
/*
* State is either being processed by
- * pf_unlink_state() in an other thread, or
+ * pf_remove_state() in an other thread, or
* is scheduled for immediate expiry.
*/
PF_STATE_UNLOCK(s);
@@ -2169,7 +2169,7 @@ pf_isforlocal(struct mbuf *m, int af)
return (in_localip(ip->ip_dst));
}
-#endif
+#endif /* INET */
#ifdef INET6
case AF_INET6: {
struct ip6_hdr *ip6;
@@ -2180,7 +2180,7 @@ pf_isforlocal(struct mbuf *m, int af)
return (false);
return (! (ia->ia6_flags & IN6_IFF_NOTREADY));
}
-#endif
+#endif /* INET6 */
default:
unhandled_af(af);
}
@@ -2206,6 +2206,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
switch (type) {
case ICMP_ECHO:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP_ECHOREPLY:
*virtual_type = ICMP_ECHO;
*virtual_id = pd->hdr.icmp.icmp_id;
@@ -2213,6 +2214,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
case ICMP_TSTAMP:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP_TSTAMPREPLY:
*virtual_type = ICMP_TSTAMP;
*virtual_id = pd->hdr.icmp.icmp_id;
@@ -2220,6 +2222,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
case ICMP_IREQ:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP_IREQREPLY:
*virtual_type = ICMP_IREQ;
*virtual_id = pd->hdr.icmp.icmp_id;
@@ -2227,6 +2230,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
case ICMP_MASKREQ:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP_MASKREPLY:
*virtual_type = ICMP_MASKREQ;
*virtual_id = pd->hdr.icmp.icmp_id;
@@ -2234,6 +2238,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
case ICMP_IPV6_WHEREAREYOU:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP_IPV6_IAMHERE:
*virtual_type = ICMP_IPV6_WHEREAREYOU;
*virtual_id = 0; /* Nothing sane to match on! */
@@ -2241,6 +2246,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
case ICMP_MOBILE_REGREQUEST:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP_MOBILE_REGREPLY:
*virtual_type = ICMP_MOBILE_REGREQUEST;
*virtual_id = 0; /* Nothing sane to match on! */
@@ -2248,6 +2254,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
case ICMP_ROUTERSOLICIT:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP_ROUTERADVERT:
*virtual_type = ICMP_ROUTERSOLICIT;
*virtual_id = 0; /* Nothing sane to match on! */
@@ -2283,6 +2290,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
switch (type) {
case ICMP6_ECHO_REQUEST:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ICMP6_ECHO_REPLY:
*virtual_type = ICMP6_ECHO_REQUEST;
*virtual_id = pd->hdr.icmp6.icmp6_id;
@@ -2304,6 +2312,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
}
case MLD_MTRACE:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case MLD_MTRACE_RESP:
*virtual_type = MLD_MTRACE;
*virtual_id = 0; /* Nothing sane to match on! */
@@ -2311,6 +2320,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type,
case ND_NEIGHBOR_SOLICIT:
*icmp_dir = PF_IN;
+ /* FALLTHROUGH */
case ND_NEIGHBOR_ADVERT: {
*virtual_type = ND_NEIGHBOR_SOLICIT;
*virtual_id = 0;
@@ -2720,7 +2730,7 @@ pf_src_tree_remove_state(struct pf_kstate *s)
* unlocked, since it needs to go through key hash locking.
*/
int
-pf_unlink_state(struct pf_kstate *s)
+pf_remove_state(struct pf_kstate *s)
{
struct pf_idhash *ih = &V_pf_idhash[PF_IDHASH(s)];
@@ -2730,7 +2740,7 @@ pf_unlink_state(struct pf_kstate *s)
if (s->timeout == PFTM_UNLINKED) {
/*
* State is being processed
- * by pf_unlink_state() in
+ * by pf_remove_state() in
* an other thread.
*/
PF_HASHROW_UNLOCK(ih);
@@ -2827,7 +2837,7 @@ relock:
LIST_FOREACH(s, &ih->states, entry) {
if (pf_state_expires(s) <= time_uptime) {
V_pf_status.states -=
- pf_unlink_state(s);
+ pf_remove_state(s);
goto relock;
}
s->rule->rule_ref |= PFRULE_REFS;
@@ -4367,13 +4377,13 @@ pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af,
if (icmp6_ratelimit(NULL, type, code))
return;
break;
-#endif
+#endif /* INET6 */
#ifdef INET
case AF_INET:
if (badport_bandlim(pf_icmp_to_bandlim(type)) != 0)
return;
break;
-#endif
+#endif /* INET */
}
/* Allocate outgoing queue entry, mbuf and mbuf tag. */
@@ -4958,6 +4968,8 @@ pf_socket_lookup(struct pf_pdesc *pd)
}
break;
#endif /* INET6 */
+ default:
+ unhandled_af(pd->af);
}
INP_RLOCK_ASSERT(inp);
pd->lookup.uid = inp->inp_cred->cr_uid;
@@ -5183,10 +5195,10 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0)
{
#ifdef INET
struct ip ip;
-#endif
+#endif /* INET */
#ifdef INET6
struct ip6_hdr ip6;
-#endif
+#endif /* INET6 */
struct mbuf *m = *m0;
struct ether_header *e;
struct pf_keth_rule *r, *rm, *a = NULL;
@@ -5734,7 +5746,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm,
PF_ACPY(pd->dst, &nk->addr[pd->didx], pd->af);
}
break;
-#endif /* INET */
+#endif /* INET6 */
}
break;
}
@@ -6169,7 +6181,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a,
case IPPROTO_ICMP:
#ifdef INET6
case IPPROTO_ICMPV6:
-#endif
+#endif /* INET6 */
s->timeout = PFTM_ICMP_FIRST_PACKET;
break;
default:
@@ -6182,7 +6194,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a,
if (pd->proto == IPPROTO_TCP) {
if (s->state_flags & PFSTATE_SCRUB_TCP &&
- pf_normalize_tcp_init(pd, th, &s->src, &s->dst)) {
+ pf_normalize_tcp_init(pd, th, &s->src)) {
REASON_SET(&reason, PFRES_MEMORY);
goto csfailed;
}
@@ -6438,7 +6450,7 @@ pf_tcp_track_full(struct pf_kstate *state, struct pf_pdesc *pd,
if ((state->state_flags & PFSTATE_SCRUB_TCP || dst->scrub) &&
src->scrub == NULL) {
- if (pf_normalize_tcp_init(pd, th, src, dst)) {
+ if (pf_normalize_tcp_init(pd, th, src)) {
REASON_SET(reason, PFRES_MEMORY);
return (PF_DROP);
}
@@ -6970,7 +6982,7 @@ pf_test_state(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason)
}
/* XXX make sure it's the same direction ?? */
pf_set_protostate(*state, PF_PEER_BOTH, TCPS_CLOSED);
- pf_unlink_state(*state);
+ pf_remove_state(*state);
*state = NULL;
return (PF_DROP);
}
@@ -7007,7 +7019,7 @@ pf_test_state(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason)
(dst->state >= SCTP_SHUTDOWN_SENT || dst->state == SCTP_CLOSED) &&
pd->sctp_flags & PFDESC_SCTP_INIT) {
pf_set_protostate(*state, PF_PEER_BOTH, SCTP_CLOSED);
- pf_unlink_state(*state);
+ pf_remove_state(*state);
*state = NULL;
return (PF_DROP);
}
@@ -7522,7 +7534,7 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op)
TAILQ_INSERT_TAIL(&pd->sctp_multihome_jobs, job, next);
break;
}
-#endif
+#endif /* INET6 */
case SCTP_ADD_IP_ADDRESS: {
int ret;
struct sctp_asconf_paramhdr ah;
@@ -7640,7 +7652,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
struct pf_state_key_cmp key;
#ifdef INET
u_int16_t icmpid;
-#endif
+#endif /* INET*/
MPASS(*state == NULL);
@@ -7660,7 +7672,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
icmpcode = pd->hdr.icmp6.icmp6_code;
#ifdef INET
icmpid = pd->hdr.icmp6.icmp6_id;
-#endif
+#endif /* INET */
icmpsum = &pd->hdr.icmp6.icmp6_cksum;
break;
#endif /* INET6 */
@@ -7722,7 +7734,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
return (PF_DROP);
pd->proto = IPPROTO_ICMPV6;
}
-#endif
+#endif /* INET6 */
if (!afto &&
PF_ANEQ(pd->src, &nk->addr[sidx], AF_INET))
pf_change_a(&saddr->v4.s_addr,
@@ -7759,7 +7771,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
return (PF_DROP);
pd->proto = IPPROTO_ICMP;
}
-#endif
+#endif /* INET */
if (!afto &&
PF_ANEQ(pd->src, &nk->addr[sidx], AF_INET6))
pf_change_a6(saddr,
@@ -8042,7 +8054,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
pd->naf = nk->af;
return (PF_AFRT);
}
-#endif
+#endif /* INET && INET6 */
if (PF_ANEQ(pd2.src,
&nk->addr[pd2.sidx], pd2.af) ||
@@ -8176,7 +8188,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
pd->naf = nk->af;
return (PF_AFRT);
}
-#endif
+#endif /* INET && INET6 */
if (PF_ANEQ(pd2.src,
&nk->addr[pd2.sidx], pd2.af) ||
@@ -8321,7 +8333,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
pd->naf = nk->af;
return (PF_AFRT);
}
-#endif
+#endif /* INET && INET6 */
if (PF_ANEQ(pd2.src,
&nk->addr[pd2.sidx], pd2.af) ||
@@ -8457,7 +8469,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
pd->naf = nk->af;
return (PF_AFRT);
}
-#endif
+#endif /* INET && INET6 */
if (PF_ANEQ(pd2.src,
&nk->addr[pd2.sidx], pd2.af) ||
@@ -8576,7 +8588,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd,
pd->naf = nk->af;
return (PF_AFRT);
}
-#endif
+#endif /* INET && INET6 */
if (PF_ANEQ(pd2.src,
&nk->addr[pd2.sidx], pd2.af) ||
@@ -8744,12 +8756,12 @@ pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kkif *kif,
case AF_INET6:
return (fib6_check_urpf(rtableid, &addr->v6, 0, NHR_NONE,
ifp));
-#endif
+#endif /* INET6 */
#ifdef INET
case AF_INET:
return (fib4_check_urpf(rtableid, addr->v4, 0, NHR_NONE,
ifp));
-#endif
+#endif /* INET */
}
return (0);
@@ -9592,7 +9604,7 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s,
(
#ifdef INET
(pd->af == AF_INET && IN_LOOPBACK(ntohl(pd->dst->v4.s_addr))) ||
-#endif
+#endif /* INET */
(pd->af == AF_INET6 && IN6_IS_ADDR_LOOPBACK(&pd->dst->v6)))) {
/*
* If we're redirecting to loopback mark this packet
@@ -9799,7 +9811,7 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason)
}
}
}
-#endif
+#endif /* INET6 */
static void
pf_init_pdesc(struct pf_pdesc *pd, struct mbuf *m)
@@ -9879,7 +9891,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0,
break;
}
-#endif
+#endif /* INET */
#ifdef INET6
case AF_INET6: {
struct ip6_hdr *h;
@@ -9965,7 +9977,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0,
break;
}
-#endif
+#endif /* INET6 */
default:
panic("pf_setup_pdesc called with illegal af %u", af);
}
@@ -10081,7 +10093,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0,
pd->pcksum = &pd->hdr.icmp.icmp_cksum;
break;
}
-#endif
+#endif /* INET6 */
}
if (pd->sport)
@@ -10306,7 +10318,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0
*m0 = NULL;
return (PF_DROP);
}
-#endif
+#endif /* INET */
#ifdef INET6
/*
* If we end up changing IP addresses (e.g. binat) the stack may get
@@ -10320,7 +10332,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0
*m0 = NULL;
return (PF_DROP);
}
-#endif
+#endif /* INET6 */
if (__predict_false(ip_divert_ptr != NULL) &&
((mtag = m_tag_locate(pd.m, MTAG_PF_DIVERT, 0, NULL)) != NULL)) {
@@ -10642,11 +10654,11 @@ done:
#ifdef INET
if (pd.naf == AF_INET)
pf_route(m0, r, kif->pfik_ifp, s, &pd, inp);
-#endif
+#endif /* INET */
#ifdef INET6
if (pd.naf == AF_INET6)
pf_route6(m0, r, kif->pfik_ifp, s, &pd, inp);
-#endif
+#endif /* INET6 */
*m0 = NULL;
action = PF_PASS;
goto out;
@@ -10659,13 +10671,13 @@ done:
/* pf_route() returns unlocked. */
pf_route(m0, r, kif->pfik_ifp, s, &pd, inp);
break;
-#endif
+#endif /* INET */
#ifdef INET6
case AF_INET6:
/* pf_route6() returns unlocked. */
pf_route6(m0, r, kif->pfik_ifp, s, &pd, inp);
break;
-#endif
+#endif /* INET6 */
}
goto out;
}
@@ -10696,7 +10708,7 @@ out:
(! (pflags & PF_PFIL_NOREFRAGMENT)) &&
(mtag = m_tag_find(pd.m, PACKET_TAG_PF_REASSEMBLED, NULL)) != NULL)
action = pf_refragment6(ifp, m0, mtag, NULL, pflags & PFIL_FWD);
-#endif
+#endif /* INET6 */
pf_sctp_multihome_delayed(&pd, kif, s, action);
diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c
index 31fc8b152719..389b74d09d37 100644
--- a/sys/netpfil/pf/pf_if.c
+++ b/sys/netpfil/pf/pf_if.c
@@ -86,10 +86,10 @@ static void pfi_attach_ifgroup(struct ifg_group *, struct pfi_kkif *);
static void pfi_kkif_update(struct pfi_kkif *);
static void pfi_dynaddr_update(struct pfi_dynaddr *dyn);
-static void pfi_table_update(struct pfr_ktable *, struct pfi_kkif *, int,
+static void pfi_table_update(struct pfr_ktable *, struct pfi_kkif *, uint8_t,
int);
-static void pfi_instance_add(struct ifnet *, int, int);
-static void pfi_address_add(struct sockaddr *, int, int);
+static void pfi_instance_add(struct ifnet *, uint8_t, int);
+static void pfi_address_add(struct sockaddr *, sa_family_t, uint8_t);
static int pfi_kkif_compare(struct pfi_kkif *, struct pfi_kkif *);
static int pfi_skip_if(const char *, struct pfi_kkif *);
static int pfi_unmask(void *);
@@ -682,7 +682,8 @@ pfi_dynaddr_update(struct pfi_dynaddr *dyn)
}
static void
-pfi_table_update(struct pfr_ktable *kt, struct pfi_kkif *kif, int net, int flags)
+pfi_table_update(struct pfr_ktable *kt, struct pfi_kkif *kif, uint8_t net,
+ int flags)
{
int e, size2 = 0;
struct ifg_member *ifgm;
@@ -705,11 +706,12 @@ pfi_table_update(struct pfr_ktable *kt, struct pfi_kkif *kif, int net, int flags
}
static void
-pfi_instance_add(struct ifnet *ifp, int net, int flags)
+pfi_instance_add(struct ifnet *ifp, uint8_t net, int flags)
{
struct ifaddr *ia;
int got4 = 0, got6 = 0;
- int net2, af;
+ sa_family_t af;
+ uint8_t net2;
NET_EPOCH_ASSERT();
@@ -773,7 +775,7 @@ pfi_instance_add(struct ifnet *ifp, int net, int flags)
}
static void
-pfi_address_add(struct sockaddr *sa, int af, int net)
+pfi_address_add(struct sockaddr *sa, sa_family_t af, uint8_t net)
{
struct pfr_addr *p;
int i;
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 787715412fc2..44da2e156ce2 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -342,7 +342,7 @@ pfattach_vnet(void)
/* default rule should never be garbage collected */
V_pf_default_rule.entries.tqe_prev = &V_pf_default_rule.entries.tqe_next;
V_pf_default_rule.action = V_default_to_drop ? PF_DROP : PF_PASS;
- V_pf_default_rule.nr = -1;
+ V_pf_default_rule.nr = (uint32_t)-1;
V_pf_default_rule.rtableid = -1;
pf_counter_u64_init(&V_pf_default_rule.evaluations, M_WAITOK);
@@ -2296,7 +2296,7 @@ pf_kill_matching_state(struct pf_state_key_cmp *key, int dir)
return (0);
}
- pf_unlink_state(s);
+ pf_remove_state(s);
return (1);
}
@@ -2393,7 +2393,7 @@ relock_DIOCKILLSTATES:
match_key.port[1] = s->key[idx]->port[0];
}
- pf_unlink_state(s);
+ pf_remove_state(s);
killed++;
if (psk->psk_kill_match)
@@ -2571,14 +2571,20 @@ pf_ioctl_add_addr(struct pf_nl_pooladdr *pp)
pp->which != PF_RT)
return (EINVAL);
-#ifndef INET
- if (pp->af == AF_INET)
- return (EAFNOSUPPORT);
+ switch (pp->af) {
+#ifdef INET
+ case AF_INET:
+ /* FALLTHROUGH */
#endif /* INET */
-#ifndef INET6
- if (pp->af == AF_INET6)
- return (EAFNOSUPPORT);
+#ifdef INET6
+ case AF_INET6:
+ /* FALLTHROUGH */
#endif /* INET6 */
+ case AF_UNSPEC:
+ break;
+ default:
+ return (EAFNOSUPPORT);
+ }
if (pp->addr.addr.type != PF_ADDR_ADDRMASK &&
pp->addr.addr.type != PF_ADDR_DYNIFTL &&
@@ -5963,7 +5969,7 @@ relock:
s->timeout = PFTM_PURGE;
/* Don't send out individual delete messages. */
s->state_flags |= PFSTATE_NOSYNC;
- pf_unlink_state(s);
+ pf_remove_state(s);
goto relock;
}
PF_HASHROW_UNLOCK(ih);
@@ -6121,7 +6127,7 @@ relock_DIOCCLRSTATES:
* delete messages.
*/
s->state_flags |= PFSTATE_NOSYNC;
- pf_unlink_state(s);
+ pf_remove_state(s);
killed++;
if (kill->psk_kill_match)
@@ -6150,7 +6156,7 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed)
kill->psk_pfcmp.creatorid = V_pf_status.hostid;
if ((s = pf_find_state_byid(kill->psk_pfcmp.id,
kill->psk_pfcmp.creatorid))) {
- pf_unlink_state(s);
+ pf_remove_state(s);
*killed = 1;
}
return;
diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c
index f0cad4bb43c2..54a9463e34ef 100644
--- a/sys/netpfil/pf/pf_lb.c
+++ b/sys/netpfil/pf/pf_lb.c
@@ -57,11 +57,11 @@
#ifdef INET
#include <netinet/in_var.h>
-#endif
+#endif /* INET */
#ifdef INET6
#include <netinet6/in6_var.h>
-#endif
+#endif /* INET6 */
/*
@@ -94,7 +94,7 @@ pf_hash(struct pf_addr *inaddr, struct pf_addr *hash,
uint64_t hash64;
uint32_t hash32[2];
} h;
-#endif
+#endif /* INET6 */
uint64_t res = 0;
_Static_assert(sizeof(*key) >= SIPHASH_KEY_LENGTH, "");
@@ -122,6 +122,8 @@ pf_hash(struct pf_addr *inaddr, struct pf_addr *hash,
hash->addr32[3] = ~h.hash32[0];
break;
#endif /* INET6 */
+ default:
+ unhandled_af(af);
}
return (res);
}
@@ -497,6 +499,8 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr,
rmask = &rpool->cur->addr.p.dyn->pfid_mask6;
break;
#endif /* INET6 */
+ default:
+ unhandled_af(af);
}
} else if (rpool->cur->addr.type == PF_ADDR_TABLE) {
if (!PF_POOL_DYNTYPE(rpool->opts)) {
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index fd72fec62a3b..2dc4553bd4f4 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -43,6 +43,7 @@
#include <net/if.h>
#include <net/if_var.h>
+#include <net/if_private.h>
#include <net/vnet.h>
#include <net/pfvar.h>
#include <net/if_pflog.h>
@@ -434,7 +435,7 @@ pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent)
{
#ifdef INVARIANTS
struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next);
-#endif
+#endif /* INVARIANTS */
struct pf_frent *next = TAILQ_NEXT(frent, fr_next);
int index;
@@ -1051,7 +1052,13 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag,
dst.sin6_len = sizeof(dst);
dst.sin6_addr = hdr->ip6_dst;
- nd6_output_ifp(rt, rt, m, &dst, NULL);
+ if (m->m_pkthdr.len <= if_getmtu(ifp)) {
+ nd6_output_ifp(rt, rt, m, &dst, NULL);
+ } else {
+ in6_ifstat_inc(ifp, ifs6_in_toobig);
+ icmp6_error(m, ICMP6_PACKET_TOO_BIG, 0,
+ if_getmtu(ifp));
+ }
} else if (forward) {
MPASS(m->m_pkthdr.rcvif != NULL);
ip6_forward(m, 0);
@@ -1429,7 +1436,7 @@ pf_normalize_tcp(struct pf_pdesc *pd)
int
pf_normalize_tcp_init(struct pf_pdesc *pd, struct tcphdr *th,
- struct pf_state_peer *src, struct pf_state_peer *dst)
+ struct pf_state_peer *src)
{
u_int32_t tsval, tsecr;
u_int8_t hdr[60];
@@ -1457,6 +1464,8 @@ pf_normalize_tcp_init(struct pf_pdesc *pd, struct tcphdr *th,
break;
}
#endif /* INET6 */
+ default:
+ unhandled_af(pd->af);
}
/*
@@ -1581,6 +1590,8 @@ pf_normalize_tcp_stateful(struct pf_pdesc *pd,
break;
}
#endif /* INET6 */
+ default:
+ unhandled_af(pd->af);
}
if (th->th_off > (sizeof(struct tcphdr) >> 2) &&
@@ -2200,7 +2211,7 @@ pf_scrub(struct pf_pdesc *pd)
struct ip *h = mtod(pd->m, struct ip *);
#ifdef INET6
struct ip6_hdr *h6 = mtod(pd->m, struct ip6_hdr *);
-#endif
+#endif /* INET6 */
/* Clear IP_DF if no-df was requested */
if (pd->af == AF_INET && pd->act.flags & PFSTATE_NODF &&
@@ -2225,7 +2236,7 @@ pf_scrub(struct pf_pdesc *pd)
if (pd->af == AF_INET6 && pd->act.min_ttl &&
h6->ip6_hlim < pd->act.min_ttl)
h6->ip6_hlim = pd->act.min_ttl;
-#endif
+#endif /* INET6 */
/* Enforce tos */
if (pd->act.flags & PFSTATE_SETTOS) {
switch (pd->af) {
@@ -2244,7 +2255,7 @@ pf_scrub(struct pf_pdesc *pd)
h6->ip6_flow &= IPV6_FLOWLABEL_MASK | IPV6_VERSION_MASK;
h6->ip6_flow |= htonl((pd->act.set_tos | IPV6_ECN(h6)) << 20);
break;
-#endif
+#endif /* INET6 */
}
}
@@ -2257,6 +2268,6 @@ pf_scrub(struct pf_pdesc *pd)
ip_fillid(h, V_ip_random_id);
h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0);
}
-#endif
+#endif /* INET */
}
-#endif
+#endif /* INET || INET6 */
diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index 462b8c3aa782..d5874df3df66 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -791,10 +791,16 @@ pfr_create_kentry(struct pfr_addr *ad, bool counters)
if (ke == NULL)
return (NULL);
- if (ad->pfra_af == AF_INET)
+ switch (ad->pfra_af) {
+ case AF_INET:
FILLIN_SIN(ke->pfrke_sa.sin, ad->pfra_ip4addr);
- else if (ad->pfra_af == AF_INET6)
+ break;
+ case AF_INET6:
FILLIN_SIN6(ke->pfrke_sa.sin6, ad->pfra_ip6addr);
+ break;
+ default:
+ unhandled_af(ad->pfra_af);
+ }
ke->pfrke_af = ad->pfra_af;
ke->pfrke_net = ad->pfra_net;
ke->pfrke_not = ad->pfra_not;
@@ -933,11 +939,13 @@ pfr_prepare_network(union sockaddr_union *sa, int af, int net)
int i;
bzero(sa, sizeof(*sa));
- if (af == AF_INET) {
+ switch (af) {
+ case AF_INET:
sa->sin.sin_len = sizeof(sa->sin);
sa->sin.sin_family = AF_INET;
sa->sin.sin_addr.s_addr = net ? htonl(-1 << (32-net)) : 0;
- } else if (af == AF_INET6) {
+ break;
+ case AF_INET6:
sa->sin6.sin6_len = sizeof(sa->sin6);
sa->sin6.sin6_family = AF_INET6;
for (i = 0; i < 4; i++) {
@@ -949,6 +957,9 @@ pfr_prepare_network(union sockaddr_union *sa, int af, int net)
sa->sin6.sin6_addr.s6_addr32[i] = 0xFFFFFFFF;
net -= 32;
}
+ break;
+ default:
+ unhandled_af(af);
}
}
@@ -1022,10 +1033,16 @@ pfr_copyout_addr(struct pfr_addr *ad, const struct pfr_kentry *ke)
ad->pfra_af = ke->pfrke_af;
ad->pfra_net = ke->pfrke_net;
ad->pfra_not = ke->pfrke_not;
- if (ad->pfra_af == AF_INET)
+ switch (ad->pfra_af) {
+ case AF_INET:
ad->pfra_ip4addr = ke->pfrke_sa.sin.sin_addr;
- else if (ad->pfra_af == AF_INET6)
+ break;
+ case AF_INET6:
ad->pfra_ip6addr = ke->pfrke_sa.sin6.sin6_addr;
+ break;
+ default:
+ unhandled_af(ad->pfra_af);
+ }
}
static void
@@ -1118,18 +1135,23 @@ pfr_walktree(struct radix_node *rn, void *arg)
{
union sockaddr_union pfr_mask;
- if (ke->pfrke_af == AF_INET) {
+ switch (ke->pfrke_af) {
+ case AF_INET:
if (w->pfrw_dyn->pfid_acnt4++ > 0)
break;
pfr_prepare_network(&pfr_mask, AF_INET, ke->pfrke_net);
pfr_sockaddr_to_pf_addr(&ke->pfrke_sa, &w->pfrw_dyn->pfid_addr4);
pfr_sockaddr_to_pf_addr(&pfr_mask, &w->pfrw_dyn->pfid_mask4);
- } else if (ke->pfrke_af == AF_INET6){
+ break;
+ case AF_INET6:
if (w->pfrw_dyn->pfid_acnt6++ > 0)
break;
pfr_prepare_network(&pfr_mask, AF_INET6, ke->pfrke_net);
pfr_sockaddr_to_pf_addr(&ke->pfrke_sa, &w->pfrw_dyn->pfid_addr6);
pfr_sockaddr_to_pf_addr(&pfr_mask, &w->pfrw_dyn->pfid_mask6);
+ break;
+ default:
+ unhandled_af(ke->pfrke_af);
}
break;
}
@@ -2352,6 +2374,8 @@ _next_block:
ke2 = (struct pfr_kentry *)rn_match(&uaddr,
&kt->pfrkt_ip6->rh);
break;
+ default:
+ unhandled_af(af);
}
/* no need to check KENTRY_RNF_ROOT() here */
if (ke2 == ke) {
@@ -2416,8 +2440,18 @@ pfr_dynaddr_update(struct pfr_ktable *kt, struct pfi_dynaddr *dyn)
dyn->pfid_acnt4 = 0;
dyn->pfid_acnt6 = 0;
- if (!dyn->pfid_af || dyn->pfid_af == AF_INET)
+ switch (dyn->pfid_af) {
+ case AF_UNSPEC: /* look up all both addresses IPv4 + IPv6 */
kt->pfrkt_ip4->rnh_walktree(&kt->pfrkt_ip4->rh, pfr_walktree, &w);
- if (!dyn->pfid_af || dyn->pfid_af == AF_INET6)
kt->pfrkt_ip6->rnh_walktree(&kt->pfrkt_ip6->rh, pfr_walktree, &w);
+ break;
+ case AF_INET:
+ kt->pfrkt_ip4->rnh_walktree(&kt->pfrkt_ip4->rh, pfr_walktree, &w);
+ break;
+ case AF_INET6:
+ kt->pfrkt_ip6->rnh_walktree(&kt->pfrkt_ip6->rh, pfr_walktree, &w);
+ break;
+ default:
+ unhandled_af(dyn->pfid_af);
+ }
}
diff --git a/sys/riscv/include/metadata.h b/sys/riscv/include/metadata.h
index ddbad3fae3b4..7f7b763577e3 100644
--- a/sys/riscv/include/metadata.h
+++ b/sys/riscv/include/metadata.h
@@ -33,10 +33,15 @@
#define MODINFOMD_EFI_FB 0x1003
#define MODINFOMD_BOOT_HARTID 0x1004
+/*
+ * This is not the same as the UEFI standard EFI_MEMORY_ATTRIBUTES_TABLE, though
+ * memory_size / descritpr_size entries of EFI_MEMORY_DESCRIPTORS follow this table
+ * starting at a 16-byte alignment.
+ */
struct efi_map_header {
- size_t memory_size;
- size_t descriptor_size;
- uint32_t descriptor_version;
+ size_t memory_size; /* Numnber of bytes that follow */
+ size_t descriptor_size; /* Size of each EFI_MEMORY_DESCRIPTOR */
+ uint32_t descriptor_version; /* Currently '1' */
};
/*
diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c
index fea4ca9a7b92..516dbde5ffaa 100644
--- a/sys/riscv/riscv/machdep.c
+++ b/sys/riscv/riscv/machdep.c
@@ -506,13 +506,46 @@ parse_metadata(void)
return (lastaddr);
}
+#ifdef FDT
+static void
+fdt_physmem_hardware_region_cb(const struct mem_region *mr, void *arg)
+{
+ bool *first = arg;
+
+ physmem_hardware_region(mr->mr_start, mr->mr_size);
+
+ if (*first) {
+ /*
+ * XXX: Unconditionally exclude the lowest 2MB of physical
+ * memory, as this area is assumed to contain the SBI firmware,
+ * and this is not properly reserved in all cases (e.g. in
+ * older firmware like BBL).
+ *
+ * This is a little fragile, but it is consistent with the
+ * platforms we support so far.
+ *
+ * TODO: remove this when the all regular booting methods
+ * properly report their reserved memory in the device tree.
+ */
+ physmem_exclude_region(mr->mr_start, L2_SIZE,
+ EXFLAG_NODUMP | EXFLAG_NOALLOC);
+ *first = false;
+ }
+}
+
+static void
+fdt_physmem_exclude_region_cb(const struct mem_region *mr, void *arg __unused)
+{
+ physmem_exclude_region(mr->mr_start, mr->mr_size,
+ EXFLAG_NODUMP | EXFLAG_NOALLOC);
+}
+#endif
+
void
initriscv(struct riscv_bootparams *rvbp)
{
- struct mem_region mem_regions[FDT_MEM_REGIONS];
struct efi_map_header *efihdr;
struct pcpu *pcpup;
- int mem_regions_sz;
vm_offset_t lastaddr;
vm_size_t kernlen;
char *env;
@@ -547,31 +580,17 @@ initriscv(struct riscv_bootparams *rvbp)
}
#ifdef FDT
else {
+ bool first;
+
/* Exclude reserved memory specified by the device tree. */
- if (fdt_get_reserved_mem(mem_regions, &mem_regions_sz) == 0) {
- physmem_exclude_regions(mem_regions, mem_regions_sz,
- EXFLAG_NODUMP | EXFLAG_NOALLOC);
- }
+ fdt_foreach_reserved_mem(fdt_physmem_exclude_region_cb, NULL);
/* Grab physical memory regions information from device tree. */
- if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, NULL) != 0)
+ first = true;
+ if (fdt_foreach_mem_region(fdt_physmem_hardware_region_cb,
+ &first) != 0)
panic("Cannot get physical memory regions");
- physmem_hardware_regions(mem_regions, mem_regions_sz);
- /*
- * XXX: Unconditionally exclude the lowest 2MB of physical
- * memory, as this area is assumed to contain the SBI firmware,
- * and this is not properly reserved in all cases (e.g. in
- * older firmware like BBL).
- *
- * This is a little fragile, but it is consistent with the
- * platforms we support so far.
- *
- * TODO: remove this when the all regular booting methods
- * properly report their reserved memory in the device tree.
- */
- physmem_exclude_region(mem_regions[0].mr_start, L2_SIZE,
- EXFLAG_NODUMP | EXFLAG_NOALLOC);
}
#endif
diff --git a/sys/sys/param.h b/sys/sys/param.h
index b08a83ccc25b..39f3535a136d 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -73,7 +73,7 @@
* cannot include sys/param.h and should only be updated here.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1500035
+#define __FreeBSD_version 1500037
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
diff --git a/sys/sys/random.h b/sys/sys/random.h
index 67aae93630b5..254ba9451d0a 100644
--- a/sys/sys/random.h
+++ b/sys/sys/random.h
@@ -156,16 +156,18 @@ void random_harvest_deregister_source(enum random_entropy_source);
#define random_harvest_queue_ether(a, b) do {} while (0)
#endif /* defined(RANDOM_ENABLE_ETHER) */
+#else /* !_KERNEL */
+
+#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
+#include <ssp/random.h>
+#endif
+
#endif /* _KERNEL */
#define GRND_NONBLOCK 0x1
#define GRND_RANDOM 0x2
#define GRND_INSECURE 0x4
-#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
-#include <ssp/random.h>
-#endif
-
__BEGIN_DECLS
ssize_t getrandom(void *buf, size_t buflen, unsigned int flags);
__END_DECLS
diff --git a/sys/sys/select.h b/sys/sys/select.h
index fefc9961d63a..691f66b5047d 100644
--- a/sys/sys/select.h
+++ b/sys/sys/select.h
@@ -49,7 +49,7 @@ typedef __fd_mask fd_mask;
typedef __sigset_t sigset_t;
#endif
-#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
+#if !defined(_KERNEL) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
#include <ssp/ssp.h>
#else
#define __SSP_FORTIFY_LEVEL 0
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 064da1cb95be..5e7c554c34cf 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -685,12 +685,12 @@ struct splice {
#endif /* __BSD_VISIBLE */
+#ifndef _KERNEL
+
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
#include <ssp/socket.h>
#endif
-#ifndef _KERNEL
-
#include <sys/cdefs.h>
__BEGIN_DECLS
diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c
index 6ee5076f9a91..ee39221402fa 100644
--- a/sys/vm/phys_pager.c
+++ b/sys/vm/phys_pager.c
@@ -33,6 +33,7 @@
#include <sys/proc.h>
#include <sys/mutex.h>
#include <sys/mman.h>
+#include <sys/pctrie.h>
#include <sys/rwlock.h>
#include <sys/sysctl.h>
#include <sys/user.h>
@@ -230,10 +231,12 @@ default_phys_pager_populate(vm_object_t object, vm_pindex_t pidx,
int fault_type __unused, vm_prot_t max_prot __unused, vm_pindex_t *first,
vm_pindex_t *last)
{
+ struct pctrie_iter pages;
vm_page_t m;
vm_pindex_t base, end, i;
int ahead;
+ VM_OBJECT_ASSERT_WLOCKED(object);
base = rounddown(pidx, phys_pager_cluster);
end = base + phys_pager_cluster - 1;
if (end >= object->size)
@@ -244,10 +247,11 @@ default_phys_pager_populate(vm_object_t object, vm_pindex_t pidx,
end = *last;
*first = base;
*last = end;
+ vm_page_iter_init(&pages, object);
for (i = base; i <= end; i++) {
ahead = MIN(end - i, PHYSALLOC);
- m = vm_page_grab(object, i,
+ m = vm_page_grab_iter(object, &pages, i,
VM_ALLOC_NORMAL | VM_ALLOC_COUNT(ahead));
if (!vm_page_all_valid(m))
vm_page_zero_invalid(m, TRUE);
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 7b83ae4bfb7b..38203e4cd0af 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1935,9 +1935,10 @@ swap_pager_swapoff_object(struct swdevt *sp, vm_object_t object,
if (!vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL))
break;
} else {
- m = vm_radix_iter_lookup_le(&pages,
+ m = vm_radix_iter_lookup_lt(&pages,
blks.index + i);
- m = vm_page_alloc_after(object, blks.index + i,
+ m = vm_page_alloc_after(
+ object, &pages, blks.index + i,
VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL, m);
if (m == NULL)
break;
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 48a7a47e4c59..e1db7ac8b524 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -105,6 +105,7 @@
#include <vm/vm_pageout.h>
#include <vm/vm_kern.h>
#include <vm/vm_pager.h>
+#include <vm/vm_radix.h>
#include <vm/vm_extern.h>
#include <vm/vm_reserv.h>
@@ -1063,14 +1064,14 @@ vm_fault_cow(struct faultstate *fs)
* Oh, well, lets copy it.
*/
pmap_copy_page(fs->m, fs->first_m);
- vm_page_valid(fs->first_m);
if (fs->wired && (fs->fault_flags & VM_FAULT_WIRE) == 0) {
vm_page_wire(fs->first_m);
vm_page_unwire(fs->m, PQ_INACTIVE);
}
/*
- * Save the cow page to be released after
- * pmap_enter is complete.
+ * Save the COW page to be released after pmap_enter is
+ * complete. The new copy will be marked valid when we're ready
+ * to map it.
*/
fs->m_cow = fs->m;
fs->m = NULL;
@@ -1230,7 +1231,7 @@ vm_fault_allocate_oom(struct faultstate *fs)
* Allocate a page directly or via the object populate method.
*/
static enum fault_status
-vm_fault_allocate(struct faultstate *fs)
+vm_fault_allocate(struct faultstate *fs, struct pctrie_iter *pages)
{
struct domainset *dset;
enum fault_status res;
@@ -1291,8 +1292,9 @@ vm_fault_allocate(struct faultstate *fs)
vm_fault_unlock_and_deallocate(fs);
return (FAULT_FAILURE);
}
- fs->m = vm_page_alloc(fs->object, fs->pindex,
- P_KILLED(curproc) ? VM_ALLOC_SYSTEM : 0);
+ fs->m = vm_page_alloc_after(fs->object, pages, fs->pindex,
+ P_KILLED(curproc) ? VM_ALLOC_SYSTEM : 0,
+ vm_radix_iter_lookup_lt(pages, fs->pindex));
}
if (fs->m == NULL) {
if (vm_fault_allocate_oom(fs))
@@ -1459,6 +1461,7 @@ vm_fault_busy_sleep(struct faultstate *fs)
static enum fault_status
vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp)
{
+ struct pctrie_iter pages;
enum fault_status res;
bool dead;
@@ -1484,7 +1487,8 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp)
/*
* See if the page is resident.
*/
- fs->m = vm_page_lookup(fs->object, fs->pindex);
+ vm_page_iter_init(&pages, fs->object);
+ fs->m = vm_radix_iter_lookup(&pages, fs->pindex);
if (fs->m != NULL) {
if (!vm_page_tryxbusy(fs->m)) {
vm_fault_busy_sleep(fs);
@@ -1514,7 +1518,7 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp)
vm_fault_unlock_and_deallocate(fs);
return (FAULT_RESTART);
}
- res = vm_fault_allocate(fs);
+ res = vm_fault_allocate(fs, &pages);
if (res != FAULT_CONTINUE)
return (res);
}
@@ -1549,6 +1553,7 @@ int
vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
int fault_flags, vm_page_t *m_hold)
{
+ struct pctrie_iter pages;
struct faultstate fs;
int ahead, behind, faultcount, rv;
enum fault_status res;
@@ -1603,6 +1608,7 @@ RetryFault:
}
VM_OBJECT_ASSERT_WLOCKED(fs.first_object);
} else {
+ vm_page_iter_init(&pages, fs.first_object);
VM_OBJECT_WLOCK(fs.first_object);
}
@@ -1627,7 +1633,7 @@ RetryFault:
fs.pindex = fs.first_pindex;
if ((fs.entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) != 0) {
- res = vm_fault_allocate(&fs);
+ res = vm_fault_allocate(&fs, &pages);
switch (res) {
case FAULT_RESTART:
goto RetryFault;
@@ -1754,6 +1760,19 @@ found:
fs.entry->next_read = vaddr + ptoa(ahead) + PAGE_SIZE;
/*
+ * If the page to be mapped was copied from a backing object, we defer
+ * marking it valid until here, where the fault handler is guaranteed to
+ * succeed. Otherwise we can end up with a shadowed, mapped page in the
+ * backing object, which violates an invariant of vm_object_collapse()
+ * that shadowed pages are not mapped.
+ */
+ if (fs.m_cow != NULL) {
+ KASSERT(vm_page_none_valid(fs.m),
+ ("vm_fault: page %p is already valid", fs.m_cow));
+ vm_page_valid(fs.m);
+ }
+
+ /*
* Page must be completely valid or it is not fit to
* map into user space. vm_pager_get_pages() ensures this.
*/
@@ -2081,6 +2100,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map __unused,
vm_map_entry_t dst_entry, vm_map_entry_t src_entry,
vm_ooffset_t *fork_charge)
{
+ struct pctrie_iter pages;
vm_object_t backing_object, dst_object, object, src_object;
vm_pindex_t dst_pindex, pindex, src_pindex;
vm_prot_t access, prot;
@@ -2157,6 +2177,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map __unused,
* with the source object, all of its pages must be dirtied,
* regardless of whether they can be written.
*/
+ vm_page_iter_init(&pages, dst_object);
mpred = (src_object == dst_object) ?
vm_page_mpred(src_object, src_pindex) : NULL;
for (vaddr = dst_entry->start, dst_pindex = 0;
@@ -2201,14 +2222,15 @@ again:
*/
pindex = (src_object == dst_object ? src_pindex : 0) +
dst_pindex;
- dst_m = vm_page_alloc_after(dst_object, pindex,
+ dst_m = vm_page_alloc_after(dst_object, &pages, pindex,
VM_ALLOC_NORMAL, mpred);
if (dst_m == NULL) {
VM_OBJECT_WUNLOCK(dst_object);
VM_OBJECT_RUNLOCK(object);
vm_wait(dst_object);
VM_OBJECT_WLOCK(dst_object);
- mpred = vm_page_mpred(dst_object, pindex);
+ pctrie_iter_reset(&pages);
+ mpred = vm_radix_iter_lookup_lt(&pages, pindex);
goto again;
}
@@ -2230,8 +2252,11 @@ again:
VM_OBJECT_RUNLOCK(object);
} else {
dst_m = src_m;
- if (vm_page_busy_acquire(dst_m, VM_ALLOC_WAITFAIL) == 0)
+ if (vm_page_busy_acquire(
+ dst_m, VM_ALLOC_WAITFAIL) == 0) {
+ pctrie_iter_reset(&pages);
goto again;
+ }
if (dst_m->pindex >= dst_object->size) {
/*
* We are upgrading. Index can occur
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 0090904785ab..c441b8b3155f 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -98,6 +98,7 @@
#include <vm/vm_pagequeue.h>
#include <vm/vm_object.h>
#include <vm/vm_kern.h>
+#include <vm/vm_radix.h>
#include <vm/vm_extern.h>
#include <vm/vm_pager.h>
#include <vm/vm_phys.h>
@@ -611,40 +612,36 @@ static int
vm_thread_stack_back(vm_offset_t ks, vm_page_t ma[], int npages, int req_class,
int domain)
{
+ struct pctrie_iter pages;
vm_object_t obj = vm_thread_kstack_size_to_obj(npages);
vm_pindex_t pindex;
- vm_page_t m;
+ vm_page_t m, mpred;
int n;
pindex = vm_kstack_pindex(ks, npages);
+ vm_page_iter_init(&pages, obj);
VM_OBJECT_WLOCK(obj);
- for (n = 0; n < npages;) {
- m = vm_page_grab(obj, pindex + n,
+ for (n = 0; n < npages; ma[n++] = m) {
+ m = vm_page_grab_iter(obj, &pages, pindex + n,
VM_ALLOC_NOCREAT | VM_ALLOC_WIRED);
- if (m == NULL) {
- m = n > 0 ? ma[n - 1] : vm_page_mpred(obj, pindex);
- m = vm_page_alloc_domain_after(obj, pindex + n, domain,
- req_class | VM_ALLOC_WIRED, m);
+ if (m != NULL)
+ continue;
+ mpred = (n > 0) ? ma[n - 1] :
+ vm_radix_iter_lookup_lt(&pages, pindex);
+ m = vm_page_alloc_domain_after(obj, &pages, pindex + n,
+ domain, req_class | VM_ALLOC_WIRED, mpred);
+ if (m != NULL)
+ continue;
+ for (int i = 0; i < n; i++) {
+ m = ma[i];
+ (void)vm_page_unwire_noq(m);
+ vm_page_free(m);
}
- if (m == NULL)
- break;
- ma[n++] = m;
+ break;
}
- if (n < npages)
- goto cleanup;
VM_OBJECT_WUNLOCK(obj);
-
- return (0);
-cleanup:
- for (int i = 0; i < n; i++) {
- m = ma[i];
- (void)vm_page_unwire_noq(m);
- vm_page_free(m);
- }
- VM_OBJECT_WUNLOCK(obj);
-
- return (ENOMEM);
+ return (n < npages ? ENOMEM : 0);
}
static vm_object_t
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 8945061aabdc..2aa5588a7588 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -530,6 +530,7 @@ int
kmem_back_domain(int domain, vm_object_t object, vm_offset_t addr,
vm_size_t size, int flags)
{
+ struct pctrie_iter pages;
vm_offset_t offset, i;
vm_page_t m, mpred;
vm_prot_t prot;
@@ -546,11 +547,12 @@ kmem_back_domain(int domain, vm_object_t object, vm_offset_t addr,
prot = (flags & M_EXEC) != 0 ? VM_PROT_ALL : VM_PROT_RW;
i = 0;
+ vm_page_iter_init(&pages, object);
VM_OBJECT_WLOCK(object);
retry:
- mpred = vm_radix_lookup_le(&object->rtree, atop(offset + i));
+ mpred = vm_radix_iter_lookup_lt(&pages, atop(offset + i));
for (; i < size; i += PAGE_SIZE, mpred = m) {
- m = vm_page_alloc_domain_after(object, atop(offset + i),
+ m = vm_page_alloc_domain_after(object, &pages, atop(offset + i),
domain, pflags, mpred);
/*
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 4ab20a86e155..19e585745a80 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1597,16 +1597,21 @@ retry:
}
/*
- * The page was left invalid. Likely placed there by
+ * If the page was left invalid, it was likely placed there by
* an incomplete fault. Just remove and ignore.
+ *
+ * One other possibility is that the map entry is wired, in
+ * which case we must hang on to the page to avoid leaking it,
+ * as the map entry owns the wiring. This case can arise if the
+ * backing object is truncated by the pager.
*/
- if (vm_page_none_valid(m)) {
+ if (vm_page_none_valid(m) && entry->wired_count == 0) {
if (vm_page_iter_remove(&pages, m))
vm_page_free(m);
continue;
}
- /* vm_page_iter_rename() will dirty the page. */
+ /* vm_page_iter_rename() will dirty the page if it is valid. */
if (!vm_page_iter_rename(&pages, m, new_object, m->pindex -
offidxstart)) {
vm_page_xunbusy(m);
@@ -2270,19 +2275,21 @@ void
vm_object_prepare_buf_pages(vm_object_t object, vm_page_t *ma_dst, int count,
int *rbehind, int *rahead, vm_page_t *ma_src)
{
+ struct pctrie_iter pages;
vm_pindex_t pindex;
vm_page_t m, mpred, msucc;
+ vm_page_iter_init(&pages, object);
VM_OBJECT_ASSERT_LOCKED(object);
if (*rbehind != 0) {
m = ma_src[0];
pindex = m->pindex;
- mpred = TAILQ_PREV(m, pglist, listq);
+ mpred = vm_radix_iter_lookup_lt(&pages, pindex);
*rbehind = MIN(*rbehind,
pindex - (mpred != NULL ? mpred->pindex + 1 : 0));
/* Stepping backward from pindex, mpred doesn't change. */
for (int i = 0; i < *rbehind; i++) {
- m = vm_page_alloc_after(object, pindex - i - 1,
+ m = vm_page_alloc_after(object, &pages, pindex - i - 1,
VM_ALLOC_NORMAL, mpred);
if (m == NULL) {
/* Shift the array. */
@@ -2300,12 +2307,12 @@ vm_object_prepare_buf_pages(vm_object_t object, vm_page_t *ma_dst, int count,
if (*rahead != 0) {
m = ma_src[count - 1];
pindex = m->pindex + 1;
- msucc = TAILQ_NEXT(m, listq);
+ msucc = vm_radix_iter_lookup_ge(&pages, pindex);
*rahead = MIN(*rahead,
(msucc != NULL ? msucc->pindex : object->size) - pindex);
mpred = m;
for (int i = 0; i < *rahead; i++) {
- m = vm_page_alloc_after(object, pindex + i,
+ m = vm_page_alloc_after(object, &pages, pindex + i,
VM_ALLOC_NORMAL, mpred);
if (m == NULL) {
*rahead = i;
@@ -2720,8 +2727,9 @@ DB_SHOW_COMMAND_FLAGS(vmochk, vm_object_check, DB_CMD_MEMSAFE)
TAILQ_FOREACH(object, &vm_object_list, object_list) {
if ((object->flags & OBJ_ANON) != 0) {
if (object->ref_count == 0) {
- db_printf("vmochk: internal obj has zero ref count: %ld\n",
- (long)object->size);
+ db_printf(
+ "vmochk: internal obj has zero ref count: %lu\n",
+ (u_long)object->size);
}
if (!vm_object_in_map(object)) {
db_printf(
@@ -2756,11 +2764,12 @@ DB_SHOW_COMMAND(object, vm_object_print_static)
if (object == NULL)
return;
- db_iprintf(
- "Object %p: type=%d, size=0x%jx, res=%d, ref=%d, flags=0x%x ruid %d charge %jx\n",
+ db_iprintf("Object %p: type=%d, size=0x%jx, res=%d, ref=%d, flags=0x%x",
object, (int)object->type, (uintmax_t)object->size,
- object->resident_page_count, object->ref_count, object->flags,
- object->cred ? object->cred->cr_ruid : -1, (uintmax_t)object->charge);
+ object->resident_page_count, object->ref_count, object->flags);
+ db_iprintf(" ruid %d charge %jx\n",
+ object->cred ? object->cred->cr_ruid : -1,
+ (uintmax_t)object->charge);
db_iprintf(" sref=%d, backing_object(%d)=(%p)+0x%jx\n",
atomic_load_int(&object->shadow_count),
object->backing_object ? object->backing_object->ref_count : 0,
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index f351f60f833c..65d278caf3fd 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -171,8 +171,6 @@ static void vm_page_enqueue(vm_page_t m, uint8_t queue);
static bool vm_page_free_prep(vm_page_t m);
static void vm_page_free_toq(vm_page_t m);
static void vm_page_init(void *dummy);
-static int vm_page_insert_after(vm_page_t m, vm_object_t object,
- vm_pindex_t pindex, vm_page_t mpred);
static void vm_page_insert_radixdone(vm_page_t m, vm_object_t object,
vm_page_t mpred);
static void vm_page_mvqueue(vm_page_t m, const uint8_t queue,
@@ -1473,18 +1471,17 @@ vm_page_dirty_KBI(vm_page_t m)
/*
* Insert the given page into the given object at the given pindex. mpred is
- * used for memq linkage. From vm_page_insert, lookup is true, mpred is
- * initially NULL, and this procedure looks it up. From vm_page_insert_after
- * and vm_page_iter_insert, lookup is false and mpred is known to the caller
- * to be valid, and may be NULL if this will be the page with the lowest
- * pindex.
+ * used for memq linkage. From vm_page_insert, iter is false, mpred is
+ * initially NULL, and this procedure looks it up. From vm_page_iter_insert,
+ * iter is true and mpred is known to the caller to be valid, and may be NULL if
+ * this will be the page with the lowest pindex.
*
* The procedure is marked __always_inline to suggest to the compiler to
* eliminate the lookup parameter and the associated alternate branch.
*/
static __always_inline int
vm_page_insert_lookup(vm_page_t m, vm_object_t object, vm_pindex_t pindex,
- struct pctrie_iter *pages, bool iter, vm_page_t mpred, bool lookup)
+ struct pctrie_iter *pages, bool iter, vm_page_t mpred)
{
int error;
@@ -1503,13 +1500,10 @@ vm_page_insert_lookup(vm_page_t m, vm_object_t object, vm_pindex_t pindex,
* Add this page to the object's radix tree, and look up mpred if
* needed.
*/
- if (iter) {
- KASSERT(!lookup, ("%s: cannot lookup mpred", __func__));
+ if (iter)
error = vm_radix_iter_insert(pages, m);
- } else if (lookup)
- error = vm_radix_insert_lookup_lt(&object->rtree, m, &mpred);
else
- error = vm_radix_insert(&object->rtree, m);
+ error = vm_radix_insert_lookup_lt(&object->rtree, m, &mpred);
if (__predict_false(error != 0)) {
m->object = NULL;
m->pindex = 0;
@@ -1535,26 +1529,7 @@ vm_page_insert_lookup(vm_page_t m, vm_object_t object, vm_pindex_t pindex,
int
vm_page_insert(vm_page_t m, vm_object_t object, vm_pindex_t pindex)
{
- return (vm_page_insert_lookup(m, object, pindex, NULL, false, NULL,
- true));
-}
-
-/*
- * vm_page_insert_after:
- *
- * Inserts the page "m" into the specified object at offset "pindex".
- *
- * The page "mpred" must immediately precede the offset "pindex" within
- * the specified object.
- *
- * The object must be locked.
- */
-static int
-vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex,
- vm_page_t mpred)
-{
- return (vm_page_insert_lookup(m, object, pindex, NULL, false, mpred,
- false));
+ return (vm_page_insert_lookup(m, object, pindex, NULL, false, NULL));
}
/*
@@ -1573,8 +1548,7 @@ static int
vm_page_iter_insert(struct pctrie_iter *pages, vm_page_t m, vm_object_t object,
vm_pindex_t pindex, vm_page_t mpred)
{
- return (vm_page_insert_lookup(m, object, pindex, pages, true, mpred,
- false));
+ return (vm_page_insert_lookup(m, object, pindex, pages, true, mpred));
}
/*
@@ -2038,15 +2012,10 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex,
*
* Panics if a page already resides in the new object at the new pindex.
*
- * Note: swap associated with the page must be invalidated by the move. We
- * have to do this for several reasons: (1) we aren't freeing the
- * page, (2) we are dirtying the page, (3) the VM system is probably
- * moving the page from object A to B, and will then later move
- * the backing store from A to B and we can't have a conflict.
- *
- * Note: we *always* dirty the page. It is necessary both for the
- * fact that we moved it, and because we may be invalidating
- * swap.
+ * This routine dirties the page if it is valid, as callers are expected to
+ * transfer backing storage only after moving the page. Dirtying the page
+ * ensures that the destination object retains the most recent copy of the
+ * page.
*
* The objects must be locked.
*/
@@ -2087,7 +2056,8 @@ vm_page_iter_rename(struct pctrie_iter *old_pages, vm_page_t m,
m->object = new_object;
vm_page_insert_radixdone(m, new_object, mpred);
- vm_page_dirty(m);
+ if (vm_page_any_valid(m))
+ vm_page_dirty(m);
vm_pager_page_inserted(new_object, m);
return (true);
}
@@ -2129,8 +2099,10 @@ vm_page_mpred(vm_object_t object, vm_pindex_t pindex)
vm_page_t
vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req)
{
+ struct pctrie_iter pages;
- return (vm_page_alloc_after(object, pindex, req,
+ vm_page_iter_init(&pages, object);
+ return (vm_page_alloc_after(object, &pages, pindex, req,
vm_page_mpred(object, pindex)));
}
@@ -2141,8 +2113,8 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req)
* page index, or NULL if no such page exists.
*/
vm_page_t
-vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex,
- int req, vm_page_t mpred)
+vm_page_alloc_after(vm_object_t object, struct pctrie_iter *pages,
+ vm_pindex_t pindex, int req, vm_page_t mpred)
{
struct vm_domainset_iter di;
vm_page_t m;
@@ -2150,8 +2122,8 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex,
vm_domainset_iter_page_init(&di, object, pindex, &domain, &req);
do {
- m = vm_page_alloc_domain_after(object, pindex, domain, req,
- mpred);
+ m = vm_page_alloc_domain_after(object, pages, pindex, domain,
+ req, mpred);
if (m != NULL)
break;
} while (vm_domainset_iter_page(&di, object, &domain) == 0);
@@ -2213,8 +2185,8 @@ vm_domain_allocate(struct vm_domain *vmd, int req, int npages)
}
vm_page_t
-vm_page_alloc_domain_after(vm_object_t object, vm_pindex_t pindex, int domain,
- int req, vm_page_t mpred)
+vm_page_alloc_domain_after(vm_object_t object, struct pctrie_iter *pages,
+ vm_pindex_t pindex, int domain, int req, vm_page_t mpred)
{
struct vm_domain *vmd;
vm_page_t m;
@@ -2283,6 +2255,7 @@ again:
/*
* Not allocatable, give up.
*/
+ pctrie_iter_reset(pages);
if (vm_domain_alloc_fail(vmd, object, req))
goto again;
return (NULL);
@@ -2319,7 +2292,7 @@ found:
}
m->a.act_count = 0;
- if (vm_page_insert_after(m, object, pindex, mpred)) {
+ if (vm_page_insert_lookup(m, object, pindex, pages, true, mpred)) {
if (req & VM_ALLOC_WIRED) {
vm_wire_sub(1);
m->ref_count = 0;
@@ -2332,6 +2305,7 @@ found:
if (req & VM_ALLOC_WAITFAIL) {
VM_OBJECT_WUNLOCK(object);
vm_radix_wait();
+ pctrie_iter_reset(pages);
VM_OBJECT_WLOCK(object);
}
return (NULL);
@@ -2475,7 +2449,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain,
KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero"));
vm_page_iter_init(&pages, object);
- mpred = vm_radix_iter_lookup_le(&pages, pindex);
+ mpred = vm_radix_iter_lookup_lt(&pages, pindex);
KASSERT(mpred == NULL || mpred->pindex != pindex,
("vm_page_alloc_contig: pindex already allocated"));
for (;;) {
@@ -2652,40 +2626,66 @@ found:
* the routine will try to fetch a new one from the freelists
* and discard the old one.
*/
-static vm_page_t
+static vm_page_t __noinline
vm_page_alloc_nofree_domain(int domain, int req)
{
vm_page_t m;
struct vm_domain *vmd;
- struct vm_nofreeq *nqp;
KASSERT((req & VM_ALLOC_NOFREE) != 0, ("invalid request %#x", req));
vmd = VM_DOMAIN(domain);
- nqp = &vmd->vmd_nofreeq;
vm_domain_free_lock(vmd);
- if (nqp->offs >= (1 << VM_NOFREE_IMPORT_ORDER) || nqp->ma == NULL) {
- if (!vm_domain_allocate(vmd, req,
- 1 << VM_NOFREE_IMPORT_ORDER)) {
+ if (TAILQ_EMPTY(&vmd->vmd_nofreeq)) {
+ int count;
+
+ count = 1 << VM_NOFREE_IMPORT_ORDER;
+ if (!vm_domain_allocate(vmd, req, count)) {
vm_domain_free_unlock(vmd);
return (NULL);
}
- nqp->ma = vm_phys_alloc_pages(domain, VM_FREEPOOL_DEFAULT,
+ m = vm_phys_alloc_pages(domain, VM_FREEPOOL_DEFAULT,
VM_NOFREE_IMPORT_ORDER);
- if (nqp->ma == NULL) {
- vm_domain_freecnt_inc(vmd, 1 << VM_NOFREE_IMPORT_ORDER);
+ if (m == NULL) {
+ vm_domain_freecnt_inc(vmd, count);
vm_domain_free_unlock(vmd);
return (NULL);
}
- nqp->offs = 0;
+ m->pindex = count;
+ TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m, listq);
+ VM_CNT_ADD(v_nofree_count, count);
+ }
+ m = TAILQ_FIRST(&vmd->vmd_nofreeq);
+ TAILQ_REMOVE(&vmd->vmd_nofreeq, m, listq);
+ if (m->pindex > 1) {
+ vm_page_t m_next;
+
+ m_next = &m[1];
+ m_next->pindex = m->pindex - 1;
+ TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m_next, listq);
}
- m = &nqp->ma[nqp->offs++];
vm_domain_free_unlock(vmd);
- VM_CNT_ADD(v_nofree_count, 1);
+ VM_CNT_ADD(v_nofree_count, -1);
return (m);
}
+/*
+ * Though a NOFREE page by definition should not be freed, we support putting
+ * them aside for future NOFREE allocations. This enables code which allocates
+ * NOFREE pages for some purpose but then encounters an error and releases
+ * resources.
+ */
+static void __noinline
+vm_page_free_nofree(struct vm_domain *vmd, vm_page_t m)
+{
+ vm_domain_free_lock(vmd);
+ m->pindex = 1;
+ TAILQ_INSERT_HEAD(&vmd->vmd_nofreeq, m, listq);
+ vm_domain_free_unlock(vmd);
+ VM_CNT_ADD(v_nofree_count, 1);
+}
+
vm_page_t
vm_page_alloc_noobj(int req)
{
@@ -3420,8 +3420,8 @@ int
vm_page_reclaim_contig_domain(int domain, int req, u_long npages,
vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary)
{
- return (vm_page_reclaim_contig_domain_ext(domain, req, npages, low, high,
- alignment, boundary, 1));
+ return (vm_page_reclaim_contig_domain_ext(domain, req, npages, low,
+ high, alignment, boundary, 1));
}
int
@@ -3735,7 +3735,8 @@ vm_page_pagequeue(vm_page_t m)
#endif
static __always_inline bool
-vm_page_pqstate_fcmpset(vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new)
+vm_page_pqstate_fcmpset(vm_page_t m, vm_page_astate_t *old,
+ vm_page_astate_t new)
{
vm_page_astate_t tmp;
@@ -4149,8 +4150,6 @@ vm_page_free_prep(vm_page_t m)
m, i, (uintmax_t)*p));
}
#endif
- KASSERT((m->flags & PG_NOFREE) == 0,
- ("%s: attempting to free a PG_NOFREE page", __func__));
if ((m->oflags & VPO_UNMANAGED) == 0) {
KASSERT(!pmap_page_is_mapped(m),
("vm_page_free_prep: freeing mapped page %p", m));
@@ -4234,6 +4233,10 @@ vm_page_free_toq(vm_page_t m)
return;
vmd = vm_pagequeue_domain(m);
+ if (__predict_false((m->flags & PG_NOFREE) != 0)) {
+ vm_page_free_nofree(vmd, m);
+ return;
+ }
zone = vmd->vmd_pgcache[m->pool].zone;
if ((m->flags & PG_PCPU_CACHE) != 0 && zone != NULL) {
uma_zfree(zone, m);
@@ -4850,32 +4853,32 @@ vm_page_grab_lookup(struct pctrie_iter *pages, vm_object_t object,
}
/*
- * Grab a page. Keep on waiting, as long as the page exists in the object. If
- * the page doesn't exist, first allocate it and then conditionally zero it.
+ * Grab a page. Use an iterator parameter. Keep on waiting, as long as the page
+ * exists in the object. If the page doesn't exist, first allocate it and then
+ * conditionally zero it.
*
* The object must be locked on entry. This routine may sleep. The lock will,
* however, be released and reacquired if the routine sleeps.
*/
vm_page_t
-vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags)
+vm_page_grab_iter(vm_object_t object, struct pctrie_iter *pages,
+ vm_pindex_t pindex, int allocflags)
{
- struct pctrie_iter pages;
vm_page_t m, mpred;
bool found;
VM_OBJECT_ASSERT_WLOCKED(object);
vm_page_grab_check(allocflags);
- vm_page_iter_init(&pages, object);
while ((m = vm_page_grab_lookup(
- &pages, object, pindex, allocflags, &found)) == NULL) {
+ pages, object, pindex, allocflags, &found)) == NULL) {
if ((allocflags & VM_ALLOC_NOCREAT) != 0)
return (NULL);
if (found &&
(allocflags & (VM_ALLOC_NOWAIT | VM_ALLOC_WAITFAIL)) != 0)
return (NULL);
- mpred = vm_radix_iter_lookup_le(&pages, pindex);
- m = vm_page_alloc_after(object, pindex,
+ mpred = vm_radix_iter_lookup_lt(pages, pindex);
+ m = vm_page_alloc_after(object, pages, pindex,
vm_page_grab_pflags(allocflags), mpred);
if (m != NULL) {
if ((allocflags & VM_ALLOC_ZERO) != 0 &&
@@ -4893,6 +4896,23 @@ vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags)
}
/*
+ * Grab a page. Keep on waiting, as long as the page exists in the object. If
+ * the page doesn't exist, first allocate it and then conditionally zero it.
+ *
+ * The object must be locked on entry. This routine may sleep. The lock will,
+ * however, be released and reacquired if the routine sleeps.
+ */
+vm_page_t
+vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags)
+{
+ struct pctrie_iter pages;
+
+ VM_OBJECT_ASSERT_WLOCKED(object);
+ vm_page_iter_init(&pages, object);
+ return (vm_page_grab_iter(object, &pages, pindex, allocflags));
+}
+
+/*
* Attempt to validate a page, locklessly acquiring it if necessary, given a
* (object, pindex) tuple and either an invalided page or NULL. The resulting
* page will be validated against the identity tuple, and busied or wired as
@@ -4972,9 +4992,11 @@ vm_page_grab_unlocked(vm_object_t object, vm_pindex_t pindex, int allocflags)
* will neither be wired nor busy regardless of allocflags.
*/
int
-vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int allocflags)
+vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex,
+ int allocflags)
{
- vm_page_t m;
+ struct pctrie_iter pages;
+ vm_page_t m, mpred;
vm_page_t ma[VM_INITIAL_PAGEIN];
int after, i, pflags, rv;
@@ -4988,9 +5010,10 @@ vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int al
pflags = allocflags & ~(VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY |
VM_ALLOC_WIRED | VM_ALLOC_IGN_SBUSY);
pflags |= VM_ALLOC_WAITFAIL;
+ vm_page_iter_init(&pages, object);
retrylookup:
- if ((m = vm_page_lookup(object, pindex)) != NULL) {
+ if ((m = vm_radix_iter_lookup(&pages, pindex)) != NULL) {
/*
* If the page is fully valid it can only become invalid
* with the object lock held. If it is not valid it can
@@ -5004,6 +5027,7 @@ retrylookup:
vm_page_all_valid(m) ? allocflags : 0)) {
(void)vm_page_grab_sleep(object, m, pindex, "pgrbwt",
allocflags, true);
+ pctrie_iter_reset(&pages);
goto retrylookup;
}
if (vm_page_all_valid(m))
@@ -5016,12 +5040,16 @@ retrylookup:
} else if ((allocflags & VM_ALLOC_NOCREAT) != 0) {
*mp = NULL;
return (VM_PAGER_FAIL);
- } else if ((m = vm_page_alloc(object, pindex, pflags)) == NULL) {
- if (!vm_pager_can_alloc_page(object, pindex)) {
- *mp = NULL;
- return (VM_PAGER_AGAIN);
+ } else {
+ mpred = vm_radix_iter_lookup_lt(&pages, pindex);
+ m = vm_page_alloc_after(object, &pages, pindex, pflags, mpred);
+ if (m == NULL) {
+ if (!vm_pager_can_alloc_page(object, pindex)) {
+ *mp = NULL;
+ return (VM_PAGER_AGAIN);
+ }
+ goto retrylookup;
}
- goto retrylookup;
}
vm_page_assert_xbusied(m);
@@ -5029,18 +5057,17 @@ retrylookup:
after = MIN(after, VM_INITIAL_PAGEIN);
after = MIN(after, allocflags >> VM_ALLOC_COUNT_SHIFT);
after = MAX(after, 1);
- ma[0] = m;
+ ma[0] = mpred = m;
for (i = 1; i < after; i++) {
- if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) {
- if (vm_page_any_valid(ma[i]) ||
- !vm_page_tryxbusy(ma[i]))
- break;
- } else {
- ma[i] = vm_page_alloc_after(object,
- m->pindex + i, VM_ALLOC_NORMAL, ma[i - 1]);
- if (ma[i] == NULL)
+ m = vm_radix_iter_lookup(&pages, pindex + i);
+ if (m == NULL) {
+ m = vm_page_alloc_after(object, &pages,
+ pindex + i, VM_ALLOC_NORMAL, mpred);
+ if (m == NULL)
break;
- }
+ } else if (vm_page_any_valid(m) || !vm_page_tryxbusy(m))
+ break;
+ mpred = ma[i] = m;
}
after = i;
vm_object_pip_add(object, after);
@@ -5105,8 +5132,8 @@ vm_page_grab_zero_partial(vm_object_t object, vm_pindex_t pindex, int base,
&pages, object, pindex, allocflags, &found)) == NULL) {
if (!vm_pager_has_page(object, pindex, NULL, NULL))
return (0);
- mpred = vm_radix_iter_lookup_le(&pages, pindex);
- m = vm_page_alloc_after(object, pindex,
+ mpred = vm_radix_iter_lookup_lt(&pages, pindex);
+ m = vm_page_alloc_after(object, &pages, pindex,
vm_page_grab_pflags(allocflags), mpred);
if (m != NULL) {
vm_object_pip_add(object, 1);
@@ -5217,6 +5244,7 @@ int
vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags,
vm_page_t *ma, int count)
{
+ struct pctrie_iter pages;
vm_page_t m, mpred;
int pflags;
int i;
@@ -5230,25 +5258,24 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags,
pflags = vm_page_grab_pflags(allocflags);
i = 0;
+ vm_page_iter_init(&pages, object);
retrylookup:
- m = vm_page_mpred(object, pindex + i);
- if (m == NULL || m->pindex != pindex + i) {
- mpred = m;
- m = NULL;
- } else
- mpred = TAILQ_PREV(m, pglist, listq);
+ mpred = vm_radix_iter_lookup_lt(&pages, pindex + i);
for (; i < count; i++) {
+ m = vm_radix_iter_lookup(&pages, pindex + i);
if (m != NULL) {
if (!vm_page_tryacquire(m, allocflags)) {
if (vm_page_grab_sleep(object, m, pindex + i,
- "grbmaw", allocflags, true))
+ "grbmaw", allocflags, true)) {
+ pctrie_iter_reset(&pages);
goto retrylookup;
+ }
break;
}
} else {
if ((allocflags & VM_ALLOC_NOCREAT) != 0)
break;
- m = vm_page_alloc_after(object, pindex + i,
+ m = vm_page_alloc_after(object, &pages, pindex + i,
pflags | VM_ALLOC_COUNT(count - i), mpred);
if (m == NULL) {
if ((allocflags & (VM_ALLOC_NOWAIT |
@@ -5265,7 +5292,6 @@ retrylookup:
}
vm_page_grab_release(m, allocflags);
ma[i] = mpred = m;
- m = vm_page_next(m);
}
return (i);
}
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 1cac80c6a8ef..0a40b42ffb62 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -608,9 +608,10 @@ void vm_page_activate (vm_page_t);
void vm_page_advise(vm_page_t m, int advice);
vm_page_t vm_page_mpred(vm_object_t, vm_pindex_t);
vm_page_t vm_page_alloc(vm_object_t, vm_pindex_t, int);
-vm_page_t vm_page_alloc_after(vm_object_t, vm_pindex_t, int, vm_page_t);
-vm_page_t vm_page_alloc_domain_after(vm_object_t, vm_pindex_t, int, int,
- vm_page_t);
+vm_page_t vm_page_alloc_after(vm_object_t, struct pctrie_iter *, vm_pindex_t,
+ int, vm_page_t);
+vm_page_t vm_page_alloc_domain_after(vm_object_t, struct pctrie_iter *,
+ vm_pindex_t, int, int, vm_page_t);
vm_page_t vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req,
u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment,
vm_paddr_t boundary, vm_memattr_t memattr);
@@ -631,6 +632,8 @@ bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose);
int vm_page_grab_zero_partial(vm_object_t object, vm_pindex_t pindex, int base,
int end);
vm_page_t vm_page_grab(vm_object_t, vm_pindex_t, int);
+vm_page_t vm_page_grab_iter(vm_object_t object, struct pctrie_iter *pages, vm_pindex_t pindex,
+ int allocflags);
vm_page_t vm_page_grab_unlocked(vm_object_t, vm_pindex_t, int);
int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags,
vm_page_t *ma, int count);
diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h
index 72fd1bb47318..cbbd27389662 100644
--- a/sys/vm/vm_pagequeue.h
+++ b/sys/vm/vm_pagequeue.h
@@ -247,10 +247,7 @@ struct vm_domain {
u_int vmd_domain; /* (c) Domain number. */
u_int vmd_page_count; /* (c) Total page count. */
long vmd_segs; /* (c) bitmask of the segments */
- struct vm_nofreeq {
- vm_page_t ma;
- int offs;
- } vmd_nofreeq; /* (f) NOFREE page bump allocator. */
+ struct pglist vmd_nofreeq; /* (f) NOFREE page bump allocator. */
u_int __aligned(CACHE_LINE_SIZE) vmd_free_count; /* (a,f) free page count */
u_int vmd_pageout_deficit; /* (a) Estimated number of pages deficit */
uint8_t vmd_pad[CACHE_LINE_SIZE - (sizeof(u_int) * 2)];
diff --git a/sys/vm/vm_radix.h b/sys/vm/vm_radix.h
index 561e36f2e164..e9ee3e7f3911 100644
--- a/sys/vm/vm_radix.h
+++ b/sys/vm/vm_radix.h
@@ -271,6 +271,19 @@ vm_radix_iter_lookup_le(struct pctrie_iter *pages, vm_pindex_t index)
}
/*
+ * Initialize an iterator pointing to the page with the greatest pindex that is
+ * less than to the specified pindex, or NULL if there are no such
+ * pages. Return the page.
+ *
+ * Requires that access be externally synchronized by a lock.
+ */
+static __inline vm_page_t
+vm_radix_iter_lookup_lt(struct pctrie_iter *pages, vm_pindex_t index)
+{
+ return (index == 0 ? NULL : vm_radix_iter_lookup_le(pages, index - 1));
+}
+
+/*
* Update the iterator to point to the page with the pindex that is one greater
* than the current pindex, or NULL if there is no such page. Return the page.
*
diff --git a/sys/x86/include/bus.h b/sys/x86/include/bus.h
index 8f9f48b67157..5e9f11ad4f95 100644
--- a/sys/x86/include/bus.h
+++ b/sys/x86/include/bus.h
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-3-Clause AND BSD-2-ClauseE
+ * SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause
*
* Copyright (c) KATO Takenori, 1999.
*
diff --git a/sys/x86/include/metadata.h b/sys/x86/include/metadata.h
index b3eb4b16c1ba..dd8a8ef6c73d 100644
--- a/sys/x86/include/metadata.h
+++ b/sys/x86/include/metadata.h
@@ -36,10 +36,15 @@
#define MODINFOMD_VBE_FB 0x1007
#define MODINFOMD_EFI_ARCH 0x1008
+/*
+ * This is not the same as the UEFI standard EFI_MEMORY_ATTRIBUTES_TABLE, though
+ * memory_size / descritpr_size entries of EFI_MEMORY_DESCRIPTORS follow this table
+ * starting at a 16-byte alignment.
+ */
struct efi_map_header {
- uint64_t memory_size;
- uint64_t descriptor_size;
- uint32_t descriptor_version;
+ uint64_t memory_size; /* Numnber of bytes that follow */
+ uint64_t descriptor_size; /* Size of each EFI_MEMORY_DESCRIPTOR */
+ uint32_t descriptor_version; /* Currently '1' */
};
struct efi_fb {
diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile
index d91199fd519e..06b82071fe31 100644
--- a/tests/sys/fs/fusefs/Makefile
+++ b/tests/sys/fs/fusefs/Makefile
@@ -89,7 +89,6 @@ CXXFLAGS+= -I${SRCTOP}/tests
CXXFLAGS+= -I${FUSEFS}
CXXFLAGS+= -I${MOUNT}
.PATH: ${MOUNT}
-CXXSTD= c++14
LIBADD+= pthread
LIBADD+= gmock gtest
diff --git a/tests/sys/fs/fusefs/xattr.cc b/tests/sys/fs/fusefs/xattr.cc
index b1cbb9ffa768..0cd2783551b4 100644
--- a/tests/sys/fs/fusefs/xattr.cc
+++ b/tests/sys/fs/fusefs/xattr.cc
@@ -569,7 +569,7 @@ TEST_F(Listxattr, size_only_race_smaller)
}));
expect_listxattr(ino, sizeof(attrs0),
ReturnImmediate([&](auto in __unused, auto& out) {
- strlcpy((char*)out.body.bytes, attrs1, sizeof(attrs1));
+ memcpy((char*)out.body.bytes, attrs1, sizeof(attrs1));
out.header.len = sizeof(fuse_out_header) +
sizeof(attrs1);
})
diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile
index 95ab86156a0a..a76fca4e61fb 100644
--- a/tests/sys/net/Makefile
+++ b/tests/sys/net/Makefile
@@ -15,6 +15,7 @@ ATF_TESTS_SH+= if_tun_test
ATF_TESTS_SH+= if_vlan
ATF_TESTS_SH+= if_wg
+TESTS_SUBDIRS+= bpf
TESTS_SUBDIRS+= if_ovpn
TESTS_SUBDIRS+= routing
diff --git a/tests/sys/net/bpf/Makefile b/tests/sys/net/bpf/Makefile
new file mode 100644
index 000000000000..9c8a25b15d16
--- /dev/null
+++ b/tests/sys/net/bpf/Makefile
@@ -0,0 +1,15 @@
+.include <src.opts.mk>
+
+PACKAGE= tests
+
+TESTSDIR= ${TESTSBASE}/sys/net/bpf
+BINDIR= ${TESTSDIR}
+
+LIBADD+= nv
+
+PROGS= bpf_multi_read
+LIBADD.bpf_multi_read+= pcap
+
+ATF_TESTS_SH= bpf
+
+.include <bsd.test.mk>
diff --git a/tests/sys/net/bpf/bpf.sh b/tests/sys/net/bpf/bpf.sh
new file mode 100644
index 000000000000..2830c4862de9
--- /dev/null
+++ b/tests/sys/net/bpf/bpf.sh
@@ -0,0 +1,67 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2025 Rubicon Communications, LLC ("Netgate")
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+. $(atf_get_srcdir)/../../common/vnet.subr
+
+atf_test_case "multi_read" "cleanup"
+multi_read_head()
+{
+ atf_set descr 'Test multiple readers on /dev/bpf'
+ atf_set require.user root
+}
+
+multi_read_body()
+{
+ vnet_init
+
+ epair=$(vnet_mkepair)
+ ifconfig ${epair}a inet 192.0.2.1/24 up
+
+ vnet_mkjail alcatraz ${epair}b
+ jexec alcatraz ifconfig ${epair}b inet 192.0.2.2/24 up
+
+ atf_check -s exit:0 -o ignore \
+ ping -c 1 192.0.2.2
+
+ # Start a multi-thread (or multi-process) read on bpf
+ $(atf_get_srcdir)/bpf_multi_read ${epair}a &
+
+ # Generate traffic
+ ping -f 192.0.2.2 >/dev/null 2>&1 &
+
+ # Now let this run for 10 seconds
+ sleep 10
+}
+
+multi_read_cleanup()
+{
+ vnet_cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case "multi_read"
+}
diff --git a/tests/sys/net/bpf/bpf_multi_read.c b/tests/sys/net/bpf/bpf_multi_read.c
new file mode 100644
index 000000000000..3a8edd76d623
--- /dev/null
+++ b/tests/sys/net/bpf/bpf_multi_read.c
@@ -0,0 +1,76 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Rubicon Communications, LLC (Netgate)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <err.h>
+#include <stdio.h>
+#include <pcap.h>
+#include <unistd.h>
+
+static void
+callback(u_char *arg __unused, const struct pcap_pkthdr *hdr __unused,
+ const unsigned char *bytes __unused)
+{
+}
+
+int
+main(int argc, const char **argv)
+{
+ pcap_t *pcap;
+ const char *interface;
+ char errbuf[PCAP_ERRBUF_SIZE] = { 0 };
+ int ret;
+
+ if (argc != 2)
+ err(1, "Usage: %s <interface>\n", argv[0]);
+
+ interface = argv[1];
+
+ pcap = pcap_create(interface, errbuf);
+ if (! pcap)
+ perror("Failed to pcap interface");
+
+ ret = pcap_set_snaplen(pcap, 86);
+ if (ret != 0)
+ perror("Failed to set snaplen");
+
+ ret = pcap_set_timeout(pcap, 100);
+ if (ret != 0)
+ perror("Failed to set timeout");
+
+ ret = pcap_activate(pcap);
+ if (ret != 0)
+ perror("Failed to activate");
+
+ /* So we have two readers on one /dev/bpf fd */
+ fork();
+
+ printf("Interface open\n");
+ pcap_loop(pcap, 0, callback, NULL);
+
+ return (0);
+}
diff --git a/tests/sys/net/if_lagg_test.sh b/tests/sys/net/if_lagg_test.sh
index 4bdb59c8aab9..e2b998599991 100755
--- a/tests/sys/net/if_lagg_test.sh
+++ b/tests/sys/net/if_lagg_test.sh
@@ -190,10 +190,6 @@ lacp_linkstate_destroy_stress_head()
}
lacp_linkstate_destroy_stress_body()
{
- if [ "$(atf_config_get ci false)" = "true" ]; then
- atf_skip "https://bugs.freebsd.org/244168"
- fi
-
local TAP0 TAP1 LAGG MAC SRCDIR
# Configure the lagg interface to use an RFC5737 nonrouteable addresses
diff --git a/tests/sys/netinet6/Makefile b/tests/sys/netinet6/Makefile
index 753571fbf7a1..26f1a18a8d32 100644
--- a/tests/sys/netinet6/Makefile
+++ b/tests/sys/netinet6/Makefile
@@ -14,7 +14,8 @@ ATF_TESTS_SH= exthdr \
lpm6 \
fibs6 \
ndp \
- proxy_ndp
+ proxy_ndp \
+ addr6
TEST_METADATA.divert+= execenv="jail" \
execenv_jail_params="vnet allow.raw_sockets"
@@ -33,6 +34,8 @@ TEST_METADATA.redirect+= execenv="jail" \
execenv_jail_params="vnet allow.raw_sockets"
TEST_METADATA.scapyi386+= execenv="jail" \
execenv_jail_params="vnet allow.raw_sockets"
+TEST_METADATA.addr6+= execenv="jail" \
+ execenv_jail_params="vnet allow.raw_sockets"
${PACKAGE}FILES+= exthdr.py \
mld.py \
diff --git a/tests/sys/netinet6/addr6.sh b/tests/sys/netinet6/addr6.sh
new file mode 100755
index 000000000000..38e4bb152240
--- /dev/null
+++ b/tests/sys/netinet6/addr6.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env atf-sh
+#-
+# SPDX-License-Identifier: ISC
+#
+# Copyright (c) 2025 Lexi Winter.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+. $(atf_get_srcdir)/../common/vnet.subr
+
+atf_test_case "addr6_invalid_addr" "cleanup"
+addr6_invalid_addr_head()
+{
+ atf_set descr "adding an invalid IPv6 address returns an error"
+ atf_set require.user root
+}
+
+addr6_invalid_addr_body()
+{
+ vnet_init
+
+ ep=$(vnet_mkepair)
+ atf_check -s exit:0 ifconfig ${ep}a inet6 2001:db8::1/128
+ atf_check -s exit:1 -e ignore ifconfig ${ep}a inet6 2001:db8::1/127 alias
+}
+
+addr6_invalid_addr_cleanup()
+{
+ vnet_cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case "addr6_invalid_addr"
+}
diff --git a/tests/sys/netinet6/redirect.sh b/tests/sys/netinet6/redirect.sh
index aa0731d89101..40874f8c9b6d 100644
--- a/tests/sys/netinet6/redirect.sh
+++ b/tests/sys/netinet6/redirect.sh
@@ -39,10 +39,6 @@ valid_redirect_head() {
valid_redirect_body() {
- if [ "$(atf_config_get ci false)" = "true" ]; then
- atf_skip "https://bugs.freebsd.org/247729"
- fi
-
ids=65533
id=`printf "%x" ${ids}`
if [ $$ -gt 65535 ]; then
@@ -89,7 +85,7 @@ valid_redirect_body() {
while [ `ifconfig ${epair}a inet6 | grep -c tentative` != "0" ]; do
sleep 0.1
done
- while [ `jexec ${jname}b ifconfig ${epair}b inet6 | grep -c tentative` != "0" ]; do
+ while [ `jexec ${jname} ifconfig ${epair}b inet6 | grep -c tentative` != "0" ]; do
sleep 0.1
done
diff --git a/tests/sys/netlink/test_snl.c b/tests/sys/netlink/test_snl.c
index bd607efa82fc..040414a96e2c 100644
--- a/tests/sys/netlink/test_snl.c
+++ b/tests/sys/netlink/test_snl.c
@@ -13,6 +13,18 @@
#include <atf-c.h>
+static const struct snl_hdr_parser *snl_all_core_parsers[] = {
+ &snl_errmsg_parser, &snl_donemsg_parser,
+ &_nla_bit_parser, &_nla_bitset_parser,
+};
+
+static const struct snl_hdr_parser *snl_all_route_parsers[] = {
+ &_metrics_mp_nh_parser, &_mpath_nh_parser, &_metrics_parser, &snl_rtm_route_parser,
+ &_link_fbsd_parser, &snl_rtm_link_parser, &snl_rtm_link_parser_simple,
+ &_neigh_fbsd_parser, &snl_rtm_neigh_parser,
+ &_addr_fbsd_parser, &snl_rtm_addr_parser, &_nh_fbsd_parser, &snl_nhmsg_parser,
+};
+
static void
require_netlink(void)
{
diff --git a/tests/sys/netlink/test_snl_generic.c b/tests/sys/netlink/test_snl_generic.c
index 839127fe5232..c63b1380f2ad 100644
--- a/tests/sys/netlink/test_snl_generic.c
+++ b/tests/sys/netlink/test_snl_generic.c
@@ -11,6 +11,10 @@
#include <atf-c.h>
+static const struct snl_hdr_parser *snl_all_genl_parsers[] = {
+ &_genl_ctrl_getfam_parser, &_genl_ctrl_mc_parser,
+};
+
static void
require_netlink(void)
{
diff --git a/tests/sys/netpfil/pf/frag6.py b/tests/sys/netpfil/pf/frag6.py
index 108b53874d0b..c9a71f73c0cf 100644
--- a/tests/sys/netpfil/pf/frag6.py
+++ b/tests/sys/netpfil/pf/frag6.py
@@ -141,3 +141,57 @@ class TestFrag6_Overlap(VnetTestTemplate):
for p in packets:
p.show()
assert not p.getlayer(sp.ICMPv6EchoReply)
+
+class TestFrag6_RouteTo(VnetTestTemplate):
+ REQUIRED_MODULES = ["pf"]
+ TOPOLOGY = {
+ "vnet1": {"ifaces": ["if1"]},
+ "vnet2": {"ifaces": ["if1", "if2"]},
+ "vnet3": {"ifaces": ["if2"]},
+ "if1": {"prefixes6": [("2001:db8::1/64", "2001:db8::2/64")]},
+ "if2": {"prefixes6": [("2001:db8:1::1/64", "2001:db8:1::2/64")]},
+ }
+
+ def vnet2_handler(self, vnet):
+ if2name = vnet.iface_alias_map["if2"].name
+ ToolsHelper.print_output("/sbin/pfctl -e")
+ ToolsHelper.print_output("/sbin/pfctl -x loud")
+ ToolsHelper.pf_rules([
+ "scrub fragment reassemble",
+ "pass in route-to (%s 2001:db8:1::2) from 2001:db8::1 to 2001:db8:666::1" % if2name,
+ ])
+
+ ToolsHelper.print_output("/sbin/ifconfig %s mtu 1300" % if2name)
+ ToolsHelper.print_output("/sbin/sysctl net.inet6.ip6.forwarding=1")
+
+ def vnet3_handler(self, vnet):
+ pass
+
+ def test_too_big(self):
+ ToolsHelper.print_output("/sbin/route add -6 default 2001:db8::2")
+
+ # Import in the correct vnet, so at to not confuse Scapy
+ import scapy.all as sp
+
+ pkt = sp.IPv6(dst="2001:db8:666::1") \
+ / sp.ICMPv6EchoRequest(data=sp.raw(bytes.fromhex('f0') * 3000))
+ frags = sp.fragment6(pkt, 1320)
+
+ reply = sp.sr1(frags, timeout=3)
+ if reply:
+ reply.show()
+
+ assert reply
+
+ ip6 = reply.getlayer(sp.IPv6)
+ icmp6 = reply.getlayer(sp.ICMPv6PacketTooBig)
+ err_ip6 = reply.getlayer(sp.IPerror6)
+
+ assert ip6
+ assert ip6.src == "2001:db8::2"
+ assert ip6.dst == "2001:db8::1"
+ assert icmp6
+ assert icmp6.mtu == 1300
+ assert err_ip6
+ assert err_ip6.src == "2001:db8::1"
+ assert err_ip6.dst == "2001:db8:666::1"
diff --git a/tools/boot/full-test.sh b/tools/boot/full-test.sh
index 370088f120bb..c8669cf3f6ec 100644
--- a/tools/boot/full-test.sh
+++ b/tools/boot/full-test.sh
@@ -51,9 +51,11 @@ case $(uname) in
else
die "Can't find the make wrapper"
fi
+ qemu_bin=/opt/homebrew/bin
;;
FreeBSD)
MAKE=make
+ qemu_bin=/usr/local/bin
;;
# linux) not yet
*)
@@ -71,12 +73,6 @@ MTREE=$(SHELL="which mtree" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No mt
# MAKE=$(SHELL="which make" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No make, try buildworld first"
-# hack -- I have extra junk in my qemu, but it's not needed to recreate things
-if [ $(whoami) = imp ]; then
- qemu_bin=/home/imp/git/qemu/00-build
-else
- qemu_bin=/usr/local/bin
-fi
# All the architectures under test
# Note: we can't yet do armv7 because we don't have a good iso for it and would
@@ -163,7 +159,7 @@ make_minimal_freebsd_tree()
# Pretend we don't have a separate /usr
ln -s . ${dir}/usr
# snag the binaries for my simple /etc/rc file
- tar -C ${dir} -xf ${CACHE}/$file sbin/reboot sbin/halt sbin/init bin/sh sbin/sysctl \
+ tar -C ${dir} -xf ${CACHE}/$file sbin/fastboot sbin/reboot sbin/halt sbin/init bin/sh sbin/sysctl \
lib/libncursesw.so.9 lib/libc.so.7 lib/libedit.so.8 libexec/ld-elf.so.1
# My simple etc/rc
@@ -366,7 +362,7 @@ make_linuxboot_scripts()
if [ ${bios_code} -ot /usr/local/share/qemu/edk2-x86_64-code.fd ]; then
cp /usr/local/share/qemu/edk2-x86_64-code.fd ${bios_code}
# vars file works on both 32 and 64 bit x86
- cp /usr/local/share/qemu/edk2-i386-vars.fd ${bios_vars}
+# cp /usr/local/share/qemu/edk2-i386-vars.fd ${bios_vars}
fi
;;
aarch64)
@@ -448,7 +444,8 @@ EOF
make_freebsd_esps()
{
# At the moment, we have just three (armv7 could also be here too, but we're not doing that)
- for a in amd64:amd64 arm64:aarch64 riscv:riscv64; do
+# for a in amd64:amd64 arm64:aarch64 riscv:riscv64; do
+ for a in amd64:amd64 arm64:aarch64; do
m=${a%%:*}
ma=${a##*:}
ma_combo="${m}"
@@ -470,7 +467,8 @@ make_freebsd_images()
{
# ESP variant: In this variant, riscv, amd64 and arm64 are created more or
# less the same way. UEFI + ACPI implementations
- for a in amd64:amd64 arm64:aarch64 riscv:riscv64; do
+# for a in amd64:amd64 arm64:aarch64 riscv:riscv64; do
+ for a in amd64:amd64 arm64:aarch64; do
m=${a%%:*}
ma=${a##*:}
ma_combo="${m}"
@@ -495,6 +493,7 @@ EOF
set -x
+if false; then
# BIOS i386
a=i386:i386
m=${a%%:*}
@@ -541,6 +540,7 @@ EOF
-p freebsd-boot:=${dir2}/boot/boot1.hfs \
-p freebsd-ufs:=${ufs} \
-o ${img}
+fi
set +x
}
@@ -562,7 +562,7 @@ make_freebsd_scripts()
if [ ${bios_code} -ot /usr/local/share/qemu/edk2-x86_64-code.fd ]; then
cp /usr/local/share/qemu/edk2-x86_64-code.fd ${bios_code}
# vars file works on both 32 and 64 bit x86
- cp /usr/local/share/qemu/edk2-i386-vars.fd ${bios_vars}
+# cp /usr/local/share/qemu/edk2-i386-vars.fd ${bios_vars}
fi
;;
aarch64)
@@ -609,6 +609,7 @@ EOF
esac
done
+if false; then
set -x
a=powerpc:powerpc
m=${a%%:*}
@@ -644,6 +645,7 @@ ${qemu_bin}/qemu-system-i386 -m 1g \\
-monitor telnet::4444,server,nowait \\
-serial stdio \$*
EOF
+fi
}
# The smallest FAT32 filesystem is 33292 KB
diff --git a/tools/build/test-includes/Makefile b/tools/build/test-includes/Makefile
index 2c25e0fb32ce..5c45fd7daa4f 100644
--- a/tools/build/test-includes/Makefile
+++ b/tools/build/test-includes/Makefile
@@ -26,6 +26,9 @@ CFLAGS.event.c= -D_WANT_KEVENT32 -D_WANT_FREEBSD11_KEVENT
# details like __inline that the header files must follow to support C89.
CFLAGS+=-ansi
+# Make sure we're pulling in headers from the src tree.
+CFLAGS+=-I${SRCTOP}/sys
+
.include "badfiles.inc"
.for h c in ${HDRS:@x@$x ${x:S,/,_,g:R}.c@}
diff --git a/tools/build/test-includes/badfiles.inc b/tools/build/test-includes/badfiles.inc
index 1e5182e40911..2ed61c32aa4e 100644
--- a/tools/build/test-includes/badfiles.inc
+++ b/tools/build/test-includes/badfiles.inc
@@ -65,11 +65,8 @@ BADHDRS= \
sys/kobj.h \
sys/ksem.h \
sys/ktls.h \
- sys/ktrace.h \
sys/libkern.h \
sys/link_aout.h \
- sys/linker.h \
- sys/linker_set.h \
sys/lock.h \
sys/lock_profile.h \
sys/lockf.h \
@@ -77,7 +74,6 @@ BADHDRS= \
sys/loginclass.h \
sys/mbuf.h \
sys/md4.h \
- sys/md5.h \
sys/mdioctl.h \
sys/memdesc.h \
sys/memrange.h \
@@ -85,7 +81,6 @@ BADHDRS= \
sys/module_khelp.h \
sys/mpt_ioctl.h \
sys/msgbuf.h \
- sys/mutex.h \
sys/namei.h \
sys/osd.h \
sys/pciio.h \
@@ -106,7 +101,6 @@ BADHDRS= \
sys/runq.h \
sys/rwlock.h \
sys/sbuf.h \
- sys/sema.h \
sys/sf_buf.h \
sys/sglist.h \
sys/sigio.h \
@@ -117,10 +111,8 @@ BADHDRS= \
sys/sockopt.h \
sys/stack.h \
sys/stats.h \
- sys/sx.h \
sys/syscallsubr.h \
sys/syslimits.h \
- sys/systm.h \
sys/taskqueue.h \
sys/terminal.h \
sys/termios.h \
@@ -155,13 +147,11 @@ BADHDRS= \
net/if_llc.h \
net/if_media.h \
net/if_mib.h \
- net/if_pfsync.h \
net/if_tap.h \
net/if_tun.h \
net/if_var.h \
net/if_vlan_var.h \
net/iflib.h \
- net/iflib_private.h \
net/ifq.h \
net/mp_ring.h \
net/mppc.h \
@@ -172,9 +162,7 @@ BADHDRS= \
net/paravirt.h \
net/pfil.h \
net/pfkeyv2.h \
- net/pfvar.h \
net/radix.h \
- net/raw_cb.h \
net/rndis.h \
net/route.h \
net/rss_config.h \
@@ -258,7 +246,6 @@ BADHDRS= \
netinet/in_rss.h \
netinet/in_systm.h \
netinet/in_var.h \
- netinet/ip.h \
netinet/ip6.h \
netinet/ip_carp.h \
netinet/ip_dummynet.h \
@@ -275,13 +262,11 @@ BADHDRS= \
netinet/sctp_pcb.h \
netinet/sctp_structs.h \
netinet/sctp_sysctl.h \
- netinet/tcp_debug.h \
netinet/tcp_hpts.h \
netinet/tcp_log_buf.h \
netinet/tcp_lro.h \
netinet/tcp_offload.h \
netinet/tcp_ratelimit.h \
- netinet/tcp_var.h \
netinet/tcpip.h \
netinet/toecore.h \
netinet/udplite.h \
@@ -293,7 +278,6 @@ BADHDRS= \
netinet6/ip6.h \
netinet6/ip6_mroute.h \
netinet6/ip6_var.h \
- netinet6/ip6protosw.h \
netinet6/ip_fw_nat64.h \
netinet6/ip_fw_nptv6.h \
netinet6/mld6.h \
@@ -313,7 +297,6 @@ BADHDRS= \
netipsec/ipsec6.h \
netipsec/key_debug.h \
netipsec/keysock.h \
- netipsec/xform.h \
netsmb/netbios.h \
netsmb/smb.h \
netsmb/smb_conn.h \
diff --git a/tools/regression/tls/ttls3/Makefile b/tools/regression/tls/ttls3/Makefile
index ef00223e4c25..03413ea8e1d6 100644
--- a/tools/regression/tls/ttls3/Makefile
+++ b/tools/regression/tls/ttls3/Makefile
@@ -1,6 +1,6 @@
all: ttls3
-LDFLAGS=-shared -Bsymbolic --allow-shlib-undefined
+LDFLAGS+=-shared -Bsymbolic --allow-shlib-undefined
CFLAGS+= -lpthread
CFLAGS+= -Wl,--rpath=${.OBJDIR}
diff --git a/tools/tools/nanobsd/rescue/common b/tools/tools/nanobsd/rescue/common
index 5fcf5c19b882..15bf10f5e67d 100644
--- a/tools/tools/nanobsd/rescue/common
+++ b/tools/tools/nanobsd/rescue/common
@@ -1,15 +1,15 @@
#
#
-NANO_SRC=$(pwd)
-NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/rescue}
-NANO_OBJ=${NANO_SRC}/../nanobsd-builds/${NANO_NAME}/obj
+#NANO_SRC=$(pwd)
+#NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/rescue}
+#NANO_OBJ=${NANO_SRC}/../nanobsd-builds/${NANO_NAME}/obj
NANO_TOOLS=`pwd`
NANO_PACKAGE_DIR=`pwd`/Pkg
NANO_RAM_TMPVARSIZE=40960
NANO_PMAKE="make -j 8"
NANO_LABEL="rescue"
NANO_RAM_TMPVARSIZE=40960
-NANO_MEDIASIZE="3932160"
+NANO_MEDIASIZE="6000000"
NANO_SECTS="63"
NANO_HEADS="16"
NANO_IMAGES="2"
@@ -31,10 +31,12 @@ CONF_INSTALL='
CONF_WORLD='
CFLAGS=-O -pipe
# We do not need these for rescue
-WITHOUT_LIB32=true
WITHOUT_TESTS=true
-WITHOUT_DEBUG_FILES=t
-WITHOUT_KERNEL_SYMBOLS=t
+WITHOUT_DEBUG_FILES=true
+WITHOUT_KERNEL_SYMBOLS=true
+WITHOUT_CLANG_FULL=true
+WITH_CLANG_EXTRAS=true
+WITHOUT_LIB32=true
'
# Functions
@@ -50,14 +52,14 @@ toUpper() {
customize_cmd cust_allow_ssh_root
customize_cmd cust_install_files
-cust_ld32_cfg () (
- cd ${NANO_WORLDDIR}/libexec
- if [ \! -f ld-elf32.so.1 ]; then
- ln -s ld-elf.so.1 ld-elf32.so.1
- fi
-)
-customize_cmd cust_ld32_cfg
-
+#cust_ld32_cfg () (
+# cd ${NANO_WORLDDIR}/libexec
+# if [ \! -f ld-elf32.so.1 ]; then
+# ln -s ld-elf.so.1 ld-elf32.so.1
+# fi
+#)
+#customize_cmd cust_ld32_cfg
+#
#cust_boot_cfg () (
# cd ${NANO_WORLDDIR}
# echo "-S115200 -h" > boot.config
@@ -67,7 +69,7 @@ customize_cmd cust_ld32_cfg
#)
#customize_cmd cust_boot_cfg
-customize_cmd cust_pkgng
+#customize_cmd cust_pkgng
cust_etc_cfg () (
cd ${NANO_WORLDDIR}
diff --git a/tools/tools/net80211/w00t/Makefile.inc b/tools/tools/net80211/w00t/Makefile.inc
index 69c06542d367..fcde408757e6 100644
--- a/tools/tools/net80211/w00t/Makefile.inc
+++ b/tools/tools/net80211/w00t/Makefile.inc
@@ -1,7 +1,7 @@
W00T= ../libw00t
# NB: we get crc32 from -lz
DPADD= ${W00T}/libw00t.a
-LDFLAGS= -L${W00T}
+LDFLAGS+= -L${W00T}
LDADD= -lw00t
LIBADD+= crypto z
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index b9e4d6c1153a..87896a2c0781 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -263,14 +263,14 @@ SUBDIR.${MK_TOOLCHAIN}+= ctags
.if ${MK_LLVM_CXXFILT} == "no"
SUBDIR.${MK_TOOLCHAIN}+= cxxfilt
.endif
+# ELF Tool Chain elfcopy required for EFI objects (PR280771)
+SUBDIR.${MK_TOOLCHAIN}+= elfcopy
SUBDIR.${MK_TOOLCHAIN}+= file2c
SUBDIR.${MK_TOOLCHAIN}+= gprof
SUBDIR.${MK_TOOLCHAIN}+= indent
SUBDIR.${MK_TOOLCHAIN}+= lex
SUBDIR.${MK_TOOLCHAIN}+= lorder
SUBDIR.${MK_TOOLCHAIN}+= mkstr
-# ELF Tool Chain elfcopy required for EFI objects (PR280771)
-SUBDIR.${MK_TOOLCHAIN}+= objcopy
SUBDIR.${MK_TOOLCHAIN}+= rpcgen
SUBDIR.${MK_TOOLCHAIN}+= unifdef
SUBDIR.${MK_TOOLCHAIN}+= xstr
diff --git a/usr.bin/dtc/Makefile b/usr.bin/dtc/Makefile
index 9b1aff13511f..d7661ae164c3 100644
--- a/usr.bin/dtc/Makefile
+++ b/usr.bin/dtc/Makefile
@@ -6,8 +6,6 @@ WARNS?= 3
CXXFLAGS+= -fno-rtti -fno-exceptions
-CXXSTD= c++17
-
NO_SHARED?=NO
.include <bsd.prog.mk>
diff --git a/usr.bin/objcopy/Makefile b/usr.bin/elfcopy/Makefile
index 2f3386d95ebe..2f3386d95ebe 100644
--- a/usr.bin/objcopy/Makefile
+++ b/usr.bin/elfcopy/Makefile
diff --git a/usr.bin/objcopy/Makefile.depend b/usr.bin/elfcopy/Makefile.depend
index 898aa8b2b146..898aa8b2b146 100644
--- a/usr.bin/objcopy/Makefile.depend
+++ b/usr.bin/elfcopy/Makefile.depend
diff --git a/usr.sbin/ctld/Makefile b/usr.sbin/ctld/Makefile
index f96f3152e061..79c69c95fbb1 100644
--- a/usr.sbin/ctld/Makefile
+++ b/usr.sbin/ctld/Makefile
@@ -14,6 +14,7 @@ CFLAGS+= -I${SRCTOP}/sys/dev/iscsi
CFLAGS+= -I${SRCTOP}/lib/libiscsiutil
#CFLAGS+= -DICL_KERNEL_PROXY
NO_WCAST_ALIGN=
+CXXWARNFLAGS.gcc= -Wno-shadow
MAN= ctld.8 ctl.conf.5
LIBADD= bsdxml iscsiutil md sbuf util ucl m nv
diff --git a/usr.sbin/ctld/conf.cc b/usr.sbin/ctld/conf.cc
index ac82d06ad8fa..e86b44ee5004 100644
--- a/usr.sbin/ctld/conf.cc
+++ b/usr.sbin/ctld/conf.cc
@@ -126,25 +126,13 @@ _auth_group_set_type(struct auth_group *ag, const char *str)
} else if (strcmp(str, "chap-mutual") == 0) {
type = AG_TYPE_CHAP_MUTUAL;
} else {
- if (ag->ag_name != NULL)
- log_warnx("invalid auth-type \"%s\" for auth-group "
- "\"%s\"", str, ag->ag_name);
- else
- log_warnx("invalid auth-type \"%s\" for target "
- "\"%s\"", str, ag->ag_target->t_name);
+ log_warnx("invalid auth-type \"%s\" for %s", str, ag->ag_label);
return (false);
}
if (ag->ag_type != AG_TYPE_UNKNOWN && ag->ag_type != type) {
- if (ag->ag_name != NULL) {
- log_warnx("cannot set auth-type to \"%s\" for "
- "auth-group \"%s\"; already has a different "
- "type", str, ag->ag_name);
- } else {
- log_warnx("cannot set auth-type to \"%s\" for target "
- "\"%s\"; already has a different type",
- str, ag->ag_target->t_name);
- }
+ log_warnx("cannot set auth-type to \"%s\" for %s; "
+ "already has a different type", str, ag->ag_label);
return (false);
}
@@ -531,10 +519,9 @@ target_add_chap(const char *user, const char *secret)
return (false);
}
} else {
- target->t_auth_group = auth_group_new(conf, NULL);
+ target->t_auth_group = auth_group_new(conf, target);
if (target->t_auth_group == NULL)
return (false);
- target->t_auth_group->ag_target = target;
}
return (auth_new_chap(target->t_auth_group, user, secret));
}
@@ -550,10 +537,9 @@ target_add_chap_mutual(const char *user, const char *secret,
return (false);
}
} else {
- target->t_auth_group = auth_group_new(conf, NULL);
+ target->t_auth_group = auth_group_new(conf, target);
if (target->t_auth_group == NULL)
return (false);
- target->t_auth_group->ag_target = target;
}
return (auth_new_chap_mutual(target->t_auth_group, user, secret, user2,
secret2));
@@ -569,10 +555,9 @@ target_add_initiator_name(const char *name)
return (false);
}
} else {
- target->t_auth_group = auth_group_new(conf, NULL);
+ target->t_auth_group = auth_group_new(conf, target);
if (target->t_auth_group == NULL)
return (false);
- target->t_auth_group->ag_target = target;
}
return (auth_name_new(target->t_auth_group, name));
}
@@ -588,10 +573,9 @@ target_add_initiator_portal(const char *addr)
return (false);
}
} else {
- target->t_auth_group = auth_group_new(conf, NULL);
+ target->t_auth_group = auth_group_new(conf, target);
if (target->t_auth_group == NULL)
return (false);
- target->t_auth_group->ag_target = target;
}
return (auth_portal_new(target->t_auth_group, addr));
}
@@ -701,10 +685,9 @@ target_set_auth_type(const char *type)
return (false);
}
} else {
- target->t_auth_group = auth_group_new(conf, NULL);
+ target->t_auth_group = auth_group_new(conf, target);
if (target->t_auth_group == NULL)
return (false);
- target->t_auth_group->ag_target = target;
}
return (_auth_group_set_type(target->t_auth_group, type));
}
diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc
index f07ee7b34cd7..ff23db6c5293 100644
--- a/usr.sbin/ctld/ctld.cc
+++ b/usr.sbin/ctld/ctld.cc
@@ -182,63 +182,21 @@ auth_find(const struct auth_group *ag, const char *user)
}
static void
-auth_check_secret_length(struct auth *auth)
+auth_check_secret_length(const struct auth_group *ag, const char *user,
+ const char *secret, const char *secret_type)
{
size_t len;
- len = strlen(auth->a_secret);
+ len = strlen(secret);
if (len > 16) {
- if (auth->a_auth_group->ag_name != NULL)
- log_warnx("secret for user \"%s\", auth-group \"%s\", "
- "is too long; it should be at most 16 characters "
- "long", auth->a_user, auth->a_auth_group->ag_name);
- else
- log_warnx("secret for user \"%s\", target \"%s\", "
- "is too long; it should be at most 16 characters "
- "long", auth->a_user,
- auth->a_auth_group->ag_target->t_name);
+ log_warnx("%s for user \"%s\", %s, is too long; it should be "
+ "at most 16 characters long", secret_type, user,
+ ag->ag_label);
}
if (len < 12) {
- if (auth->a_auth_group->ag_name != NULL)
- log_warnx("secret for user \"%s\", auth-group \"%s\", "
- "is too short; it should be at least 12 characters "
- "long", auth->a_user,
- auth->a_auth_group->ag_name);
- else
- log_warnx("secret for user \"%s\", target \"%s\", "
- "is too short; it should be at least 12 characters "
- "long", auth->a_user,
- auth->a_auth_group->ag_target->t_name);
- }
-
- if (auth->a_mutual_secret != NULL) {
- len = strlen(auth->a_mutual_secret);
- if (len > 16) {
- if (auth->a_auth_group->ag_name != NULL)
- log_warnx("mutual secret for user \"%s\", "
- "auth-group \"%s\", is too long; it should "
- "be at most 16 characters long",
- auth->a_user, auth->a_auth_group->ag_name);
- else
- log_warnx("mutual secret for user \"%s\", "
- "target \"%s\", is too long; it should "
- "be at most 16 characters long",
- auth->a_user,
- auth->a_auth_group->ag_target->t_name);
- }
- if (len < 12) {
- if (auth->a_auth_group->ag_name != NULL)
- log_warnx("mutual secret for user \"%s\", "
- "auth-group \"%s\", is too short; it "
- "should be at least 12 characters long",
- auth->a_user, auth->a_auth_group->ag_name);
- else
- log_warnx("mutual secret for user \"%s\", "
- "target \"%s\", is too short; it should be "
- "at least 12 characters long",
- auth->a_user,
- auth->a_auth_group->ag_target->t_name);
- }
+ log_warnx("%s for user \"%s\", %s, is too short; it should be "
+ "at least 12 characters long", secret_type, user,
+ ag->ag_label);
}
}
@@ -251,22 +209,17 @@ auth_new_chap(struct auth_group *ag, const char *user,
if (ag->ag_type == AG_TYPE_UNKNOWN)
ag->ag_type = AG_TYPE_CHAP;
if (ag->ag_type != AG_TYPE_CHAP) {
- if (ag->ag_name != NULL)
- log_warnx("cannot mix \"chap\" authentication with "
- "other types for auth-group \"%s\"", ag->ag_name);
- else
- log_warnx("cannot mix \"chap\" authentication with "
- "other types for target \"%s\"",
- ag->ag_target->t_name);
+ log_warnx("cannot mix \"chap\" authentication with "
+ "other types for %s", ag->ag_label);
return (false);
}
+ auth_check_secret_length(ag, user, secret, "secret");
+
auth = auth_new(ag);
auth->a_user = checked_strdup(user);
auth->a_secret = checked_strdup(secret);
- auth_check_secret_length(auth);
-
return (true);
}
@@ -279,25 +232,20 @@ auth_new_chap_mutual(struct auth_group *ag, const char *user,
if (ag->ag_type == AG_TYPE_UNKNOWN)
ag->ag_type = AG_TYPE_CHAP_MUTUAL;
if (ag->ag_type != AG_TYPE_CHAP_MUTUAL) {
- if (ag->ag_name != NULL)
- log_warnx("cannot mix \"chap-mutual\" authentication "
- "with other types for auth-group \"%s\"",
- ag->ag_name);
- else
- log_warnx("cannot mix \"chap-mutual\" authentication "
- "with other types for target \"%s\"",
- ag->ag_target->t_name);
+ log_warnx("cannot mix \"chap-mutual\" authentication "
+ "with other types for %s", ag->ag_label);
return (false);
}
+ auth_check_secret_length(ag, user, secret, "secret");
+ auth_check_secret_length(ag, user, secret2, "mutual secret");
+
auth = auth_new(ag);
auth->a_user = checked_strdup(user);
auth->a_secret = checked_strdup(secret);
auth->a_mutual_user = checked_strdup(user2);
auth->a_mutual_secret = checked_strdup(secret2);
- auth_check_secret_length(auth);
-
return (true);
}
@@ -371,14 +319,17 @@ auth_portal_new(struct auth_group *ag, const char *portal)
ap->ap_initiator_portal = checked_strdup(portal);
mask = str = checked_strdup(portal);
net = strsep(&mask, "/");
- if (net[0] == '[')
+ if (net[0] == '[') {
net++;
- len = strlen(net);
- if (len == 0)
- goto error;
- if (net[len - 1] == ']')
+ len = strlen(net);
+ if (len < 2)
+ goto error;
+ if (net[len - 1] != ']')
+ goto error;
net[len - 1] = 0;
- if (strchr(net, ':') != NULL) {
+ } else if (net[0] == '\0')
+ goto error;
+ if (str[0] == '[' || strchr(net, ':') != NULL) {
struct sockaddr_in6 *sin6 =
(struct sockaddr_in6 *)&ap->ap_sa;
@@ -398,6 +349,8 @@ auth_portal_new(struct auth_group *ag, const char *portal)
dm = 32;
}
if (mask != NULL) {
+ if (mask[0] == '\0')
+ goto error;
m = strtol(mask, &tmp, 0);
if (m < 0 || m > dm || tmp[0] != 0)
goto error;
@@ -484,24 +437,17 @@ auth_portal_check(const struct auth_group *ag, const struct sockaddr_storage *sa
return (true);
}
-struct auth_group *
-auth_group_new(struct conf *conf, const char *name)
+static struct auth_group *
+auth_group_create(struct conf *conf, const char *name, char *label)
{
struct auth_group *ag;
- if (name != NULL) {
- ag = auth_group_find(conf, name);
- if (ag != NULL) {
- log_warnx("duplicated auth-group \"%s\"", name);
- return (NULL);
- }
- }
-
ag = reinterpret_cast<struct auth_group *>(calloc(1, sizeof(*ag)));
if (ag == NULL)
log_err(1, "calloc");
if (name != NULL)
ag->ag_name = checked_strdup(name);
+ ag->ag_label = label;
TAILQ_INIT(&ag->ag_auths);
TAILQ_INIT(&ag->ag_names);
TAILQ_INIT(&ag->ag_portals);
@@ -511,6 +457,31 @@ auth_group_new(struct conf *conf, const char *name)
return (ag);
}
+struct auth_group *
+auth_group_new(struct conf *conf, const char *name)
+{
+ struct auth_group *ag;
+ char *label;
+
+ ag = auth_group_find(conf, name);
+ if (ag != NULL) {
+ log_warnx("duplicated auth-group \"%s\"", name);
+ return (NULL);
+ }
+
+ asprintf(&label, "auth-group \"%s\"", name);
+ return (auth_group_create(conf, name, label));
+}
+
+struct auth_group *
+auth_group_new(struct conf *conf, struct target *target)
+{
+ char *label;
+
+ asprintf(&label, "target \"%s\"", target->t_name);
+ return (auth_group_create(conf, NULL, label));
+}
+
void
auth_group_delete(struct auth_group *ag)
{
@@ -527,6 +498,7 @@ auth_group_delete(struct auth_group *ag)
TAILQ_FOREACH_SAFE(auth_portal, &ag->ag_portals, ap_next,
auth_portal_tmp)
auth_portal_delete(auth_portal);
+ free(ag->ag_label);
free(ag->ag_name);
free(ag);
}
@@ -1380,68 +1352,6 @@ connection_new(struct portal *portal, int fd, const char *host,
return (conn);
}
-#if 0
-static void
-options_print(const char *prefix, nvlist_t *nvl)
-{
- const char *name;
- void *cookie;
-
- cookie = NULL;
- while ((name = nvlist_next(nvl, NULL, &cookie)) != NULL) {
- fprintf(stderr, "%soption %s %s\n", prefix, name,
- nvlist_get_string(nvl, name));
- }
-}
-
-static void
-conf_print(struct conf *conf)
-{
- struct auth_group *ag;
- struct auth *auth;
- struct auth_name *auth_name;
- struct auth_portal *auth_portal;
- struct portal_group *pg;
- struct portal *portal;
- struct target *targ;
- struct lun *lun;
-
- TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) {
- fprintf(stderr, "auth-group %s {\n", ag->ag_name);
- TAILQ_FOREACH(auth, &ag->ag_auths, a_next)
- fprintf(stderr, "\t chap-mutual %s %s %s %s\n",
- auth->a_user, auth->a_secret,
- auth->a_mutual_user, auth->a_mutual_secret);
- TAILQ_FOREACH(auth_name, &ag->ag_names, an_next)
- fprintf(stderr, "\t initiator-name %s\n",
- auth_name->an_initiator_name);
- TAILQ_FOREACH(auth_portal, &ag->ag_portals, ap_next)
- fprintf(stderr, "\t initiator-portal %s\n",
- auth_portal->ap_initiator_portal);
- fprintf(stderr, "}\n");
- }
- TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) {
- fprintf(stderr, "portal-group %s {\n", pg->pg_name);
- TAILQ_FOREACH(portal, &pg->pg_portals, p_next)
- fprintf(stderr, "\t listen %s\n", portal->p_listen);
- options_print("\t", pg->pg_options);
- fprintf(stderr, "}\n");
- }
- TAILQ_FOREACH(lun, &conf->conf_luns, l_next) {
- fprintf(stderr, "\tlun %s {\n", lun->l_name);
- fprintf(stderr, "\t\tpath %s\n", lun->l_path);
- options_print("\t\t", lun->l_options);
- fprintf(stderr, "\t}\n");
- }
- TAILQ_FOREACH(targ, &conf->conf_targets, t_next) {
- fprintf(stderr, "target %s {\n", targ->t_name);
- if (targ->t_alias != NULL)
- fprintf(stderr, "\t alias %s\n", targ->t_alias);
- fprintf(stderr, "}\n");
- }
-}
-#endif
-
static bool
conf_verify_lun(struct lun *lun)
{
@@ -1571,11 +1481,6 @@ conf_verify(struct conf *conf)
}
}
TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) {
- if (ag->ag_name == NULL)
- assert(ag->ag_target != NULL);
- else
- assert(ag->ag_target == NULL);
-
found = false;
TAILQ_FOREACH(targ, &conf->conf_targets, t_next) {
if (targ->t_auth_group == ag) {
@@ -2601,7 +2506,7 @@ main(int argc, char **argv)
if (tmpconf == NULL) {
log_warnx("configuration error, "
"continuing with old configuration");
- } else if (new_pports_from_conf(tmpconf, &kports)) {
+ } else if (!new_pports_from_conf(tmpconf, &kports)) {
log_warnx("Error associating physical ports, "
"continuing with old configuration");
conf_delete(tmpconf);
diff --git a/usr.sbin/ctld/ctld.h b/usr.sbin/ctld/ctld.h
index c76708daafe5..2cc9139fed1d 100644
--- a/usr.sbin/ctld/ctld.h
+++ b/usr.sbin/ctld/ctld.h
@@ -82,7 +82,7 @@ struct auth_group {
TAILQ_ENTRY(auth_group) ag_next;
struct conf *ag_conf;
char *ag_name;
- struct target *ag_target;
+ char *ag_label;
int ag_type;
TAILQ_HEAD(, auth) ag_auths;
TAILQ_HEAD(, auth_name) ag_names;
@@ -257,6 +257,8 @@ void conf_start(struct conf *new_conf);
bool conf_verify(struct conf *conf);
struct auth_group *auth_group_new(struct conf *conf, const char *name);
+struct auth_group *auth_group_new(struct conf *conf,
+ struct target *target);
void auth_group_delete(struct auth_group *ag);
struct auth_group *auth_group_find(const struct conf *conf,
const char *name);
diff --git a/usr.sbin/ctld/kernel.cc b/usr.sbin/ctld/kernel.cc
index 9ddf22b9f4e0..0cd0eaff6c6f 100644
--- a/usr.sbin/ctld/kernel.cc
+++ b/usr.sbin/ctld/kernel.cc
@@ -40,6 +40,7 @@
#include <sys/param.h>
#include <sys/capsicum.h>
#include <sys/callout.h>
+#include <sys/cnv.h>
#include <sys/ioctl.h>
#include <sys/linker.h>
#include <sys/module.h>
@@ -635,12 +636,12 @@ retry_port:
NULL) {
if (strcmp(key, "file") == 0 ||
strcmp(key, "dev") == 0) {
- cl->l_path = nvlist_take_string(lun->attr_list,
- key);
+ cl->l_path = checked_strdup(
+ cnvlist_get_string(cookie));
continue;
}
nvlist_add_string(cl->l_options, key,
- nvlist_get_string(lun->attr_list, key));
+ cnvlist_get_string(cookie));
error = nvlist_error(cl->l_options);
if (error != 0)
log_warnc(error, "unable to add CTL lun option "
diff --git a/usr.sbin/ctld/login.cc b/usr.sbin/ctld/login.cc
index 84d329964ada..961f57eb03fb 100644
--- a/usr.sbin/ctld/login.cc
+++ b/usr.sbin/ctld/login.cc
@@ -1003,12 +1003,8 @@ login(struct ctld_connection *conn)
} else {
assert(conn->conn_session_type == CONN_SESSION_TYPE_DISCOVERY);
ag = pg->pg_discovery_auth_group;
- if (ag->ag_name != NULL) {
- log_debugx("initiator requests "
- "discovery session; auth-group \"%s\"", ag->ag_name);
- } else {
- log_debugx("initiator requests discovery session");
- }
+ log_debugx("initiator requests discovery session; %s",
+ ag->ag_label);
}
if (ag->ag_type == AG_TYPE_DENY) {
diff --git a/usr.sbin/ctld/uclparse.cc b/usr.sbin/ctld/uclparse.cc
index 05cfcc8df7e7..1eb9f7736e4b 100644
--- a/usr.sbin/ctld/uclparse.cc
+++ b/usr.sbin/ctld/uclparse.cc
@@ -100,14 +100,14 @@ uclparse_chap_mutual(const char *ag_name, const ucl_object_t *obj)
}
mutual_user = ucl_object_find_key(obj, "mutual-user");
- if (!user || user->type != UCL_STRING) {
+ if (!mutual_user || mutual_user->type != UCL_STRING) {
log_warnx("chap-mutual section in auth-group \"%s\" is missing "
"\"mutual-user\" string key", ag_name);
return (false);
}
mutual_secret = ucl_object_find_key(obj, "mutual-secret");
- if (!secret || secret->type != UCL_STRING) {
+ if (!mutual_secret || mutual_secret->type != UCL_STRING) {
log_warnx("chap-mutual section in auth-group \"%s\" is missing "
"\"mutual-secret\" string key", ag_name);
return (false);
@@ -165,14 +165,14 @@ uclparse_target_chap_mutual(const char *t_name, const ucl_object_t *obj)
}
mutual_user = ucl_object_find_key(obj, "mutual-user");
- if (!user || user->type != UCL_STRING) {
+ if (!mutual_user || mutual_user->type != UCL_STRING) {
log_warnx("chap-mutual section in target \"%s\" is missing "
"\"mutual-user\" string key", t_name);
return (false);
}
mutual_secret = ucl_object_find_key(obj, "mutual-secret");
- if (!secret || secret->type != UCL_STRING) {
+ if (!mutual_secret || mutual_secret->type != UCL_STRING) {
log_warnx("chap-mutual section in target \"%s\" is missing "
"\"mutual-secret\" string key", t_name);
return (false);
@@ -570,9 +570,6 @@ uclparse_dscp(const char *group_type, const char *pg_name,
return (portal_group_set_dscp(ucl_object_toint(obj)));
key = ucl_object_tostring(obj);
- if (strcmp(key, "0x") == 0)
- return (portal_group_set_dscp(strtol(key + 2, NULL, 16)));
-
if (strcmp(key, "be") == 0 || strcmp(key, "cs0") == 0)
portal_group_set_dscp(IPTOS_DSCP_CS0 >> 2);
else if (strcmp(key, "ef") == 0)
diff --git a/usr.sbin/pmc/Makefile b/usr.sbin/pmc/Makefile
index 3f73dd398958..02292917ab57 100644
--- a/usr.sbin/pmc/Makefile
+++ b/usr.sbin/pmc/Makefile
@@ -2,7 +2,6 @@
PROG_CXX= pmc
MAN=
-CXXSTD= c++14
CWARNFLAGS.gcc+= -Wno-redundant-decls
CFLAGS+= -I${SRCTOP}/lib/libpmcstat