aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-22 16:05:13 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-22 16:05:13 +0000
commita4aa656aa587a4bad15e15bf45e149e176c22293 (patch)
tree84af8201df333580b5f95c825487e0313712e887 /sys
parent721fc9d8ec8347cdc7ac9f1aefb44dff3eeb2220 (diff)
parent5c93966020a07834ab882d92c0c28b5397c8dfa7 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/pmap.c14
-rw-r--r--sys/amd64/cloudabi32/cloudabi32_sysvec.c2
-rw-r--r--sys/amd64/cloudabi64/cloudabi64_sysvec.c2
-rw-r--r--sys/amd64/include/cpufunc.h7
-rw-r--r--sys/amd64/vmm/vmm_dev.c2
-rw-r--r--sys/arm/arm/pmap-v6.c253
-rw-r--r--sys/arm/cloudabi32/cloudabi32_sysvec.c2
-rw-r--r--sys/arm/include/pcpu.h11
-rw-r--r--sys/arm/ti/cpsw/if_cpsw.c126
-rw-r--r--sys/arm/ti/cpsw/if_cpswreg.h1
-rw-r--r--sys/arm/ti/cpsw/if_cpswvar.h6
-rw-r--r--sys/arm/xilinx/zy7_ehci.c9
-rw-r--r--sys/arm64/cloudabi64/cloudabi64_sysvec.c2
-rw-r--r--sys/boot/efi/include/efidevp.h30
-rw-r--r--sys/boot/efi/libefi/devpath.c41
-rw-r--r--sys/boot/efi/libefi/efinet.c32
-rw-r--r--sys/boot/efi/libefi/efipart.c5
-rw-r--r--sys/boot/fdt/dts/arm/ufw.dts1
-rw-r--r--sys/boot/fdt/dts/mips/beri-netfpga.dts1
-rw-r--r--sys/boot/fdt/dts/mips/beri-sim.dts1
-rw-r--r--sys/boot/fdt/dts/mips/beripad-de4.dts1
-rw-r--r--sys/boot/fdt/dts/mips/beripad-sockit.dts1
-rw-r--r--sys/cam/ata/ata_da.c16
-rw-r--r--sys/cam/ctl/ctl.c468
-rw-r--r--sys/cam/ctl/ctl.h1
-rw-r--r--sys/cam/ctl/ctl_backend.c71
-rw-r--r--sys/cam/ctl/ctl_backend.h12
-rw-r--r--sys/cam/ctl/ctl_backend_block.c48
-rw-r--r--sys/cam/ctl/ctl_backend_ramdisk.c17
-rw-r--r--sys/cam/ctl/ctl_frontend.c35
-rw-r--r--sys/cam/ctl/ctl_frontend.h11
-rw-r--r--sys/cam/ctl/ctl_frontend_cam_sim.c43
-rw-r--r--sys/cam/ctl/ctl_frontend_ioctl.c18
-rw-r--r--sys/cam/ctl/ctl_frontend_iscsi.c26
-rw-r--r--sys/cam/ctl/ctl_io.h12
-rw-r--r--sys/cam/ctl/ctl_private.h3
-rw-r--r--sys/cam/ctl/ctl_tpc.c91
-rw-r--r--sys/cam/ctl/ctl_tpc_local.c21
-rw-r--r--sys/cam/ctl/scsi_ctl.c14
-rw-r--r--sys/cam/scsi/scsi_all.h2
-rw-r--r--sys/cam/scsi/scsi_da.c13
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c59
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c11
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h2
-rw-r--r--sys/cddl/dev/fbt/arm/fbt_isa.c2
-rw-r--r--sys/compat/cloudabi/cloudabi_file.c32
-rw-r--r--sys/compat/cloudabi/cloudabi_mem.c24
-rw-r--r--sys/compat/cloudabi/cloudabi_proc.c4
-rw-r--r--sys/compat/cloudabi/cloudabi_random.c2
-rw-r--r--sys/compat/cloudabi/cloudabi_sock.c4
-rw-r--r--sys/compat/cloudabi32/cloudabi32_fd.c12
-rw-r--r--sys/compat/cloudabi32/cloudabi32_poll.c8
-rw-r--r--sys/compat/cloudabi32/cloudabi32_proto.h92
-rw-r--r--sys/compat/cloudabi32/cloudabi32_sock.c16
-rw-r--r--sys/compat/cloudabi32/cloudabi32_syscall.h2
-rw-r--r--sys/compat/cloudabi32/cloudabi32_syscalls.c2
-rw-r--r--sys/compat/cloudabi32/cloudabi32_sysent.c2
-rw-r--r--sys/compat/cloudabi32/cloudabi32_systrace_args.c90
-rw-r--r--sys/compat/cloudabi32/cloudabi32_thread.c4
-rw-r--r--sys/compat/cloudabi64/cloudabi64_fd.c12
-rw-r--r--sys/compat/cloudabi64/cloudabi64_poll.c8
-rw-r--r--sys/compat/cloudabi64/cloudabi64_proto.h92
-rw-r--r--sys/compat/cloudabi64/cloudabi64_sock.c16
-rw-r--r--sys/compat/cloudabi64/cloudabi64_syscall.h2
-rw-r--r--sys/compat/cloudabi64/cloudabi64_syscalls.c2
-rw-r--r--sys/compat/cloudabi64/cloudabi64_sysent.c2
-rw-r--r--sys/compat/cloudabi64/cloudabi64_systrace_args.c90
-rw-r--r--sys/compat/cloudabi64/cloudabi64_thread.c4
-rw-r--r--sys/conf/Makefile.powerpc3
-rw-r--r--sys/conf/NOTES5
-rw-r--r--sys/conf/config.mk4
-rw-r--r--sys/conf/files1
-rw-r--r--sys/conf/kern.opts.mk1
-rw-r--r--sys/conf/kern.pre.mk2
-rw-r--r--sys/conf/options2
-rw-r--r--sys/contrib/cloudabi/cloudabi32_types.h36
-rw-r--r--sys/contrib/cloudabi/cloudabi64_types.h173
-rw-r--r--sys/contrib/cloudabi/cloudabi_types_common.h474
-rw-r--r--sys/contrib/cloudabi/syscalls32.master90
-rw-r--r--sys/contrib/cloudabi/syscalls64.master90
-rw-r--r--sys/contrib/dev/acpica/changes.txt35
-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.c2
-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.c2
-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.c2
-rw-r--r--sys/contrib/dev/acpica/common/dmtable.c2
-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/dmtbinfo.c2
-rw-r--r--sys/contrib/dev/acpica/common/getopt.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/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.h4
-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.c2
-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/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.c2
-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.c6
-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.c15
-rw-r--r--sys/contrib/dev/acpica/compiler/aslxrefout.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompile.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompiler.h2
-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.c2
-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.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable2.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.h2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtutils.c2
-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.c2
-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/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.c2
-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/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.c2
-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.c2
-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.c2
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscalc.c2
-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.c2
-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.c2
-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.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.c2
-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.c2
-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/utresrc.c2
-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/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.h14
-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/acdebug.h2
-rw-r--r--sys/contrib/dev/acpica/include/acdisasm.h2
-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.h2
-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/actbl.h2
-rw-r--r--sys/contrib/dev/acpica/include/actbl1.h2
-rw-r--r--sys/contrib/dev/acpica/include/actbl2.h2
-rw-r--r--sys/contrib/dev/acpica/include/actbl3.h2
-rw-r--r--sys/contrib/dev/acpica/include/actypes.h2
-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.h2
-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.h2
-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.c4
-rw-r--r--sys/dev/ath/if_ath.c4
-rw-r--r--sys/dev/ath/if_ath_tx_ht.c23
-rw-r--r--sys/dev/cxgbe/tom/t4_listen.c1
-rw-r--r--sys/dev/e1000/e1000_82575.c1
-rw-r--r--sys/dev/e1000/e1000_82575.h1
-rw-r--r--sys/dev/e1000/e1000_defines.h2
-rw-r--r--sys/dev/e1000/e1000_ich8lan.c82
-rw-r--r--sys/dev/e1000/if_em.c4
-rw-r--r--sys/dev/e1000/if_em.h2
-rw-r--r--sys/dev/ixgbe/if_ix.c1
-rw-r--r--sys/dev/mlx5/cq.h6
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_cq.c22
-rw-r--r--sys/dev/mlx5/mlx5_en/en.h4
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c34
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_main.c146
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_tx.c85
-rw-r--r--sys/dev/mlx5/mlx5_ifc.h203
-rw-r--r--sys/dev/mpr/mpr_sas.c2
-rw-r--r--sys/dev/mpr/mpr_table.c115
-rw-r--r--sys/dev/mpr/mpr_table.h64
-rw-r--r--sys/dev/mpr/mprvar.h23
-rw-r--r--sys/dev/mps/mps_sas.c2
-rw-r--r--sys/dev/mps/mps_table.c114
-rw-r--r--sys/dev/mps/mps_table.h64
-rw-r--r--sys/dev/mps/mpsvar.h23
-rw-r--r--sys/dev/rtwn/if_rtwn.c2
-rw-r--r--sys/dev/rtwn/if_rtwn_rx.c151
-rw-r--r--sys/dev/rtwn/if_rtwn_rx.h2
-rw-r--r--sys/dev/rtwn/if_rtwnvar.h16
-rw-r--r--sys/dev/rtwn/pci/rtwn_pci_rx.c12
-rw-r--r--sys/dev/rtwn/rtl8188e/r88e.h2
-rw-r--r--sys/dev/rtwn/rtl8188e/r88e_rx.c17
-rw-r--r--sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c1
-rw-r--r--sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c1
-rw-r--r--sys/dev/rtwn/rtl8192c/r92c.h2
-rw-r--r--sys/dev/rtwn/rtl8192c/r92c_reg.h4
-rw-r--r--sys/dev/rtwn/rtl8192c/r92c_rx.c44
-rw-r--r--sys/dev/rtwn/rtl8192c/r92c_rx_desc.h5
-rw-r--r--sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c1
-rw-r--r--sys/dev/rtwn/rtl8812a/r12a.h2
-rw-r--r--sys/dev/rtwn/rtl8812a/r12a_rx.c91
-rw-r--r--sys/dev/rtwn/rtl8812a/r12a_rx_desc.h8
-rw-r--r--sys/dev/rtwn/rtl8812a/r12a_tx.c12
-rw-r--r--sys/dev/rtwn/rtl8812a/usb/r12au_attach.c11
-rw-r--r--sys/dev/rtwn/rtl8821a/usb/r21au_attach.c4
-rw-r--r--sys/dev/rtwn/usb/rtwn_usb_rx.c15
-rw-r--r--sys/dev/sdhci/sdhci_fdt_gpio.c8
-rw-r--r--sys/dev/sound/usb/uaudio.c60
-rw-r--r--sys/dev/usb/controller/xhci.c49
-rw-r--r--sys/dev/usb/controller/xhci.h1
-rw-r--r--sys/dev/usb/controller/xhci_pci.c1
-rw-r--r--sys/dev/usb/quirk/usb_quirk.c2
-rw-r--r--sys/dev/usb/quirk/usb_quirk.h1
-rw-r--r--sys/dev/usb/usbdevs3
-rw-r--r--sys/fs/tmpfs/tmpfs.h278
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c143
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c106
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c241
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.h1
-rw-r--r--sys/geom/multipath/g_multipath.c8
-rw-r--r--sys/i386/cloudabi32/cloudabi32_sysvec.c2
-rw-r--r--sys/i386/i386/pmap.c16
-rw-r--r--sys/i386/include/cpufunc.h7
-rw-r--r--sys/kern/imgact_elf.c41
-rw-r--r--sys/kern/kern_clocksource.c2
-rw-r--r--sys/kern/kern_ktrace.c79
-rw-r--r--sys/kern/kern_racct.c6
-rw-r--r--sys/kern/kern_rwlock.c64
-rw-r--r--sys/kern/kern_sx.c68
-rw-r--r--sys/kern/kern_synch.c8
-rw-r--r--sys/kern/sched_4bsd.c4
-rw-r--r--sys/kern/sched_ule.c4
-rw-r--r--sys/kern/uipc_socket.c12
-rw-r--r--sys/kern/vfs_subr.c6
-rw-r--r--sys/kern/vfs_vnops.c37
-rw-r--r--sys/mips/conf/std.MALTA2
-rw-r--r--sys/modules/ath/Makefile34
-rw-r--r--sys/modules/if_lagg/Makefile2
-rw-r--r--sys/modules/if_vlan/Makefile2
-rw-r--r--sys/net/ieee8023ad_lacp.c31
-rw-r--r--sys/net/ieee8023ad_lacp.h3
-rw-r--r--sys/net/if.h1
-rw-r--r--sys/net/if_dead.c28
-rw-r--r--sys/net/if_lagg.c57
-rw-r--r--sys/net/if_media.c1
-rw-r--r--sys/net/if_var.h54
-rw-r--r--sys/net/if_vlan.c33
-rw-r--r--sys/net80211/_ieee80211.h3
-rw-r--r--sys/net80211/ieee80211.h2
-rw-r--r--sys/net80211/ieee80211_ht.c25
-rw-r--r--sys/net80211/ieee80211_ioctl.c34
-rw-r--r--sys/net80211/ieee80211_node.h1
-rw-r--r--sys/net80211/ieee80211_var.h2
-rw-r--r--sys/netgraph/ng_mppc.c7
-rw-r--r--sys/netinet/in_pcb.c256
-rw-r--r--sys/netinet/in_pcb.h16
-rw-r--r--sys/netinet/ip_output.c41
-rw-r--r--sys/netinet6/ip6_output.c41
-rw-r--r--sys/netpfil/ipfw/ip_fw_private.h2
-rw-r--r--sys/powerpc/aim/trap_subr32.S2
-rw-r--r--sys/powerpc/include/frame.h2
-rw-r--r--sys/powerpc/mpc85xx/fsl_diu.c6
-rw-r--r--sys/powerpc/powerpc/trap.c3
-rw-r--r--sys/sys/cdefs.h7
-rw-r--r--sys/sys/elf32.h6
-rw-r--r--sys/sys/elf64.h7
-rw-r--r--sys/sys/elf_common.h7
-rw-r--r--sys/sys/extattr.h3
-rw-r--r--sys/sys/gtaskqueue.h25
-rw-r--r--sys/sys/mbuf.h13
-rw-r--r--sys/sys/rwlock.h2
-rw-r--r--sys/sys/socket.h43
-rw-r--r--sys/sys/socketvar.h5
-rw-r--r--sys/sys/sx.h5
-rw-r--r--sys/ufs/ffs/ffs_vnops.c190
-rw-r--r--sys/ufs/ufs/extattr.h38
533 files changed, 4505 insertions, 2917 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 817cdbe97c9e..5d09929bd84b 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -1862,16 +1862,16 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force)
return;
/*
- * Otherwise, do per-cache line flush. Use the mfence
+ * Otherwise, do per-cache line flush. Use the sfence
* instruction to insure that previous stores are
* included in the write-back. The processor
* propagates flush to other processors in the cache
* coherence domain.
*/
- mfence();
+ sfence();
for (; sva < eva; sva += cpu_clflush_line_size)
clflushopt(sva);
- mfence();
+ sfence();
} else if ((cpu_feature & CPUID_CLFSH) != 0 &&
eva - sva < PMAP_CLFLUSH_THRESHOLD) {
if (pmap_kextract(sva) == lapic_paddr)
@@ -1915,7 +1915,9 @@ pmap_invalidate_cache_pages(vm_page_t *pages, int count)
((cpu_feature & CPUID_CLFSH) == 0 && !useclflushopt))
pmap_invalidate_cache();
else {
- if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL)
+ if (useclflushopt)
+ sfence();
+ else if (cpu_vendor_id != CPU_VENDOR_INTEL)
mfence();
for (i = 0; i < count; i++) {
daddr = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pages[i]));
@@ -1927,7 +1929,9 @@ pmap_invalidate_cache_pages(vm_page_t *pages, int count)
clflush(daddr);
}
}
- if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL)
+ if (useclflushopt)
+ sfence();
+ else if (cpu_vendor_id != CPU_VENDOR_INTEL)
mfence();
}
}
diff --git a/sys/amd64/cloudabi32/cloudabi32_sysvec.c b/sys/amd64/cloudabi32/cloudabi32_sysvec.c
index 5cf73ab5bfe3..363719197960 100644
--- a/sys/amd64/cloudabi32/cloudabi32_sysvec.c
+++ b/sys/amd64/cloudabi32/cloudabi32_sysvec.c
@@ -181,7 +181,7 @@ cloudabi32_thread_setregs(struct thread *td,
/* Perform standard register initialization. */
stack.ss_sp = TO_PTR(attr->stack);
- stack.ss_size = attr->stack_size - sizeof(args);
+ stack.ss_size = attr->stack_len - sizeof(args);
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
/*
diff --git a/sys/amd64/cloudabi64/cloudabi64_sysvec.c b/sys/amd64/cloudabi64/cloudabi64_sysvec.c
index f1b38630c0d5..060825e79987 100644
--- a/sys/amd64/cloudabi64/cloudabi64_sysvec.c
+++ b/sys/amd64/cloudabi64/cloudabi64_sysvec.c
@@ -164,7 +164,7 @@ cloudabi64_thread_setregs(struct thread *td,
* from the top of the stack to store a single element array,
* containing a pointer to the TCB. %fs base will point to this.
*/
- tcbptr = rounddown(attr->stack + attr->stack_size - sizeof(tcbptr),
+ tcbptr = rounddown(attr->stack + attr->stack_len - sizeof(tcbptr),
_Alignof(tcbptr));
error = copyout(&tcb, (void *)tcbptr, sizeof(tcb));
if (error != 0)
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 4b7df46ce9c6..5fa0d77f3d1f 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -327,6 +327,13 @@ mfence(void)
}
static __inline void
+sfence(void)
+{
+
+ __asm __volatile("sfence" : : : "memory");
+}
+
+static __inline void
ia32_pause(void)
{
__asm __volatile("pause");
diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c
index 5cb415009325..53a8bdc660aa 100644
--- a/sys/amd64/vmm/vmm_dev.c
+++ b/sys/amd64/vmm/vmm_dev.c
@@ -258,7 +258,7 @@ alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg)
if (VM_MEMSEG_NAME(mseg)) {
sysmem = false;
name = malloc(SPECNAMELEN + 1, M_VMMDEV, M_WAITOK);
- error = copystr(VM_MEMSEG_NAME(mseg), name, SPECNAMELEN + 1, 0);
+ error = copystr(mseg->name, name, SPECNAMELEN + 1, 0);
if (error)
goto done;
}
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c
index 805a09d5f130..a8de0e51d6ea 100644
--- a/sys/arm/arm/pmap-v6.c
+++ b/sys/arm/arm/pmap-v6.c
@@ -110,11 +110,6 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
-#ifdef SMP
-#include <sys/smp.h>
-#else
-#include <sys/cpuset.h>
-#endif
#ifdef DDB
#include <ddb/ddb.h>
@@ -296,16 +291,6 @@ vm_paddr_t first_managed_pa;
/*
* All those kernel PT submaps that BSD is so fond of
*/
-struct sysmaps {
- struct mtx lock;
- pt2_entry_t *CMAP1;
- pt2_entry_t *CMAP2;
- pt2_entry_t *CMAP3;
- caddr_t CADDR1;
- caddr_t CADDR2;
- caddr_t CADDR3;
-};
-static struct sysmaps sysmaps_pcpu[MAXCPU];
caddr_t _tmppt = 0;
struct msgbuf *msgbufp = NULL; /* XXX move it to machdep.c */
@@ -1134,8 +1119,7 @@ void
pmap_bootstrap(vm_offset_t firstaddr)
{
pt2_entry_t *unused __unused;
- struct sysmaps *sysmaps;
- u_int i;
+ struct pcpu *pc;
/*
* Initialize the kernel pmap (which is statically allocated).
@@ -1174,15 +1158,13 @@ pmap_bootstrap(vm_offset_t firstaddr)
/*
* Local CMAP1/CMAP2 are used for zeroing and copying pages.
- * Local CMAP3 is used for data cache cleaning.
+ * Local CMAP2 is also used for data cache cleaning.
*/
- for (i = 0; i < MAXCPU; i++) {
- sysmaps = &sysmaps_pcpu[i];
- mtx_init(&sysmaps->lock, "SYSMAPS", NULL, MTX_DEF);
- SYSMAP(caddr_t, sysmaps->CMAP1, sysmaps->CADDR1, 1);
- SYSMAP(caddr_t, sysmaps->CMAP2, sysmaps->CADDR2, 1);
- SYSMAP(caddr_t, sysmaps->CMAP3, sysmaps->CADDR3, 1);
- }
+ pc = pcpu_find(curcpu);
+ mtx_init(&pc->pc_cmap_lock, "SYSMAPS", NULL, MTX_DEF);
+ SYSMAP(caddr_t, pc->pc_cmap1_pte2p, pc->pc_cmap1_addr, 1);
+ SYSMAP(caddr_t, pc->pc_cmap2_pte2p, pc->pc_cmap2_addr, 1);
+ SYSMAP(vm_offset_t, unused, pc->pc_qmap_addr, 1);
/*
* Crashdump maps.
@@ -1215,19 +1197,32 @@ pmap_bootstrap(vm_offset_t firstaddr)
}
static void
-pmap_init_qpages(void)
+pmap_init_reserved_pages(void)
{
struct pcpu *pc;
+ vm_offset_t pages;
int i;
CPU_FOREACH(i) {
pc = pcpu_find(i);
- pc->pc_qmap_addr = kva_alloc(PAGE_SIZE);
- if (pc->pc_qmap_addr == 0)
+ /*
+ * Skip if the mapping has already been initialized,
+ * i.e. this is the BSP.
+ */
+ if (pc->pc_cmap1_addr != 0)
+ continue;
+ mtx_init(&pc->pc_cmap_lock, "SYSMAPS", NULL, MTX_DEF);
+ pages = kva_alloc(PAGE_SIZE * 3);
+ if (pages == 0)
panic("%s: unable to allocate KVA", __func__);
+ pc->pc_cmap1_pte2p = pt2map_entry(pages);
+ pc->pc_cmap2_pte2p = pt2map_entry(pages + PAGE_SIZE);
+ pc->pc_cmap1_addr = (caddr_t)pages;
+ pc->pc_cmap2_addr = (caddr_t)(pages + PAGE_SIZE);
+ pc->pc_qmap_addr = pages + (PAGE_SIZE * 2);
}
}
-SYSINIT(qpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_qpages, NULL);
+SYSINIT(rpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_reserved_pages, NULL);
/*
* The function can already be use in second initialization stage.
@@ -1578,8 +1573,9 @@ pagezero(void *page)
static __inline vm_paddr_t
pmap_pt2pg_zero(vm_page_t m)
{
+ pt2_entry_t *cmap2_pte2p;
vm_paddr_t pa;
- struct sysmaps *sysmaps;
+ struct pcpu *pc;
pa = VM_PAGE_TO_PHYS(m);
@@ -1588,20 +1584,27 @@ pmap_pt2pg_zero(vm_page_t m)
* to sync it even if the sync is only DSB.
*/
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (pte2_load(sysmaps->CMAP2) != 0)
+ pc = pcpu_find(curcpu);
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap2_pte2p) != 0)
panic("%s: CMAP2 busy", __func__);
- pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(pa, PTE2_AP_KRW,
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW,
vm_page_pte2_attr(m)));
/* Even VM_ALLOC_ZERO request is only advisory. */
if ((m->flags & PG_ZERO) == 0)
- pagezero(sysmaps->CADDR2);
- pte2_sync_range((pt2_entry_t *)sysmaps->CADDR2, PAGE_SIZE);
- pte2_clear(sysmaps->CMAP2);
- tlb_flush((vm_offset_t)sysmaps->CADDR2);
+ pagezero(pc->pc_cmap2_addr);
+ pte2_sync_range((pt2_entry_t *)pc->pc_cmap2_addr, PAGE_SIZE);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
+
+ /*
+ * Unpin the thread before releasing the lock. Otherwise the thread
+ * could be rescheduled while still bound to the current CPU, only
+ * to unpin itself immediately upon resuming execution.
+ */
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
return (pa);
}
@@ -5628,9 +5631,10 @@ small_mappings:
void
pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
{
- struct sysmaps *sysmaps;
+ pt2_entry_t *cmap2_pte2p;
vm_memattr_t oma;
vm_paddr_t pa;
+ struct pcpu *pc;
oma = m->md.pat_mode;
m->md.pat_mode = ma;
@@ -5657,17 +5661,18 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
if (ma != oma) {
pa = VM_PAGE_TO_PHYS(m);
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (*sysmaps->CMAP2)
+ pc = pcpu_find(curcpu);
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap2_pte2p) != 0)
panic("%s: CMAP2 busy", __func__);
- pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(pa, PTE2_AP_KRW,
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW,
vm_memattr_to_pte2(ma)));
- dcache_wbinv_poc((vm_offset_t)sysmaps->CADDR2, pa, PAGE_SIZE);
- pte2_clear(sysmaps->CMAP2);
- tlb_flush((vm_offset_t)sysmaps->CADDR2);
+ dcache_wbinv_poc((vm_offset_t)pc->pc_cmap2_addr, pa, PAGE_SIZE);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
}
}
@@ -5745,20 +5750,22 @@ pmap_page_exists_quick(pmap_t pmap, vm_page_t m)
void
pmap_zero_page(vm_page_t m)
{
- struct sysmaps *sysmaps;
+ pt2_entry_t *cmap2_pte2p;
+ struct pcpu *pc;
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (pte2_load(sysmaps->CMAP2) != 0)
+ pc = pcpu_find(curcpu);
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap2_pte2p) != 0)
panic("%s: CMAP2 busy", __func__);
- pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
vm_page_pte2_attr(m)));
- pagezero(sysmaps->CADDR2);
- pte2_clear(sysmaps->CMAP2);
- tlb_flush((vm_offset_t)sysmaps->CADDR2);
+ pagezero(pc->pc_cmap2_addr);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
}
/*
@@ -5770,23 +5777,25 @@ pmap_zero_page(vm_page_t m)
void
pmap_zero_page_area(vm_page_t m, int off, int size)
{
- struct sysmaps *sysmaps;
+ pt2_entry_t *cmap2_pte2p;
+ struct pcpu *pc;
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (pte2_load(sysmaps->CMAP2) != 0)
+ pc = pcpu_find(curcpu);
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap2_pte2p) != 0)
panic("%s: CMAP2 busy", __func__);
- pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
vm_page_pte2_attr(m)));
if (off == 0 && size == PAGE_SIZE)
- pagezero(sysmaps->CADDR2);
+ pagezero(pc->pc_cmap2_addr);
else
- bzero(sysmaps->CADDR2 + off, size);
- pte2_clear(sysmaps->CMAP2);
- tlb_flush((vm_offset_t)sysmaps->CADDR2);
+ bzero(pc->pc_cmap2_addr + off, size);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
}
/*
@@ -5798,26 +5807,29 @@ pmap_zero_page_area(vm_page_t m, int off, int size)
void
pmap_copy_page(vm_page_t src, vm_page_t dst)
{
- struct sysmaps *sysmaps;
+ pt2_entry_t *cmap1_pte2p, *cmap2_pte2p;
+ struct pcpu *pc;
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (pte2_load(sysmaps->CMAP1) != 0)
+ pc = pcpu_find(curcpu);
+ cmap1_pte2p = pc->pc_cmap1_pte2p;
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap1_pte2p) != 0)
panic("%s: CMAP1 busy", __func__);
- if (pte2_load(sysmaps->CMAP2) != 0)
+ if (pte2_load(cmap2_pte2p) != 0)
panic("%s: CMAP2 busy", __func__);
- pte2_store(sysmaps->CMAP1, PTE2_KERN_NG(VM_PAGE_TO_PHYS(src),
+ pte2_store(cmap1_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(src),
PTE2_AP_KR | PTE2_NM, vm_page_pte2_attr(src)));
- pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(dst),
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(dst),
PTE2_AP_KRW, vm_page_pte2_attr(dst)));
- bcopy(sysmaps->CADDR1, sysmaps->CADDR2, PAGE_SIZE);
- pte2_clear(sysmaps->CMAP1);
- tlb_flush((vm_offset_t)sysmaps->CADDR1);
- pte2_clear(sysmaps->CMAP2);
- tlb_flush((vm_offset_t)sysmaps->CADDR2);
+ bcopy(pc->pc_cmap1_addr, pc->pc_cmap2_addr, PAGE_SIZE);
+ pte2_clear(cmap1_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap1_addr);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
}
int unmapped_buf_allowed = 1;
@@ -5826,18 +5838,21 @@ void
pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
vm_offset_t b_offset, int xfersize)
{
- struct sysmaps *sysmaps;
+ pt2_entry_t *cmap1_pte2p, *cmap2_pte2p;
vm_page_t a_pg, b_pg;
char *a_cp, *b_cp;
vm_offset_t a_pg_offset, b_pg_offset;
+ struct pcpu *pc;
int cnt;
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (*sysmaps->CMAP1 != 0)
+ pc = pcpu_find(curcpu);
+ cmap1_pte2p = pc->pc_cmap1_pte2p;
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap1_pte2p) != 0)
panic("pmap_copy_pages: CMAP1 busy");
- if (*sysmaps->CMAP2 != 0)
+ if (pte2_load(cmap2_pte2p) != 0)
panic("pmap_copy_pages: CMAP2 busy");
while (xfersize > 0) {
a_pg = ma[a_offset >> PAGE_SHIFT];
@@ -5846,25 +5861,25 @@ pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
b_pg = mb[b_offset >> PAGE_SHIFT];
b_pg_offset = b_offset & PAGE_MASK;
cnt = min(cnt, PAGE_SIZE - b_pg_offset);
- pte2_store(sysmaps->CMAP1, PTE2_KERN_NG(VM_PAGE_TO_PHYS(a_pg),
+ pte2_store(cmap1_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(a_pg),
PTE2_AP_KR | PTE2_NM, vm_page_pte2_attr(a_pg)));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR1);
- pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(b_pg),
+ tlb_flush_local((vm_offset_t)pc->pc_cmap1_addr);
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(b_pg),
PTE2_AP_KRW, vm_page_pte2_attr(b_pg)));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR2);
- a_cp = sysmaps->CADDR1 + a_pg_offset;
- b_cp = sysmaps->CADDR2 + b_pg_offset;
+ tlb_flush_local((vm_offset_t)pc->pc_cmap2_addr);
+ a_cp = pc->pc_cmap1_addr + a_pg_offset;
+ b_cp = pc->pc_cmap2_addr + b_pg_offset;
bcopy(a_cp, b_cp, cnt);
a_offset += cnt;
b_offset += cnt;
xfersize -= cnt;
}
- pte2_clear(sysmaps->CMAP1);
- tlb_flush((vm_offset_t)sysmaps->CADDR1);
- pte2_clear(sysmaps->CMAP2);
- tlb_flush((vm_offset_t)sysmaps->CADDR2);
+ pte2_clear(cmap1_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap1_addr);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
}
vm_offset_t
@@ -6190,22 +6205,24 @@ pmap_set_pcb_pagedir(pmap_t pmap, struct pcb *pcb)
static void
pmap_dcache_wb_pou(vm_paddr_t pa, vm_size_t size, uint32_t attr)
{
- struct sysmaps *sysmaps;
+ pt2_entry_t *cmap2_pte2p;
+ struct pcpu *pc;
KASSERT(((pa & PAGE_MASK) + size) <= PAGE_SIZE,
("%s: not on single page", __func__));
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (*sysmaps->CMAP3)
- panic("%s: CMAP3 busy", __func__);
- pte2_store(sysmaps->CMAP3, PTE2_KERN_NG(pa, PTE2_AP_KRW, attr));
- dcache_wb_pou((vm_offset_t)sysmaps->CADDR3 + (pa & PAGE_MASK), size);
- pte2_clear(sysmaps->CMAP3);
- tlb_flush((vm_offset_t)sysmaps->CADDR3);
+ pc = pcpu_find(curcpu);
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap2_pte2p) != 0)
+ panic("%s: CMAP2 busy", __func__);
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW, attr));
+ dcache_wb_pou((vm_offset_t)pc->pc_cmap2_addr + (pa & PAGE_MASK), size);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
}
/*
@@ -6455,25 +6472,27 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
static void
pmap_zero_page_check(vm_page_t m)
{
+ pt2_entry_t *cmap2_pte2p;
uint32_t *p, *end;
- struct sysmaps *sysmaps;
+ struct pcpu *pc;
sched_pin();
- sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
- mtx_lock(&sysmaps->lock);
- if (pte2_load(sysmaps->CMAP2) != 0)
+ pc = pcpu_find(curcpu);
+ cmap2_pte2p = pc->pc_cmap2_pte2p;
+ mtx_lock(&pc->pc_cmap_lock);
+ if (pte2_load(cmap2_pte2p) != 0)
panic("%s: CMAP2 busy", __func__);
- pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
+ pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
vm_page_pte2_attr(m)));
- end = (uint32_t*)(sysmaps->CADDR2 + PAGE_SIZE);
- for (p = (uint32_t*)sysmaps->CADDR2; p < end; p++)
+ end = (uint32_t*)(pc->pc_cmap2_addr + PAGE_SIZE);
+ for (p = (uint32_t*)pc->pc_cmap2_addr; p < end; p++)
if (*p != 0)
panic("%s: page %p not zero, va: %p", __func__, m,
- sysmaps->CADDR2);
- pte2_clear(sysmaps->CMAP2);
- tlb_flush((vm_offset_t)sysmaps->CADDR2);
+ pc->pc_cmap2_addr);
+ pte2_clear(cmap2_pte2p);
+ tlb_flush((vm_offset_t)pc->pc_cmap2_addr);
sched_unpin();
- mtx_unlock(&sysmaps->lock);
+ mtx_unlock(&pc->pc_cmap_lock);
}
int
diff --git a/sys/arm/cloudabi32/cloudabi32_sysvec.c b/sys/arm/cloudabi32/cloudabi32_sysvec.c
index 040dcc323c9f..731de0b0d887 100644
--- a/sys/arm/cloudabi32/cloudabi32_sysvec.c
+++ b/sys/arm/cloudabi32/cloudabi32_sysvec.c
@@ -148,7 +148,7 @@ cloudabi32_thread_setregs(struct thread *td,
/* Perform standard register initialization. */
stack.ss_sp = TO_PTR(attr->stack);
- stack.ss_size = attr->stack_size;
+ stack.ss_size = attr->stack_len;
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
/*
diff --git a/sys/arm/include/pcpu.h b/sys/arm/include/pcpu.h
index 3cc258188ff8..d02ccc8f546c 100644
--- a/sys/arm/include/pcpu.h
+++ b/sys/arm/include/pcpu.h
@@ -32,6 +32,9 @@
#ifdef _KERNEL
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+
#define ALT_STACK_SIZE 128
struct vmspace;
@@ -39,16 +42,22 @@ struct vmspace;
#endif /* _KERNEL */
#if __ARM_ARCH >= 6
+
#define PCPU_MD_FIELDS \
unsigned int pc_vfpsid; \
unsigned int pc_vfpmvfr0; \
unsigned int pc_vfpmvfr1; \
struct pmap *pc_curpmap; \
+ struct mtx pc_cmap_lock; \
+ void *pc_cmap1_pte2p; \
+ void *pc_cmap2_pte2p; \
+ caddr_t pc_cmap1_addr; \
+ caddr_t pc_cmap2_addr; \
vm_offset_t pc_qmap_addr; \
void *pc_qmap_pte; \
unsigned int pc_dbreg[32]; \
int pc_dbreg_cmd; \
- char __pad[1]
+ char __pad[27]
#else
#define PCPU_MD_FIELDS \
vm_offset_t qmap_addr; \
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
index 355a423eb6a7..30dc008b20c7 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -783,8 +783,7 @@ cpsw_get_fdt_data(struct cpsw_softc *sc, int port)
static int
cpsw_attach(device_t dev)
{
- bus_dma_segment_t segs[1];
- int error, i, nsegs;
+ int error, i;
struct cpsw_softc *sc;
uint32_t reg;
@@ -859,15 +858,8 @@ cpsw_attach(device_t dev)
return (error);
}
- /* Allocate the null mbuf and pre-sync it. */
- sc->null_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
- memset(sc->null_mbuf->m_data, 0, sc->null_mbuf->m_ext.ext_size);
- bus_dmamap_create(sc->mbuf_dtag, 0, &sc->null_mbuf_dmamap);
- bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, sc->null_mbuf_dmamap,
- sc->null_mbuf, segs, &nsegs, BUS_DMA_NOWAIT);
- bus_dmamap_sync(sc->mbuf_dtag, sc->null_mbuf_dmamap,
- BUS_DMASYNC_PREWRITE);
- sc->null_mbuf_paddr = segs[0].ds_addr;
+ /* Allocate a NULL buffer for padding. */
+ sc->nullpad = malloc(ETHER_MIN_LEN, M_DEVBUF, M_WAITOK | M_ZERO);
cpsw_init_slots(sc);
@@ -946,13 +938,9 @@ cpsw_detach(device_t dev)
for (i = 0; i < nitems(sc->_slots); ++i)
cpsw_free_slot(sc, &sc->_slots[i]);
- /* Free null mbuf. */
- if (sc->null_mbuf_dmamap) {
- bus_dmamap_unload(sc->mbuf_dtag, sc->null_mbuf_dmamap);
- error = bus_dmamap_destroy(sc->mbuf_dtag, sc->null_mbuf_dmamap);
- KASSERT(error == 0, ("Mapping still active"));
- m_freem(sc->null_mbuf);
- }
+ /* Free null padding buffer. */
+ if (sc->nullpad)
+ free(sc->nullpad, M_DEVBUF);
/* Free DMA tag */
if (sc->mbuf_dtag) {
@@ -1395,6 +1383,16 @@ cpswp_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
ifr = (struct ifreq *)data;
switch (command) {
+ case SIOCSIFCAP:
+ changed = ifp->if_capenable ^ ifr->ifr_reqcap;
+ if (changed & IFCAP_HWCSUM) {
+ if ((ifr->ifr_reqcap & changed) & IFCAP_HWCSUM)
+ ifp->if_capenable |= IFCAP_HWCSUM;
+ else
+ ifp->if_capenable &= ~IFCAP_HWCSUM;
+ }
+ error = 0;
+ break;
case SIOCSIFFLAGS:
CPSW_PORT_LOCK(sc);
if (ifp->if_flags & IFF_UP) {
@@ -1632,21 +1630,36 @@ cpsw_rx_dequeue(struct cpsw_softc *sc)
/* TODO: track SOP/EOP bits to assemble a full mbuf
out of received fragments. */
slot->mbuf->m_data += bd.bufoff;
- slot->mbuf->m_len = bd.pktlen - 4;
- slot->mbuf->m_pkthdr.len = bd.pktlen - 4;
- slot->mbuf->m_flags |= M_PKTHDR;
- slot->mbuf->m_pkthdr.rcvif = psc->ifp;
+ slot->mbuf->m_len = bd.buflen;
+ if (bd.flags & CPDMA_BD_SOP) {
+ slot->mbuf->m_pkthdr.len = bd.pktlen;
+ slot->mbuf->m_pkthdr.rcvif = psc->ifp;
+ slot->mbuf->m_flags |= M_PKTHDR;
+ }
+ slot->mbuf->m_next = NULL;
slot->mbuf->m_nextpkt = NULL;
+ if (bd.flags & CPDMA_BD_PASS_CRC)
+ m_adj(slot->mbuf, -ETHER_CRC_LEN);
if ((psc->ifp->if_capenable & IFCAP_RXCSUM) != 0) {
/* check for valid CRC by looking into pkt_err[5:4] */
- if ((bd.flags & CPDMA_BD_PKT_ERR_MASK) == 0) {
+ if ((bd.flags &
+ (CPDMA_BD_SOP | CPDMA_BD_PKT_ERR_MASK)) ==
+ CPDMA_BD_SOP) {
slot->mbuf->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
slot->mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID;
slot->mbuf->m_pkthdr.csum_data = 0xffff;
}
}
+ if (STAILQ_FIRST(&sc->rx.active) != NULL &&
+ (bd.flags & (CPDMA_BD_EOP | CPDMA_BD_EOQ)) ==
+ (CPDMA_BD_EOP | CPDMA_BD_EOQ)) {
+ cpsw_write_hdp_slot(sc, &sc->rx,
+ STAILQ_FIRST(&sc->rx.active));
+ sc->rx.queue_restart++;
+ }
+
/* Add mbuf to packet list to be returned. */
if (mb_tail) {
mb_tail->m_nextpkt = slot->mbuf;
@@ -1679,7 +1692,6 @@ cpsw_rx_enqueue(struct cpsw_softc *sc)
struct cpsw_cpdma_bd bd;
struct cpsw_slot *first_new_slot, *last_old_slot, *next, *slot;
int error, nsegs, added = 0;
- uint32_t flags;
/* Register new mbufs with hardware. */
first_new_slot = NULL;
@@ -1745,22 +1757,13 @@ cpsw_rx_enqueue(struct cpsw_softc *sc)
} else {
/* Add buffers to end of current queue. */
cpsw_cpdma_write_bd_next(sc, last_old_slot, first_new_slot);
- /* If underrun, restart queue. */
- if ((flags = cpsw_cpdma_read_bd_flags(sc, last_old_slot)) &
- CPDMA_BD_EOQ) {
- flags &= ~CPDMA_BD_EOQ;
- cpsw_cpdma_write_bd_flags(sc, last_old_slot, flags);
- cpsw_write_hdp_slot(sc, &sc->rx, first_new_slot);
- sc->rx.queue_restart++;
- }
}
sc->rx.queue_adds += added;
sc->rx.avail_queue_len -= added;
sc->rx.active_queue_len += added;
cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), added);
- if (sc->rx.active_queue_len > sc->rx.max_active_queue_len) {
+ if (sc->rx.active_queue_len > sc->rx.max_active_queue_len)
sc->rx.max_active_queue_len = sc->rx.active_queue_len;
- }
}
static void
@@ -1800,13 +1803,8 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
struct cpsw_cpdma_bd bd;
struct cpsw_slot *first_new_slot, *last, *last_old_slot, *next, *slot;
struct mbuf *m0;
- int error, flags, nsegs, seg, added = 0, padlen;
+ int error, nsegs, seg, added = 0, padlen;
- flags = 0;
- if (sc->swsc->dualemac) {
- flags = CPDMA_BD_TO_PORT |
- ((sc->unit + 1) & CPDMA_BD_PORT_MASK);
- }
/* Pull pending packets from IF queue and prep them for DMA. */
last = NULL;
first_new_slot = NULL;
@@ -1817,21 +1815,19 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
break;
slot->mbuf = m0;
- padlen = ETHER_MIN_LEN - slot->mbuf->m_pkthdr.len;
+ padlen = ETHER_MIN_LEN - ETHER_CRC_LEN - m0->m_pkthdr.len;
if (padlen < 0)
padlen = 0;
+ else if (padlen > 0)
+ m_append(slot->mbuf, padlen, sc->swsc->nullpad);
/* Create mapping in DMA memory */
error = bus_dmamap_load_mbuf_sg(sc->swsc->mbuf_dtag,
slot->dmamap, slot->mbuf, segs, &nsegs, BUS_DMA_NOWAIT);
/* If the packet is too fragmented, try to simplify. */
if (error == EFBIG ||
- (error == 0 &&
- nsegs + (padlen > 0 ? 1 : 0) > sc->swsc->tx.avail_queue_len)) {
+ (error == 0 && nsegs > sc->swsc->tx.avail_queue_len)) {
bus_dmamap_unload(sc->swsc->mbuf_dtag, slot->dmamap);
- if (padlen > 0) /* May as well add padding. */
- m_append(slot->mbuf, padlen,
- sc->swsc->null_mbuf->m_data);
m0 = m_defrag(slot->mbuf, M_NOWAIT);
if (m0 == NULL) {
device_printf(sc->dev,
@@ -1883,8 +1879,12 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufptr = segs[0].ds_addr;
bd.bufoff = 0;
bd.buflen = segs[0].ds_len;
- bd.pktlen = m_length(slot->mbuf, NULL) + padlen;
- bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER | flags;
+ bd.pktlen = m_length(slot->mbuf, NULL);
+ bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER;
+ if (sc->swsc->dualemac) {
+ bd.flags |= CPDMA_BD_TO_PORT;
+ bd.flags |= ((sc->unit + 1) & CPDMA_BD_PORT_MASK);
+ }
for (seg = 1; seg < nsegs; ++seg) {
/* Save the previous buffer (which isn't EOP) */
cpsw_cpdma_write_bd(sc->swsc, slot, &bd);
@@ -1902,44 +1902,20 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufoff = 0;
bd.buflen = segs[seg].ds_len;
bd.pktlen = 0;
- bd.flags = CPDMA_BD_OWNER | flags;
+ bd.flags = CPDMA_BD_OWNER;
}
+
/* Save the final buffer. */
- if (padlen <= 0)
- bd.flags |= CPDMA_BD_EOP;
- else {
- next = STAILQ_NEXT(slot, next);
- bd.next = cpsw_cpdma_bd_paddr(sc->swsc, next);
- }
+ bd.flags |= CPDMA_BD_EOP;
cpsw_cpdma_write_bd(sc->swsc, slot, &bd);
STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next);
STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next);
- if (padlen > 0) {
- slot = STAILQ_FIRST(&sc->swsc->tx.avail);
-
- /* Setup buffer of null pad bytes (definitely EOP). */
- bd.next = 0;
- bd.bufptr = sc->swsc->null_mbuf_paddr;
- bd.bufoff = 0;
- bd.buflen = padlen;
- bd.pktlen = 0;
- bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER | flags;
- cpsw_cpdma_write_bd(sc->swsc, slot, &bd);
- ++nsegs;
-
- STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next);
- STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next);
- }
-
last = slot;
-
added += nsegs;
if (nsegs > sc->swsc->tx.longest_chain)
sc->swsc->tx.longest_chain = nsegs;
- // TODO: Should we defer the BPF tap until
- // after all packets are queued?
BPF_MTAP(sc->ifp, m0);
}
diff --git a/sys/arm/ti/cpsw/if_cpswreg.h b/sys/arm/ti/cpsw/if_cpswreg.h
index 6d6a647565cc..c0ee3586fc45 100644
--- a/sys/arm/ti/cpsw/if_cpswreg.h
+++ b/sys/arm/ti/cpsw/if_cpswreg.h
@@ -191,6 +191,7 @@
#define CPDMA_BD_OWNER (1 << 13)
#define CPDMA_BD_EOQ (1 << 12)
#define CPDMA_BD_TDOWNCMPLT (1 << 11)
+#define CPDMA_BD_PASS_CRC (1 << 10)
#define CPDMA_BD_PKT_ERR_MASK (3 << 4)
#define CPDMA_BD_TO_PORT (1 << 4)
#define CPDMA_BD_PORT_MASK 3
diff --git a/sys/arm/ti/cpsw/if_cpswvar.h b/sys/arm/ti/cpsw/if_cpswvar.h
index f037dd515f03..904c68db7eda 100644
--- a/sys/arm/ti/cpsw/if_cpswvar.h
+++ b/sys/arm/ti/cpsw/if_cpswvar.h
@@ -104,10 +104,8 @@ struct cpsw_softc {
struct resource *irq_res[CPSW_INTR_COUNT];
void *ih_cookie[CPSW_INTR_COUNT];
- /* An mbuf full of nulls for TX padding. */
- bus_dmamap_t null_mbuf_dmamap;
- struct mbuf *null_mbuf;
- bus_addr_t null_mbuf_paddr;
+ /* A buffer full of nulls for TX padding. */
+ void *nullpad;
bus_dma_tag_t mbuf_dtag;
diff --git a/sys/arm/xilinx/zy7_ehci.c b/sys/arm/xilinx/zy7_ehci.c
index f6e34f774491..0b7a3ffd22e9 100644
--- a/sys/arm/xilinx/zy7_ehci.c
+++ b/sys/arm/xilinx/zy7_ehci.c
@@ -325,13 +325,10 @@ zy7_ehci_detach(device_t dev)
/* during module unload there are lots of children leftover */
device_delete_children(dev);
- sc->sc_flags &= ~EHCI_SCFLG_DONEINIT;
-
- if (sc->sc_irq_res && sc->sc_intr_hdl)
- /* call ehci_detach() after ehci_init() called after
- * successful bus_setup_intr().
- */
+ if ((sc->sc_flags & EHCI_SCFLG_DONEINIT) != 0) {
ehci_detach(sc);
+ sc->sc_flags &= ~EHCI_SCFLG_DONEINIT;
+ }
if (sc->sc_irq_res) {
if (sc->sc_intr_hdl != NULL)
diff --git a/sys/arm64/cloudabi64/cloudabi64_sysvec.c b/sys/arm64/cloudabi64/cloudabi64_sysvec.c
index 79b1046ddc95..9cdabe85ce10 100644
--- a/sys/arm64/cloudabi64/cloudabi64_sysvec.c
+++ b/sys/arm64/cloudabi64/cloudabi64_sysvec.c
@@ -140,7 +140,7 @@ cloudabi64_thread_setregs(struct thread *td,
/* Perform standard register initialization. */
stack.ss_sp = TO_PTR(attr->stack);
- stack.ss_size = attr->stack_size;
+ stack.ss_size = attr->stack_len;
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
/*
diff --git a/sys/boot/efi/include/efidevp.h b/sys/boot/efi/include/efidevp.h
index dda79de7af13..4f252472a80c 100644
--- a/sys/boot/efi/include/efidevp.h
+++ b/sys/boot/efi/include/efidevp.h
@@ -73,8 +73,6 @@ typedef struct _EFI_DEVICE_PATH {
(a)->Length[1] = 0; \
}
-
-
/*
*
*/
@@ -424,5 +422,33 @@ typedef union {
} EFI_DEV_PATH_PTR;
+#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
+ { 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } }
+
+#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
+ { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } }
+
+INTERFACE_DECL(_EFI_DEVICE_PATH_PROTOCOL);
+
+typedef
+CHAR16*
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
+ IN struct _EFI_DEVICE_PATH *This,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortCuts
+ );
+
+typedef
+CHAR16*
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
+ IN struct _EFI_DEVICE_PATH *This,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortCuts
+ );
+
+typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL {
+ EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
+ EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
+} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
#endif
diff --git a/sys/boot/efi/libefi/devpath.c b/sys/boot/efi/libefi/devpath.c
index 105c86134a86..cc1045eaf517 100644
--- a/sys/boot/efi/libefi/devpath.c
+++ b/sys/boot/efi/libefi/devpath.c
@@ -30,36 +30,6 @@ __FBSDID("$FreeBSD$");
#include <efi.h>
#include <efilib.h>
-/* XXX: This belongs in an efifoo.h header. */
-#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
- { 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } }
-
-#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
- { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } }
-
-INTERFACE_DECL(_EFI_DEVICE_PATH_PROTOCOL);
-
-typedef
-CHAR16*
-(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
- IN struct _EFI_DEVICE_PATH *This,
- IN BOOLEAN DisplayOnly,
- IN BOOLEAN AllowShortCuts
- );
-
-typedef
-CHAR16*
-(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
- IN struct _EFI_DEVICE_PATH *This,
- IN BOOLEAN DisplayOnly,
- IN BOOLEAN AllowShortCuts
- );
-
-typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL {
- EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
- EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
-} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
-
static EFI_GUID ImageDevicePathGUID =
EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
@@ -136,15 +106,18 @@ efi_devpath_trim(EFI_DEVICE_PATH *devpath)
EFI_DEVICE_PATH *node, *copy;
size_t prefix, len;
- node = efi_devpath_last_node(devpath);
+ if ((node = efi_devpath_last_node(devpath)) == NULL)
+ return (NULL);
prefix = (UINT8 *)node - (UINT8 *)devpath;
if (prefix == 0)
return (NULL);
len = prefix + DevicePathNodeLength(NextDevicePathNode(node));
copy = malloc(len);
- memcpy(copy, devpath, prefix);
- node = (EFI_DEVICE_PATH *)((UINT8 *)copy + prefix);
- SetDevicePathEndNode(node);
+ if (copy != NULL) {
+ memcpy(copy, devpath, prefix);
+ node = (EFI_DEVICE_PATH *)((UINT8 *)copy + prefix);
+ SetDevicePathEndNode(node);
+ }
return (copy);
}
diff --git a/sys/boot/efi/libefi/efinet.c b/sys/boot/efi/libefi/efinet.c
index 1207088d8682..26802c2287d9 100644
--- a/sys/boot/efi/libefi/efinet.c
+++ b/sys/boot/efi/libefi/efinet.c
@@ -291,12 +291,18 @@ efinet_dev_init()
if (EFI_ERROR(status))
return (efi_status_to_errno(status));
handles2 = (EFI_HANDLE *)malloc(sz);
+ if (handles2 == NULL) {
+ free(handles);
+ return (ENOMEM);
+ }
nifs = 0;
for (i = 0; i < sz / sizeof(EFI_HANDLE); i++) {
devpath = efi_lookup_devpath(handles[i]);
if (devpath == NULL)
continue;
- node = efi_devpath_last_node(devpath);
+ if ((node = efi_devpath_last_node(devpath)) == NULL)
+ continue;
+
if (DevicePathType(node) != MESSAGING_DEVICE_PATH ||
DevicePathSubType(node) != MSG_MAC_ADDR_DP)
continue;
@@ -318,20 +324,24 @@ efinet_dev_init()
}
free(handles);
if (nifs == 0) {
- free(handles2);
- return (ENOENT);
+ err = ENOENT;
+ goto done;
}
err = efi_register_handles(&efinet_dev, handles2, NULL, nifs);
- if (err != 0) {
- free(handles2);
- return (err);
- }
+ if (err != 0)
+ goto done;
- efinetif.netif_nifs = nifs;
efinetif.netif_ifs = calloc(nifs, sizeof(struct netif_dif));
-
stats = calloc(nifs, sizeof(struct netif_stats));
+ if (efinetif.netif_ifs == NULL || stats == NULL) {
+ free(efinetif.netif_ifs);
+ free(stats);
+ efinetif.netif_ifs = NULL;
+ err = ENOMEM;
+ goto done;
+ }
+ efinetif.netif_nifs = nifs;
for (i = 0; i < nifs; i++) {
@@ -341,9 +351,9 @@ efinet_dev_init()
dif->dif_stats = &stats[i];
dif->dif_private = handles2[i];
}
+done:
free(handles2);
-
- return (0);
+ return (err);
}
static int
diff --git a/sys/boot/efi/libefi/efipart.c b/sys/boot/efi/libefi/efipart.c
index 938eed996c86..eb052c9dd345 100644
--- a/sys/boot/efi/libefi/efipart.c
+++ b/sys/boot/efi/libefi/efipart.c
@@ -130,10 +130,13 @@ efipart_init(void)
* we try to find the parent device and add that instead as
* that will be the CD filesystem.
*/
- node = efi_devpath_last_node(devpath);
+ if ((node = efi_devpath_last_node(devpath)) == NULL)
+ continue;
if (DevicePathType(node) == MEDIA_DEVICE_PATH &&
DevicePathSubType(node) == MEDIA_CDROM_DP) {
devpathcpy = efi_devpath_trim(devpath);
+ if (devpathcpy == NULL)
+ continue;
tmpdevpath = devpathcpy;
status = BS->LocateDevicePath(&blkio_guid, &tmpdevpath,
&handle);
diff --git a/sys/boot/fdt/dts/arm/ufw.dts b/sys/boot/fdt/dts/arm/ufw.dts
index a2de3abbb92f..8b731a1a9d29 100644
--- a/sys/boot/fdt/dts/arm/ufw.dts
+++ b/sys/boot/fdt/dts/arm/ufw.dts
@@ -278,6 +278,7 @@
pinctrl-0 = <&mmc1_pins>;
bus-width = <4>;
non-removable;
+ wp-disable;
status = "okay";
};
diff --git a/sys/boot/fdt/dts/mips/beri-netfpga.dts b/sys/boot/fdt/dts/mips/beri-netfpga.dts
index f272f9cfa5d6..e93e68e5161c 100644
--- a/sys/boot/fdt/dts/mips/beri-netfpga.dts
+++ b/sys/boot/fdt/dts/mips/beri-netfpga.dts
@@ -97,7 +97,6 @@
* we use mips4k coprocessor 0 interrupt management directly.
*/
compatible = "simple-bus", "mips,mips4k";
- ranges = <>;
beripic: beripic@7f804000 {
compatible = "sri-cambridge,beri-pic";
diff --git a/sys/boot/fdt/dts/mips/beri-sim.dts b/sys/boot/fdt/dts/mips/beri-sim.dts
index 5e0ab1976b2b..602c56773793 100644
--- a/sys/boot/fdt/dts/mips/beri-sim.dts
+++ b/sys/boot/fdt/dts/mips/beri-sim.dts
@@ -95,7 +95,6 @@
* we use mips4k coprocessor 0 interrupt management directly.
*/
compatible = "simple-bus", "mips,mips4k";
- ranges = <>;
beripic0: beripic@7f804000 {
compatible = "sri-cambridge,beri-pic";
diff --git a/sys/boot/fdt/dts/mips/beripad-de4.dts b/sys/boot/fdt/dts/mips/beripad-de4.dts
index 287c2306d145..88023132b5b2 100644
--- a/sys/boot/fdt/dts/mips/beripad-de4.dts
+++ b/sys/boot/fdt/dts/mips/beripad-de4.dts
@@ -95,7 +95,6 @@
* we use mips4k coprocessor 0 interrupt management directly.
*/
compatible = "simple-bus", "mips,mips4k";
- ranges = <>;
beripic0: beripic@7f804000 {
compatible = "sri-cambridge,beri-pic";
diff --git a/sys/boot/fdt/dts/mips/beripad-sockit.dts b/sys/boot/fdt/dts/mips/beripad-sockit.dts
index ad9e4acfbea2..72b86437d207 100644
--- a/sys/boot/fdt/dts/mips/beripad-sockit.dts
+++ b/sys/boot/fdt/dts/mips/beripad-sockit.dts
@@ -93,7 +93,6 @@
* we use mips4k coprocessor 0 interrupt management directly.
*/
compatible = "simple-bus", "mips,mips4k";
- /* ranges = <>; */
beripic0: beripic@7f804000 {
compatible = "sri-cambridge,beri-pic";
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 45a27e281cf5..867cf96bb43b 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -513,6 +513,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+ * Intel S3610 Series SSDs
+ * 4k optimised & trim only works in 4k requests + 4k aligned
+ */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2BX*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /*
* Intel X25-M Series SSDs
* 4k optimised & trim only works in 4k requests + 4k aligned
*/
@@ -569,6 +577,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+ * Micron 5100 SSDs
+ * 4k optimised & trim only works in 4k requests + 4k aligned
+ */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Micron 5100 MTFDDAK*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /*
* OCZ Agility 2 SSDs
* 4k optimised & trim only works in 4k requests + 4k aligned
*/
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 8c6e39adc051..74a780eb5572 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -424,7 +424,7 @@ static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event,
static void ctl_copy_sense_data(union ctl_ha_msg *src, union ctl_io *dest);
static void ctl_copy_sense_data_back(union ctl_io *src, union ctl_ha_msg *dest);
static int ctl_init(void);
-void ctl_shutdown(void);
+static int ctl_shutdown(void);
static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td);
static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td);
static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio);
@@ -520,6 +520,8 @@ static const struct ctl_cmd_entry *
ctl_validate_command(struct ctl_scsiio *ctsio);
static int ctl_cmd_applicable(uint8_t lun_type,
const struct ctl_cmd_entry *entry);
+static int ctl_ha_init(void);
+static int ctl_ha_shutdown(void);
static uint64_t ctl_get_prkey(struct ctl_lun *lun, uint32_t residx);
static void ctl_clr_prkey(struct ctl_lun *lun, uint32_t residx);
@@ -561,6 +563,49 @@ MODULE_VERSION(ctl, 1);
static struct ctl_frontend ha_frontend =
{
.name = "ha",
+ .init = ctl_ha_init,
+ .shutdown = ctl_ha_shutdown,
+};
+
+static int
+ctl_ha_init(void)
+{
+ struct ctl_softc *softc = control_softc;
+
+ if (ctl_pool_create(softc, "othersc", CTL_POOL_ENTRIES_OTHER_SC,
+ &softc->othersc_pool) != 0)
+ return (ENOMEM);
+ if (ctl_ha_msg_init(softc) != CTL_HA_STATUS_SUCCESS) {
+ ctl_pool_free(softc->othersc_pool);
+ return (EIO);
+ }
+ if (ctl_ha_msg_register(CTL_HA_CHAN_CTL, ctl_isc_event_handler)
+ != CTL_HA_STATUS_SUCCESS) {
+ ctl_ha_msg_destroy(softc);
+ ctl_pool_free(softc->othersc_pool);
+ return (EIO);
+ }
+ return (0);
+};
+
+static int
+ctl_ha_shutdown(void)
+{
+ struct ctl_softc *softc = control_softc;
+ struct ctl_port *port;
+
+ ctl_ha_msg_shutdown(softc);
+ if (ctl_ha_msg_deregister(CTL_HA_CHAN_CTL) != CTL_HA_STATUS_SUCCESS)
+ return (EIO);
+ if (ctl_ha_msg_destroy(softc) != CTL_HA_STATUS_SUCCESS)
+ return (EIO);
+ ctl_pool_free(softc->othersc_pool);
+ while ((port = STAILQ_FIRST(&ha_frontend.port_list)) != NULL) {
+ ctl_port_deregister(port);
+ free(port->port_name, M_CTL);
+ free(port, M_CTL);
+ }
+ return (0);
};
static void
@@ -696,8 +741,6 @@ ctl_ha_done(union ctl_io *io)
msg.scsi.tag_num = io->scsiio.tag_num;
msg.scsi.tag_type = io->scsiio.tag_type;
msg.scsi.sense_len = io->scsiio.sense_len;
- msg.scsi.sense_residual = io->scsiio.sense_residual;
- msg.scsi.residual = io->scsiio.residual;
memcpy(&msg.scsi.sense_data, &io->scsiio.sense_data,
io->scsiio.sense_len);
ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg,
@@ -725,8 +768,6 @@ ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc,
ctsio->io_hdr.status = msg_info->hdr.status;
ctsio->scsi_status = msg_info->scsi.scsi_status;
ctsio->sense_len = msg_info->scsi.sense_len;
- ctsio->sense_residual = msg_info->scsi.sense_residual;
- ctsio->residual = msg_info->scsi.residual;
memcpy(&ctsio->sense_data, &msg_info->scsi.sense_data,
msg_info->scsi.sense_len);
ctl_enqueue_isc((union ctl_io *)ctsio);
@@ -1495,13 +1536,12 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_event event, int param)
io->io_hdr.msg_type = CTL_MSG_DATAMOVE_DONE;
io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG;
io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE;
- io->io_hdr.port_status = msg->scsi.fetd_status;
- io->scsiio.residual = msg->scsi.residual;
+ io->io_hdr.port_status = msg->scsi.port_status;
+ io->scsiio.kern_data_resid = msg->scsi.kern_data_resid;
if (msg->hdr.status != CTL_STATUS_NONE) {
io->io_hdr.status = msg->hdr.status;
io->scsiio.scsi_status = msg->scsi.scsi_status;
io->scsiio.sense_len = msg->scsi.sense_len;
- io->scsiio.sense_residual =msg->scsi.sense_residual;
memcpy(&io->scsiio.sense_data,
&msg->scsi.sense_data,
msg->scsi.sense_len);
@@ -1787,7 +1827,6 @@ ctl_init(void)
{
struct make_dev_args args;
struct ctl_softc *softc;
- void *other_pool;
int i, error;
softc = control_softc = malloc(sizeof(*control_softc), M_DEVBUF,
@@ -1860,15 +1899,6 @@ ctl_init(void)
STAILQ_INIT(&softc->be_list);
ctl_tpc_init(softc);
- if (ctl_pool_create(softc, "othersc", CTL_POOL_ENTRIES_OTHER_SC,
- &other_pool) != 0)
- {
- printf("ctl: can't allocate %d entry other SC pool, "
- "exiting\n", CTL_POOL_ENTRIES_OTHER_SC);
- return (ENOMEM);
- }
- softc->othersc_pool = other_pool;
-
if (worker_threads <= 0)
worker_threads = max(1, mp_ncpus / 4);
if (worker_threads > CTL_MAX_THREADS)
@@ -1888,22 +1918,19 @@ ctl_init(void)
&softc->ctl_proc, &thr->thread, 0, 0, "ctl", "work%d", i);
if (error != 0) {
printf("error creating CTL work thread!\n");
- ctl_pool_free(other_pool);
return (error);
}
}
error = kproc_kthread_add(ctl_lun_thread, softc,
- &softc->ctl_proc, NULL, 0, 0, "ctl", "lun");
+ &softc->ctl_proc, &softc->lun_thread, 0, 0, "ctl", "lun");
if (error != 0) {
printf("error creating CTL lun thread!\n");
- ctl_pool_free(other_pool);
return (error);
}
error = kproc_kthread_add(ctl_thresh_thread, softc,
- &softc->ctl_proc, NULL, 0, 0, "ctl", "thresh");
+ &softc->ctl_proc, &softc->thresh_thread, 0, 0, "ctl", "thresh");
if (error != 0) {
printf("error creating CTL threshold thread!\n");
- ctl_pool_free(other_pool);
return (error);
}
@@ -1912,58 +1939,54 @@ ctl_init(void)
softc, 0, ctl_ha_role_sysctl, "I", "HA role for this head");
if (softc->is_single == 0) {
- ctl_frontend_register(&ha_frontend);
- if (ctl_ha_msg_init(softc) != CTL_HA_STATUS_SUCCESS) {
- printf("ctl_init: ctl_ha_msg_init failed.\n");
+ if (ctl_frontend_register(&ha_frontend) != 0)
softc->is_single = 1;
- } else
- if (ctl_ha_msg_register(CTL_HA_CHAN_CTL, ctl_isc_event_handler)
- != CTL_HA_STATUS_SUCCESS) {
- printf("ctl_init: ctl_ha_msg_register failed.\n");
- softc->is_single = 1;
- }
}
return (0);
}
-void
+static int
ctl_shutdown(void)
{
struct ctl_softc *softc = control_softc;
- struct ctl_lun *lun, *next_lun;
+ int i;
- if (softc->is_single == 0) {
- ctl_ha_msg_shutdown(softc);
- if (ctl_ha_msg_deregister(CTL_HA_CHAN_CTL)
- != CTL_HA_STATUS_SUCCESS)
- printf("%s: ctl_ha_msg_deregister failed.\n", __func__);
- if (ctl_ha_msg_destroy(softc) != CTL_HA_STATUS_SUCCESS)
- printf("%s: ctl_ha_msg_destroy failed.\n", __func__);
+ if (softc->is_single == 0)
ctl_frontend_deregister(&ha_frontend);
- }
-
- mtx_lock(&softc->ctl_lock);
-
- STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun)
- ctl_free_lun(lun);
- mtx_unlock(&softc->ctl_lock);
+ destroy_dev(softc->dev);
-#if 0
- ctl_shutdown_thread(softc->work_thread);
- mtx_destroy(&softc->queue_lock);
-#endif
+ /* Shutdown CTL threads. */
+ softc->shutdown = 1;
+ for (i = 0; i < worker_threads; i++) {
+ struct ctl_thread *thr = &softc->threads[i];
+ while (thr->thread != NULL) {
+ wakeup(thr);
+ if (thr->thread != NULL)
+ pause("CTL thr shutdown", 1);
+ }
+ mtx_destroy(&thr->queue_lock);
+ }
+ while (softc->lun_thread != NULL) {
+ wakeup(&softc->pending_lun_queue);
+ if (softc->lun_thread != NULL)
+ pause("CTL thr shutdown", 1);
+ }
+ while (softc->thresh_thread != NULL) {
+ wakeup(softc->thresh_thread);
+ if (softc->thresh_thread != NULL)
+ pause("CTL thr shutdown", 1);
+ }
ctl_tpc_shutdown(softc);
uma_zdestroy(softc->io_zone);
mtx_destroy(&softc->ctl_lock);
- destroy_dev(softc->dev);
-
sysctl_ctx_free(&softc->sysctl_ctx);
free(softc, M_DEVBUF);
control_softc = NULL;
+ return (0);
}
static int
@@ -1974,7 +1997,7 @@ ctl_module_event_handler(module_t mod, int what, void *arg)
case MOD_LOAD:
return (ctl_init());
case MOD_UNLOAD:
- return (EBUSY);
+ return (ctl_shutdown());
default:
return (EOPNOTSUPP);
}
@@ -6498,15 +6521,8 @@ ctl_mode_sense(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
ctsio->kern_rel_offset = 0;
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
switch (ctsio->cdb[0]) {
case MODE_SENSE_6: {
@@ -6850,15 +6866,8 @@ ctl_log_sense(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
ctsio->kern_rel_offset = 0;
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
header = (struct scsi_log_header *)ctsio->kern_data_ptr;
header->page = page_index->page_code;
@@ -6913,7 +6922,6 @@ ctl_read_capacity(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO);
data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr;
- ctsio->residual = 0;
ctsio->kern_data_len = sizeof(*data);
ctsio->kern_total_len = sizeof(*data);
ctsio->kern_rel_offset = 0;
@@ -6971,18 +6979,10 @@ ctl_read_capacity_16(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO);
data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr;
-
- if (sizeof(*data) < alloc_len) {
- ctsio->residual = alloc_len - sizeof(*data);
- ctsio->kern_data_len = sizeof(*data);
- ctsio->kern_total_len = sizeof(*data);
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(sizeof(*data), alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
scsi_u64to8b(lun->be_lun->maxlba, data->addr);
/* XXX KDM this may not be 512 bytes... */
@@ -7025,18 +7025,10 @@ ctl_get_lba_status(struct ctl_scsiio *ctsio)
total_len = sizeof(*data) + sizeof(data->descr[0]);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
data = (struct scsi_get_lba_status_data *)ctsio->kern_data_ptr;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/* Fill dummy data in case backend can't tell anything. */
scsi_ulto4b(4 + sizeof(data->descr[0]), data->length);
@@ -7087,17 +7079,10 @@ ctl_read_defect(struct ctl_scsiio *ctsio)
}
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
if (ctsio->cdb[0] == READ_DEFECT_DATA_10) {
data10 = (struct scsi_read_defect_data_hdr_10 *)
@@ -7182,19 +7167,10 @@ ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
if (ext) {
rtg_ext_ptr = (struct scsi_target_group_data_extended *)
@@ -7382,19 +7358,10 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
switch (cdb->options & RSO_OPTIONS_MASK) {
case RSO_OPTIONS_ALL:
@@ -7495,19 +7462,10 @@ ctl_report_supported_tmf(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_report_supported_tmf_ext_data *)ctsio->kern_data_ptr;
data->byte1 |= RST_ATS | RST_ATSS | RST_CTSS | RST_LURS | RST_QTS |
@@ -7542,19 +7500,10 @@ ctl_report_timestamp(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_report_timestamp_data *)ctsio->kern_data_ptr;
scsi_ulto2b(sizeof(*data) - 2, data->length);
@@ -7615,19 +7564,10 @@ retry:
mtx_unlock(&lun->lun_lock);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
-
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
mtx_lock(&lun->lun_lock);
switch (cdb->action) {
@@ -9174,18 +9114,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio)
*/
lun_datalen = sizeof(*lun_data) +
(num_filled * sizeof(struct scsi_report_luns_lundata));
-
- if (lun_datalen < alloc_len) {
- ctsio->residual = alloc_len - lun_datalen;
- ctsio->kern_data_len = lun_datalen;
- ctsio->kern_total_len = lun_datalen;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(lun_datalen, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* We set this to the actual data length, regardless of how much
@@ -9236,19 +9168,16 @@ ctl_request_sense(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(sizeof(*sense_ptr), M_CTL, M_WAITOK);
sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_rel_offset = 0;
/*
* struct scsi_sense_data, which is currently set to 256 bytes, is
* larger than the largest allowed value for the length field in the
* REQUEST SENSE CDB, which is 252 bytes as of SPC-4.
*/
- ctsio->residual = 0;
ctsio->kern_data_len = cdb->length;
ctsio->kern_total_len = cdb->length;
- ctsio->kern_rel_offset = 0;
- ctsio->kern_sg_entries = 0;
-
/*
* If we don't have a LUN, we don't have any pending sense.
*/
@@ -9373,19 +9302,10 @@ ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len)
SCSI_EVPD_NUM_SUPPORTED_PAGES;
ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO);
pages = (struct scsi_vpd_supported_pages *)ctsio->kern_data_ptr;
- ctsio->kern_sg_entries = 0;
-
- if (sup_page_size < alloc_len) {
- ctsio->residual = alloc_len - sup_page_size;
- ctsio->kern_data_len = sup_page_size;
- ctsio->kern_total_len = sup_page_size;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(sup_page_size, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9443,17 +9363,10 @@ ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len)
data_len = 4 + CTL_SN_LEN;
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
sn_ptr = (struct scsi_vpd_unit_serial_number *)ctsio->kern_data_ptr;
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9500,18 +9413,9 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
eid_ptr = (struct scsi_vpd_extended_inquiry_data *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
- ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9574,19 +9478,10 @@ ctl_inquiry_evpd_mpp(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
mpp_ptr = (struct scsi_vpd_mode_page_policy *)ctsio->kern_data_ptr;
- ctsio->kern_sg_entries = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9639,18 +9534,10 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9767,18 +9654,10 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
sp = (struct scsi_vpd_scsi_ports *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9842,18 +9721,10 @@ ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(sizeof(*bl_ptr), M_CTL, M_WAITOK | M_ZERO);
bl_ptr = (struct scsi_vpd_block_limits *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
-
- if (sizeof(*bl_ptr) < alloc_len) {
- ctsio->residual = alloc_len - sizeof(*bl_ptr);
- ctsio->kern_data_len = sizeof(*bl_ptr);
- ctsio->kern_total_len = sizeof(*bl_ptr);
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(sizeof(*bl_ptr), alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9917,18 +9788,9 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(sizeof(*bdc_ptr), M_CTL, M_WAITOK | M_ZERO);
bdc_ptr = (struct scsi_vpd_block_device_characteristics *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
-
- if (sizeof(*bdc_ptr) < alloc_len) {
- ctsio->residual = alloc_len - sizeof(*bdc_ptr);
- ctsio->kern_data_len = sizeof(*bdc_ptr);
- ctsio->kern_total_len = sizeof(*bdc_ptr);
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
- ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(sizeof(*bdc_ptr), alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -9973,18 +9835,9 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(sizeof(*lbp_ptr), M_CTL, M_WAITOK | M_ZERO);
lbp_ptr = (struct scsi_vpd_logical_block_prov *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
-
- if (sizeof(*lbp_ptr) < alloc_len) {
- ctsio->residual = alloc_len - sizeof(*lbp_ptr);
- ctsio->kern_data_len = sizeof(*lbp_ptr);
- ctsio->kern_total_len = sizeof(*lbp_ptr);
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
- ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(sizeof(*lbp_ptr), alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -10118,16 +9971,8 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio)
inq_ptr = (struct scsi_inquiry_data *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
ctsio->kern_rel_offset = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
if (lun != NULL) {
if ((lun->flags & CTL_LUN_PRIMARY_SC) ||
@@ -10258,6 +10103,9 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio)
} else if (port_type == CTL_PORT_SAS) {
/* SAS (no version claimed) */
scsi_ulto2b(0x0BE0, inq_ptr->version3);
+ } else if (port_type == CTL_PORT_UMASS) {
+ /* USB Mass Storage Class Bulk-Only Transport, Revision 1.0 */
+ scsi_ulto2b(0x1730, inq_ptr->version3);
}
if (lun == NULL) {
@@ -10511,15 +10359,8 @@ done:
data_len = (uint8_t *)feature - (uint8_t *)hdr;
}
scsi_ulto4b(data_len - 4, hdr->data_length);
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
@@ -10550,16 +10391,8 @@ ctl_get_event_status(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
ctsio->kern_rel_offset = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
hdr = (struct scsi_get_event_status_header *)ctsio->kern_data_ptr;
scsi_ulto2b(0, hdr->descr_length);
@@ -10587,16 +10420,8 @@ ctl_mechanism_status(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
ctsio->kern_rel_offset = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
hdr = (struct scsi_mechanism_status_header *)ctsio->kern_data_ptr;
hdr->state1 = 0x00;
@@ -10646,16 +10471,8 @@ ctl_read_toc(struct ctl_scsiio *ctsio)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
ctsio->kern_rel_offset = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
hdr = (struct scsi_read_toc_hdr *)ctsio->kern_data_ptr;
if (format == 0) {
@@ -12647,15 +12464,14 @@ ctl_send_datamove_done(union ctl_io *io, int have_lock)
msg.hdr.serializing_sc = io->io_hdr.serializing_sc;
msg.hdr.nexus = io->io_hdr.nexus;
msg.hdr.status = io->io_hdr.status;
+ msg.scsi.kern_data_resid = io->scsiio.kern_data_resid;
msg.scsi.tag_num = io->scsiio.tag_num;
msg.scsi.tag_type = io->scsiio.tag_type;
msg.scsi.scsi_status = io->scsiio.scsi_status;
memcpy(&msg.scsi.sense_data, &io->scsiio.sense_data,
io->scsiio.sense_len);
msg.scsi.sense_len = io->scsiio.sense_len;
- msg.scsi.sense_residual = io->scsiio.sense_residual;
- msg.scsi.fetd_status = io->io_hdr.port_status;
- msg.scsi.residual = io->scsiio.residual;
+ msg.scsi.port_status = io->io_hdr.port_status;
io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE;
if (io->io_hdr.flags & CTL_FLAG_FAILOVER) {
ctl_failover_io(io, /*have_lock*/ have_lock);
@@ -13483,7 +13299,7 @@ ctl_work_thread(void *arg)
CTL_DEBUG_PRINT(("ctl_work_thread starting\n"));
- for (;;) {
+ while (!softc->shutdown) {
/*
* We handle the queues in this order:
* - ISC
@@ -13533,6 +13349,8 @@ ctl_work_thread(void *arg)
/* Sleep until we have something to do. */
mtx_sleep(thr, &thr->queue_lock, PDROP | PRIBIO, "-", 0);
}
+ thr->thread = NULL;
+ kthread_exit();
}
static void
@@ -13543,7 +13361,7 @@ ctl_lun_thread(void *arg)
CTL_DEBUG_PRINT(("ctl_lun_thread starting\n"));
- for (;;) {
+ while (!softc->shutdown) {
mtx_lock(&softc->ctl_lock);
be_lun = STAILQ_FIRST(&softc->pending_lun_queue);
if (be_lun != NULL) {
@@ -13557,6 +13375,8 @@ ctl_lun_thread(void *arg)
mtx_sleep(&softc->pending_lun_queue, &softc->ctl_lock,
PDROP | PRIBIO, "-", 0);
}
+ softc->lun_thread = NULL;
+ kthread_exit();
}
static void
@@ -13572,7 +13392,7 @@ ctl_thresh_thread(void *arg)
CTL_DEBUG_PRINT(("ctl_thresh_thread starting\n"));
- for (;;) {
+ while (!softc->shutdown) {
mtx_lock(&softc->ctl_lock);
STAILQ_FOREACH(lun, &softc->lun_list, links) {
if ((lun->flags & CTL_LUN_DISABLED) ||
@@ -13657,9 +13477,11 @@ ctl_thresh_thread(void *arg)
mtx_lock(&softc->ctl_lock);
}
}
- mtx_unlock(&softc->ctl_lock);
- pause("-", CTL_LBP_PERIOD * hz);
+ mtx_sleep(&softc->thresh_thread, &softc->ctl_lock,
+ PDROP | PRIBIO, "-", CTL_LBP_PERIOD * hz);
}
+ softc->thresh_thread = NULL;
+ kthread_exit();
}
static void
diff --git a/sys/cam/ctl/ctl.h b/sys/cam/ctl/ctl.h
index d9a4f5a6c18d..3370d15ee6a9 100644
--- a/sys/cam/ctl/ctl.h
+++ b/sys/cam/ctl/ctl.h
@@ -53,6 +53,7 @@ typedef enum {
CTL_PORT_INTERNAL = 0x08,
CTL_PORT_ISCSI = 0x10,
CTL_PORT_SAS = 0x20,
+ CTL_PORT_UMASS = 0x40,
CTL_PORT_ALL = 0xff,
CTL_PORT_ISC = 0x100 // FC port for inter-shelf communication
} ctl_port_type;
diff --git a/sys/cam/ctl/ctl_backend.c b/sys/cam/ctl/ctl_backend.c
index 86f7d3c35a70..bac7e857b6fc 100644
--- a/sys/cam/ctl/ctl_backend.c
+++ b/sys/cam/ctl/ctl_backend.c
@@ -67,11 +67,10 @@ ctl_backend_register(struct ctl_backend_driver *be)
{
struct ctl_softc *softc = control_softc;
struct ctl_backend_driver *be_tmp;
+ int error;
+ /* Sanity check, make sure this isn't a duplicate registration. */
mtx_lock(&softc->ctl_lock);
- /*
- * Sanity check, make sure this isn't a duplicate registration.
- */
STAILQ_FOREACH(be_tmp, &softc->be_list, links) {
if (strcmp(be_tmp->name, be->name) == 0) {
mtx_unlock(&softc->ctl_lock);
@@ -79,39 +78,24 @@ ctl_backend_register(struct ctl_backend_driver *be)
}
}
mtx_unlock(&softc->ctl_lock);
-
- /*
- * Call the backend's initialization routine.
- */
- be->init();
-
- mtx_lock(&softc->ctl_lock);
-
- STAILQ_INSERT_TAIL(&softc->be_list, be, links);
-
- softc->num_backends++;
-
- /*
- * Don't want to increment the usage count for internal consumers,
- * we won't be able to unload otherwise.
- */
- /* XXX KDM find a substitute for this? */
-#if 0
- if ((be->flags & CTL_BE_FLAG_INTERNAL) == 0)
- MOD_INC_USE_COUNT;
-#endif
-
#ifdef CS_BE_CONFIG_MOVE_DONE_IS_NOT_USED
be->config_move_done = ctl_config_move_done;
#endif
- /* XXX KDM fix this! */
be->num_luns = 0;
-#if 0
- atomic_set(&be->num_luns, 0);
-#endif
- mtx_unlock(&softc->ctl_lock);
+ /* Call the backend's initialization routine. */
+ if (be->init != NULL) {
+ if ((error = be->init()) != 0) {
+ printf("%s backend init error: %d\n",
+ be->name, error);
+ return (error);
+ }
+ }
+ mtx_lock(&softc->ctl_lock);
+ STAILQ_INSERT_TAIL(&softc->be_list, be, links);
+ softc->num_backends++;
+ mtx_unlock(&softc->ctl_lock);
return (0);
}
@@ -119,30 +103,21 @@ int
ctl_backend_deregister(struct ctl_backend_driver *be)
{
struct ctl_softc *softc = control_softc;
+ int error;
- mtx_lock(&softc->ctl_lock);
-
-#if 0
- if (atomic_read(&be->num_luns) != 0) {
-#endif
- /* XXX KDM fix this! */
- if (be->num_luns != 0) {
- mtx_unlock(&softc->ctl_lock);
- return (-1);
+ /* Call the backend's shutdown routine. */
+ if (be->shutdown != NULL) {
+ if ((error = be->shutdown()) != 0) {
+ printf("%s backend shutdown error: %d\n",
+ be->name, error);
+ return (error);
+ }
}
+ mtx_lock(&softc->ctl_lock);
STAILQ_REMOVE(&softc->be_list, be, ctl_backend_driver, links);
-
softc->num_backends--;
-
- /* XXX KDM find a substitute for this? */
-#if 0
- if ((be->flags & CTL_BE_FLAG_INTERNAL) == 0)
- MOD_DEC_USE_COUNT;
-#endif
-
mtx_unlock(&softc->ctl_lock);
-
return (0);
}
diff --git a/sys/cam/ctl/ctl_backend.h b/sys/cam/ctl/ctl_backend.h
index d8ada8377738..4202efc137d3 100644
--- a/sys/cam/ctl/ctl_backend.h
+++ b/sys/cam/ctl/ctl_backend.h
@@ -55,12 +55,13 @@ typedef enum {
{ \
switch (type) { \
case MOD_LOAD: \
- ctl_backend_register( \
- (struct ctl_backend_driver *)data); \
+ return (ctl_backend_register( \
+ (struct ctl_backend_driver *)data)); \
break; \
case MOD_UNLOAD: \
- printf(#name " module unload - not possible for this module type\n"); \
- return EINVAL; \
+ return (ctl_backend_deregister( \
+ (struct ctl_backend_driver *)data)); \
+ break; \
default: \
return EOPNOTSUPP; \
} \
@@ -179,10 +180,10 @@ struct ctl_be_lun {
typedef enum {
CTL_BE_FLAG_NONE = 0x00, /* no flags */
CTL_BE_FLAG_HAS_CONFIG = 0x01, /* can do config reads, writes */
- CTL_BE_FLAG_INTERNAL = 0x02 /* don't inc mod refcount */
} ctl_backend_flags;
typedef int (*be_init_t)(void);
+typedef int (*be_shutdown_t)(void);
typedef int (*be_func_t)(union ctl_io *io);
typedef void (*be_vfunc_t)(union ctl_io *io);
typedef int (*be_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
@@ -194,6 +195,7 @@ struct ctl_backend_driver {
char name[CTL_BE_NAME_LEN]; /* passed to CTL */
ctl_backend_flags flags; /* passed to CTL */
be_init_t init; /* passed to CTL */
+ be_shutdown_t shutdown; /* passed to CTL */
be_func_t data_submit; /* passed to CTL */
be_func_t data_move_done; /* passed to CTL */
be_func_t config_read; /* passed to CTL */
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c
index 2bc8d697cd18..4a6141ff143f 100644
--- a/sys/cam/ctl/ctl_backend_block.c
+++ b/sys/cam/ctl/ctl_backend_block.c
@@ -183,6 +183,7 @@ struct ctl_be_block_lun {
*/
struct ctl_be_block_softc {
struct mtx lock;
+ uma_zone_t beio_zone;
int num_luns;
STAILQ_HEAD(, ctl_be_block_lun) lun_list;
};
@@ -273,13 +274,15 @@ static int ctl_be_block_config_write(union ctl_io *io);
static int ctl_be_block_config_read(union ctl_io *io);
static int ctl_be_block_lun_info(void *be_lun, struct sbuf *sb);
static uint64_t ctl_be_block_lun_attr(void *be_lun, const char *attrname);
-int ctl_be_block_init(void);
+static int ctl_be_block_init(void);
+static int ctl_be_block_shutdown(void);
static struct ctl_backend_driver ctl_be_block_driver =
{
.name = "block",
.flags = CTL_BE_FLAG_HAS_CONFIG,
.init = ctl_be_block_init,
+ .shutdown = ctl_be_block_shutdown,
.data_submit = ctl_be_block_submit,
.data_move_done = ctl_be_block_move_done,
.config_read = ctl_be_block_config_read,
@@ -292,14 +295,12 @@ static struct ctl_backend_driver ctl_be_block_driver =
MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend");
CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver);
-static uma_zone_t beio_zone;
-
static struct ctl_be_block_io *
ctl_alloc_beio(struct ctl_be_block_softc *softc)
{
struct ctl_be_block_io *beio;
- beio = uma_zalloc(beio_zone, M_WAITOK | M_ZERO);
+ beio = uma_zalloc(softc->beio_zone, M_WAITOK | M_ZERO);
beio->softc = softc;
return (beio);
}
@@ -332,7 +333,7 @@ ctl_free_beio(struct ctl_be_block_io *beio)
duplicate_free, beio->num_segs);
}
- uma_zfree(beio_zone, beio);
+ uma_zfree(beio->softc->beio_zone, beio);
}
static void
@@ -2859,19 +2860,40 @@ ctl_be_block_lun_attr(void *be_lun, const char *attrname)
return (lun->getattr(lun, attrname));
}
-int
+static int
ctl_be_block_init(void)
{
- struct ctl_be_block_softc *softc;
- int retval;
-
- softc = &backend_block_softc;
- retval = 0;
+ struct ctl_be_block_softc *softc = &backend_block_softc;
mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF);
- beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io),
+ softc->beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
STAILQ_INIT(&softc->lun_list);
+ return (0);
+}
- return (retval);
+
+static int
+ctl_be_block_shutdown(void)
+{
+ struct ctl_be_block_softc *softc = &backend_block_softc;
+ struct ctl_be_block_lun *lun, *next_lun;
+
+ mtx_lock(&softc->lock);
+ STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) {
+ /*
+ * Drop our lock here. Since ctl_invalidate_lun() can call
+ * back into us, this could potentially lead to a recursive
+ * lock of the same mutex, which would cause a hang.
+ */
+ mtx_unlock(&softc->lock);
+ ctl_disable_lun(&lun->cbe_lun);
+ ctl_invalidate_lun(&lun->cbe_lun);
+ mtx_lock(&softc->lock);
+ }
+ mtx_unlock(&softc->lock);
+
+ uma_zdestroy(softc->beio_zone);
+ mtx_destroy(&softc->lock);
+ return (0);
}
diff --git a/sys/cam/ctl/ctl_backend_ramdisk.c b/sys/cam/ctl/ctl_backend_ramdisk.c
index 71ed07ad909a..5b85d9c700fb 100644
--- a/sys/cam/ctl/ctl_backend_ramdisk.c
+++ b/sys/cam/ctl/ctl_backend_ramdisk.c
@@ -108,8 +108,8 @@ struct ctl_be_ramdisk_softc {
static struct ctl_be_ramdisk_softc rd_softc;
extern struct ctl_softc *control_softc;
-int ctl_backend_ramdisk_init(void);
-void ctl_backend_ramdisk_shutdown(void);
+static int ctl_backend_ramdisk_init(void);
+static int ctl_backend_ramdisk_shutdown(void);
static int ctl_backend_ramdisk_move_done(union ctl_io *io);
static int ctl_backend_ramdisk_submit(union ctl_io *io);
static void ctl_backend_ramdisk_continue(union ctl_io *io);
@@ -133,6 +133,7 @@ static struct ctl_backend_driver ctl_be_ramdisk_driver =
.name = "ramdisk",
.flags = CTL_BE_FLAG_HAS_CONFIG,
.init = ctl_backend_ramdisk_init,
+ .shutdown = ctl_backend_ramdisk_shutdown,
.data_submit = ctl_backend_ramdisk_submit,
.data_move_done = ctl_backend_ramdisk_move_done,
.config_read = ctl_backend_ramdisk_config_read,
@@ -170,7 +171,7 @@ ctl_backend_ramdisk_init(void)
return (0);
}
-void
+static int
ctl_backend_ramdisk_shutdown(void)
{
struct ctl_be_ramdisk_softc *softc = &rd_softc;
@@ -192,20 +193,16 @@ ctl_backend_ramdisk_shutdown(void)
mtx_lock(&softc->lock);
}
mtx_unlock(&softc->lock);
-
+
#ifdef CTL_RAMDISK_PAGES
for (i = 0; i < softc->num_pages; i++)
free(softc->ramdisk_pages[i], M_RAMDISK);
-
free(softc->ramdisk_pages, M_RAMDISK);
#else
free(softc->ramdisk_buffer, M_RAMDISK);
#endif
-
- if (ctl_backend_deregister(&ctl_be_ramdisk_driver) != 0) {
- printf("ctl_backend_ramdisk_shutdown: "
- "ctl_backend_deregister() failed!\n");
- }
+ mtx_destroy(&softc->lock);
+ return (0);
}
static int
diff --git a/sys/cam/ctl/ctl_frontend.c b/sys/cam/ctl/ctl_frontend.c
index 03ee9da7566f..765a31d96a22 100644
--- a/sys/cam/ctl/ctl_frontend.c
+++ b/sys/cam/ctl/ctl_frontend.c
@@ -70,12 +70,11 @@ ctl_frontend_register(struct ctl_frontend *fe)
{
struct ctl_softc *softc = control_softc;
struct ctl_frontend *fe_tmp;
+ int error;
KASSERT(softc != NULL, ("CTL is not initialized"));
- /*
- * Sanity check, make sure this isn't a duplicate registration.
- */
+ /* Sanity check, make sure this isn't a duplicate registration. */
mtx_lock(&softc->ctl_lock);
STAILQ_FOREACH(fe_tmp, &softc->fe_list, links) {
if (strcmp(fe_tmp->name, fe->name) == 0) {
@@ -86,11 +85,14 @@ ctl_frontend_register(struct ctl_frontend *fe)
mtx_unlock(&softc->ctl_lock);
STAILQ_INIT(&fe->port_list);
- /*
- * Call the frontend's initialization routine.
- */
- if (fe->init != NULL)
- fe->init();
+ /* Call the frontend's initialization routine. */
+ if (fe->init != NULL) {
+ if ((error = fe->init()) != 0) {
+ printf("%s frontend init error: %d\n",
+ fe->name, error);
+ return (error);
+ }
+ }
mtx_lock(&softc->ctl_lock);
softc->num_frontends++;
@@ -103,20 +105,21 @@ int
ctl_frontend_deregister(struct ctl_frontend *fe)
{
struct ctl_softc *softc = control_softc;
+ int error;
- if (!STAILQ_EMPTY(&fe->port_list))
- return (-1);
+ /* Call the frontend's shutdown routine.*/
+ if (fe->shutdown != NULL) {
+ if ((error = fe->shutdown()) != 0) {
+ printf("%s frontend shutdown error: %d\n",
+ fe->name, error);
+ return (error);
+ }
+ }
mtx_lock(&softc->ctl_lock);
STAILQ_REMOVE(&softc->fe_list, fe, ctl_frontend, links);
softc->num_frontends--;
mtx_unlock(&softc->ctl_lock);
-
- /*
- * Call the frontend's shutdown routine.
- */
- if (fe->shutdown != NULL)
- fe->shutdown();
return (0);
}
diff --git a/sys/cam/ctl/ctl_frontend.h b/sys/cam/ctl/ctl_frontend.h
index 37e6824eaa8d..38eb863a08f4 100644
--- a/sys/cam/ctl/ctl_frontend.h
+++ b/sys/cam/ctl/ctl_frontend.h
@@ -49,7 +49,7 @@ typedef enum {
} ctl_port_status;
typedef int (*fe_init_t)(void);
-typedef void (*fe_shutdown_t)(void);
+typedef int (*fe_shutdown_t)(void);
typedef void (*port_func_t)(void *onoff_arg);
typedef int (*port_info_func_t)(void *onoff_arg, struct sbuf *sb);
typedef int (*lun_func_t)(void *arg, int lun_id);
@@ -61,12 +61,13 @@ typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
{ \
switch (type) { \
case MOD_LOAD: \
- ctl_frontend_register( \
- (struct ctl_frontend *)data); \
+ return (ctl_frontend_register( \
+ (struct ctl_frontend *)data)); \
break; \
case MOD_UNLOAD: \
- printf(#name " module unload - not possible for this module type\n"); \
- return EINVAL; \
+ return (ctl_frontend_deregister( \
+ (struct ctl_frontend *)data)); \
+ break; \
default: \
return EOPNOTSUPP; \
} \
diff --git a/sys/cam/ctl/ctl_frontend_cam_sim.c b/sys/cam/ctl/ctl_frontend_cam_sim.c
index 406adde9d3f8..00a960e9e28c 100644
--- a/sys/cam/ctl/ctl_frontend_cam_sim.c
+++ b/sys/cam/ctl/ctl_frontend_cam_sim.c
@@ -94,15 +94,14 @@ struct cfcs_softc {
CAM_SNS_BUF_PHYS | CAM_CDB_PHYS | CAM_SENSE_PTR | \
CAM_SENSE_PHYS)
-int cfcs_init(void);
+static int cfcs_init(void);
+static int cfcs_shutdown(void);
static void cfcs_poll(struct cam_sim *sim);
static void cfcs_online(void *arg);
static void cfcs_offline(void *arg);
static void cfcs_datamove(union ctl_io *io);
static void cfcs_done(union ctl_io *io);
void cfcs_action(struct cam_sim *sim, union ccb *ccb);
-static void cfcs_async(void *callback_arg, uint32_t code,
- struct cam_path *path, void *arg);
struct cfcs_softc cfcs_softc;
/*
@@ -121,14 +120,14 @@ static struct ctl_frontend cfcs_frontend =
{
.name = "camsim",
.init = cfcs_init,
+ .shutdown = cfcs_shutdown,
};
CTL_FRONTEND_DECLARE(ctlcfcs, cfcs_frontend);
-int
+static int
cfcs_init(void)
{
struct cfcs_softc *softc;
- struct ccb_setasync csa;
struct ctl_port *port;
int retval;
@@ -214,13 +213,6 @@ cfcs_init(void)
goto bailout;
}
- xpt_setup_ccb(&csa.ccb_h, softc->path, CAM_PRIORITY_NONE);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = AC_LOST_DEVICE;
- csa.callback = cfcs_async;
- csa.callback_arg = softc->sim;
- xpt_action((union ccb *)&csa);
-
mtx_unlock(&softc->lock);
return (retval);
@@ -236,6 +228,27 @@ bailout:
return (retval);
}
+static int
+cfcs_shutdown(void)
+{
+ struct cfcs_softc *softc = &cfcs_softc;
+ struct ctl_port *port = &softc->port;
+ int error;
+
+ ctl_port_offline(port);
+
+ mtx_lock(&softc->lock);
+ xpt_free_path(softc->path);
+ xpt_bus_deregister(cam_sim_path(softc->sim));
+ cam_sim_free(softc->sim, /*free_devq*/ TRUE);
+ mtx_unlock(&softc->lock);
+ mtx_destroy(&softc->lock);
+
+ if ((error = ctl_port_deregister(port)) != 0)
+ printf("%s: cam_sim port deregistration failed\n", __func__);
+ return (error);
+}
+
static void
cfcs_poll(struct cam_sim *sim)
{
@@ -801,9 +814,3 @@ cfcs_action(struct cam_sim *sim, union ccb *ccb)
break;
}
}
-
-static void
-cfcs_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
-{
-
-}
diff --git a/sys/cam/ctl/ctl_frontend_ioctl.c b/sys/cam/ctl/ctl_frontend_ioctl.c
index 3f5c23c0c55e..4063c97392df 100644
--- a/sys/cam/ctl/ctl_frontend_ioctl.c
+++ b/sys/cam/ctl/ctl_frontend_ioctl.c
@@ -76,7 +76,7 @@ struct cfi_softc {
static struct cfi_softc cfi_softc;
static int cfi_init(void);
-static void cfi_shutdown(void);
+static int cfi_shutdown(void);
static void cfi_datamove(union ctl_io *io);
static void cfi_done(union ctl_io *io);
@@ -93,6 +93,7 @@ cfi_init(void)
{
struct cfi_softc *isoftc = &cfi_softc;
struct ctl_port *port;
+ int error = 0;
memset(isoftc, 0, sizeof(*isoftc));
@@ -108,24 +109,25 @@ cfi_init(void)
port->targ_port = -1;
port->max_initiators = 1;
- if (ctl_port_register(port) != 0) {
+ if ((error = ctl_port_register(port)) != 0) {
printf("%s: ioctl port registration failed\n", __func__);
- return (0);
+ return (error);
}
ctl_port_online(port);
return (0);
}
-void
+static int
cfi_shutdown(void)
{
struct cfi_softc *isoftc = &cfi_softc;
- struct ctl_port *port;
+ struct ctl_port *port = &isoftc->port;
+ int error = 0;
- port = &isoftc->port;
ctl_port_offline(port);
- if (ctl_port_deregister(&isoftc->port) != 0)
- printf("%s: ctl_frontend_deregister() failed\n", __func__);
+ if ((error = ctl_port_deregister(port)) != 0)
+ printf("%s: ioctl port deregistration failed\n", __func__);
+ return (error);
}
/*
diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index 1171eb0876d6..55b56ae18cc6 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -144,7 +144,8 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN,
#define PDU_TOTAL_TRANSFER_LEN(X) (X)->ip_prv1
#define PDU_R2TSN(X) (X)->ip_prv2
-int cfiscsi_init(void);
+static int cfiscsi_init(void);
+static int cfiscsi_shutdown(void);
static void cfiscsi_online(void *arg);
static void cfiscsi_offline(void *arg);
static int cfiscsi_info(void *arg, struct sbuf *sb);
@@ -182,6 +183,7 @@ static struct ctl_frontend cfiscsi_frontend =
.name = "iscsi",
.init = cfiscsi_init,
.ioctl = cfiscsi_ioctl,
+ .shutdown = cfiscsi_shutdown,
};
CTL_FRONTEND_DECLARE(ctlcfiscsi, cfiscsi_frontend);
MODULE_DEPEND(ctlcfiscsi, icl, 1, 1, 1);
@@ -1321,7 +1323,7 @@ cfiscsi_session_delete(struct cfiscsi_session *cs)
free(cs, M_CFISCSI);
}
-int
+static int
cfiscsi_init(void)
{
struct cfiscsi_softc *softc;
@@ -1344,6 +1346,23 @@ cfiscsi_init(void)
return (0);
}
+static int
+cfiscsi_shutdown(void)
+{
+ struct cfiscsi_softc *softc = &cfiscsi_softc;
+
+ if (!TAILQ_EMPTY(&softc->sessions) || !TAILQ_EMPTY(&softc->targets))
+ return (EBUSY);
+
+ uma_zdestroy(cfiscsi_data_wait_zone);
+#ifdef ICL_KERNEL_PROXY
+ cv_destroy(&softc->accept_cv);
+#endif
+ cv_destroy(&softc->sessions_cv);
+ mtx_destroy(&softc->lock);
+ return (0);
+}
+
#ifdef ICL_KERNEL_PROXY
static void
cfiscsi_accept(struct socket *so, struct sockaddr *sa, int portal_id)
@@ -2084,7 +2103,8 @@ cfiscsi_ioctl_port_create(struct ctl_req *req)
if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) {
req->status = CTL_LUN_ERROR;
snprintf(req->error_str, sizeof(req->error_str),
- "target \"%s\" already exists", target);
+ "target \"%s\" for portal group tag %u already exists",
+ target, tag);
cfiscsi_target_release(ct);
ctl_free_opts(&opts);
return;
diff --git a/sys/cam/ctl/ctl_io.h b/sys/cam/ctl/ctl_io.h
index 2684bf8533cf..9c472f5cd80d 100644
--- a/sys/cam/ctl/ctl_io.h
+++ b/sys/cam/ctl/ctl_io.h
@@ -320,7 +320,7 @@ struct ctl_scsiio {
uint8_t sense_len; /* Returned sense length */
uint8_t scsi_status; /* SCSI status byte */
uint8_t sense_residual; /* Unused. */
- uint32_t residual; /* data residual length */
+ uint32_t residual; /* Unused */
uint32_t tag_num; /* tag number */
ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/
uint8_t cdb_len; /* CDB length */
@@ -373,7 +373,7 @@ struct ctl_taskio {
/*
* HA link messages.
*/
-#define CTL_HA_VERSION 2
+#define CTL_HA_VERSION 3
/*
* Used for CTL_MSG_LOGIN.
@@ -469,7 +469,8 @@ struct ctl_ha_msg_dt {
};
/*
- * Used for CTL_MSG_SERIALIZE, CTL_MSG_FINISH_IO, CTL_MSG_BAD_JUJU.
+ * Used for CTL_MSG_SERIALIZE, CTL_MSG_FINISH_IO, CTL_MSG_BAD_JUJU,
+ * and CTL_MSG_DATAMOVE_DONE.
*/
struct ctl_ha_msg_scsi {
struct ctl_ha_msg_hdr hdr;
@@ -479,10 +480,9 @@ struct ctl_ha_msg_scsi {
uint8_t cdb_len; /* CDB length */
uint8_t scsi_status; /* SCSI status byte */
uint8_t sense_len; /* Returned sense length */
- uint8_t sense_residual; /* sense residual length */
- uint32_t residual; /* data residual length */
- uint32_t fetd_status; /* trans status, set by FETD,
+ uint32_t port_status; /* trans status, set by FETD,
0 = good*/
+ uint32_t kern_data_resid; /* for DATAMOVE_DONE */
struct scsi_sense_data sense_data; /* sense data */
};
diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h
index 3f46769806b1..40f0e6127401 100644
--- a/sys/cam/ctl/ctl_private.h
+++ b/sys/cam/ctl/ctl_private.h
@@ -470,7 +470,10 @@ struct ctl_softc {
STAILQ_HEAD(, ctl_backend_driver) be_list;
struct uma_zone *io_zone;
uint32_t cur_pool_id;
+ int shutdown;
struct ctl_thread threads[CTL_MAX_THREADS];
+ struct thread *lun_thread;
+ struct thread *thresh_thread;
TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens;
struct callout tpc_timeout;
struct mtx tpc_lock;
diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c
index 9e1cfa852edb..c8d60cad0194 100644
--- a/sys/cam/ctl/ctl_tpc.c
+++ b/sys/cam/ctl/ctl_tpc.c
@@ -282,19 +282,10 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio *ctsio, int alloc_len)
ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
tpc_ptr = (struct scsi_vpd_tpc *)ctsio->kern_data_ptr;
- ctsio->kern_sg_entries = 0;
-
- if (data_len < alloc_len) {
- ctsio->residual = alloc_len - data_len;
- ctsio->kern_data_len = data_len;
- ctsio->kern_total_len = data_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
+ ctsio->kern_data_len = min(data_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
/*
* The control device is always connected. The disk device, on the
@@ -457,19 +448,10 @@ ctl_receive_copy_operating_parameters(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_receive_copy_operating_parameters_data *)ctsio->kern_data_ptr;
scsi_ulto4b(sizeof(*data) - 4 + 4, data->length);
@@ -554,19 +536,10 @@ ctl_receive_copy_status_lid1(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_receive_copy_status_lid1_data *)ctsio->kern_data_ptr;
scsi_ulto4b(sizeof(*data) - 4, data->available_data);
@@ -631,19 +604,10 @@ ctl_receive_copy_failure_details(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_receive_copy_failure_details_data *)ctsio->kern_data_ptr;
if (list_copy.completed && (list_copy.error || list_copy.abort)) {
@@ -702,19 +666,10 @@ ctl_receive_copy_status_lid4(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_receive_copy_status_lid4_data *)ctsio->kern_data_ptr;
scsi_ulto4b(sizeof(*data) - 4 + list_copy.sense_len,
@@ -2402,19 +2357,10 @@ ctl_receive_rod_token_information(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_receive_copy_status_lid4_data *)ctsio->kern_data_ptr;
scsi_ulto4b(sizeof(*data) - 4 + list_copy.sense_len +
@@ -2482,19 +2428,10 @@ ctl_report_all_rod_tokens(struct ctl_scsiio *ctsio)
alloc_len = scsi_4btoul(cdb->length);
ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
-
ctsio->kern_sg_entries = 0;
-
- if (total_len < alloc_len) {
- ctsio->residual = alloc_len - total_len;
- ctsio->kern_data_len = total_len;
- ctsio->kern_total_len = total_len;
- } else {
- ctsio->residual = 0;
- ctsio->kern_data_len = alloc_len;
- ctsio->kern_total_len = alloc_len;
- }
ctsio->kern_rel_offset = 0;
+ ctsio->kern_data_len = min(total_len, alloc_len);
+ ctsio->kern_total_len = ctsio->kern_data_len;
data = (struct scsi_report_all_rod_tokens_data *)ctsio->kern_data_ptr;
i = 0;
diff --git a/sys/cam/ctl/ctl_tpc_local.c b/sys/cam/ctl/ctl_tpc_local.c
index 47b7ed6c9e34..e5e77b437a26 100644
--- a/sys/cam/ctl/ctl_tpc_local.c
+++ b/sys/cam/ctl/ctl_tpc_local.c
@@ -65,7 +65,7 @@ struct tpcl_softc {
static struct tpcl_softc tpcl_softc;
static int tpcl_init(void);
-static void tpcl_shutdown(void);
+static int tpcl_shutdown(void);
static void tpcl_datamove(union ctl_io *io);
static void tpcl_done(union ctl_io *io);
@@ -84,7 +84,7 @@ tpcl_init(void)
struct tpcl_softc *tsoftc = &tpcl_softc;
struct ctl_port *port;
struct scsi_transportid_spi *tid;
- int len;
+ int error, len;
memset(tsoftc, 0, sizeof(*tsoftc));
@@ -100,9 +100,9 @@ tpcl_init(void)
port->targ_port = -1;
port->max_initiators = 1;
- if (ctl_port_register(port) != 0) {
- printf("%s: ctl_port_register() failed with error\n", __func__);
- return (0);
+ if ((error = ctl_port_register(port)) != 0) {
+ printf("%s: tpc port registration failed\n", __func__);
+ return (error);
}
len = sizeof(struct scsi_transportid_spi);
@@ -118,16 +118,17 @@ tpcl_init(void)
return (0);
}
-void
+static int
tpcl_shutdown(void)
{
struct tpcl_softc *tsoftc = &tpcl_softc;
- struct ctl_port *port;
+ struct ctl_port *port = &tsoftc->port;
+ int error;
- port = &tsoftc->port;
ctl_port_offline(port);
- if (ctl_port_deregister(&tsoftc->port) != 0)
- printf("%s: ctl_frontend_deregister() failed\n", __func__);
+ if ((error = ctl_port_deregister(port)) != 0)
+ printf("%s: tpc port deregistration failed\n", __func__);
+ return (error);
}
static void
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index a32a67200c9b..1d3e0485933b 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -188,8 +188,8 @@ MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CAM CTL FE interface");
#define PRIV_CCB(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[0])
#define PRIV_INFO(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[1])
-int ctlfeinitialize(void);
-void ctlfeshutdown(void);
+static int ctlfeinitialize(void);
+static int ctlfeshutdown(void);
static periph_init_t ctlfeperiphinit;
static void ctlfeasync(void *callback_arg, uint32_t code,
struct cam_path *path, void *arg);
@@ -227,13 +227,15 @@ static struct ctl_frontend ctlfe_frontend =
};
CTL_FRONTEND_DECLARE(ctlfe, ctlfe_frontend);
-void
+static int
ctlfeshutdown(void)
{
- return;
+
+ /* CAM does not support periph driver unregister now. */
+ return (EBUSY);
}
-int
+static int
ctlfeinitialize(void)
{
@@ -243,7 +245,7 @@ ctlfeinitialize(void)
return (0);
}
-void
+static void
ctlfeperiphinit(void)
{
cam_status status;
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index 64c45fb26a4b..f85d285ec938 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -3039,7 +3039,7 @@ struct scsi_set_timestamp_parameters
{
uint8_t reserved1[4];
uint8_t timestamp[6];
- uint8_t reserved2[4];
+ uint8_t reserved2[2];
};
struct scsi_report_timestamp_parameter_data
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index cad8f01a11cb..55f2386262a2 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -829,6 +829,11 @@ static struct da_quirk_entry da_quirk_table[] =
/*quirks*/DA_Q_4K
},
{
+ /* Micron Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Micron 5100 MTFDDAK*", "*" },
+ /*quirks*/DA_Q_4K
+ },
+ {
/* Samsung Advanced Format (4k) drives */
{ T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG HD155UI*", "*" },
/*quirks*/DA_Q_4K
@@ -1151,6 +1156,14 @@ static struct da_quirk_entry da_quirk_table[] =
},
{
/*
+ * Intel S3610 Series SSDs
+ * 4k optimised & trim only works in 4k requests + 4k aligned
+ */
+ { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2BX*", "*" },
+ /*quirks*/DA_Q_4K
+ },
+ {
+ /*
* Intel X25-M Series SSDs
* 4k optimised & trim only works in 4k requests + 4k aligned
*/
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
index 168a5797499d..852f3b54c812 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
@@ -60,6 +60,16 @@ SYSCTL_DECL(_vfs_zfs);
SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN,
&zfs_nopwrite_enabled, 0, "Enable nopwrite feature");
+/*
+ * Tunable to control percentage of dirtied blocks from frees in one TXG.
+ * After this threshold is crossed, additional dirty blocks from frees
+ * wait until the next TXG.
+ * A value of zero will disable this throttle.
+ */
+uint32_t zfs_per_txg_dirty_frees_percent = 30;
+SYSCTL_INT(_vfs_zfs, OID_AUTO, per_txg_dirty_frees_percent, CTLFLAG_RWTUN,
+ &zfs_per_txg_dirty_frees_percent, 0, "Percentage of dirtied blocks from frees in one txg");
+
const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = {
{ DMU_BSWAP_UINT8, TRUE, "unallocated" },
{ DMU_BSWAP_ZAP, TRUE, "object directory" },
@@ -718,15 +728,25 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset,
{
uint64_t object_size = (dn->dn_maxblkid + 1) * dn->dn_datablksz;
int err;
+ uint64_t dirty_frees_threshold;
+ dsl_pool_t *dp = dmu_objset_pool(os);
if (offset >= object_size)
return (0);
+ if (zfs_per_txg_dirty_frees_percent <= 100)
+ dirty_frees_threshold =
+ zfs_per_txg_dirty_frees_percent * zfs_dirty_data_max / 100;
+ else
+ dirty_frees_threshold = zfs_dirty_data_max / 4;
+
if (length == DMU_OBJECT_END || offset + length > object_size)
length = object_size - offset;
while (length != 0) {
- uint64_t chunk_end, chunk_begin;
+ uint64_t chunk_end, chunk_begin, chunk_len;
+ uint64_t long_free_dirty_all_txgs = 0;
+ dmu_tx_t *tx;
chunk_end = chunk_begin = offset + length;
@@ -737,9 +757,28 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset,
ASSERT3U(chunk_begin, >=, offset);
ASSERT3U(chunk_begin, <=, chunk_end);
- dmu_tx_t *tx = dmu_tx_create(os);
- dmu_tx_hold_free(tx, dn->dn_object,
- chunk_begin, chunk_end - chunk_begin);
+ chunk_len = chunk_end - chunk_begin;
+
+ mutex_enter(&dp->dp_lock);
+ for (int t = 0; t < TXG_SIZE; t++) {
+ long_free_dirty_all_txgs +=
+ dp->dp_long_free_dirty_pertxg[t];
+ }
+ mutex_exit(&dp->dp_lock);
+
+ /*
+ * To avoid filling up a TXG with just frees wait for
+ * the next TXG to open before freeing more chunks if
+ * we have reached the threshold of frees
+ */
+ if (dirty_frees_threshold != 0 &&
+ long_free_dirty_all_txgs >= dirty_frees_threshold) {
+ txg_wait_open(dp, 0);
+ continue;
+ }
+
+ tx = dmu_tx_create(os);
+ dmu_tx_hold_free(tx, dn->dn_object, chunk_begin, chunk_len);
/*
* Mark this transaction as typically resulting in a net
@@ -751,10 +790,18 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset,
dmu_tx_abort(tx);
return (err);
}
- dnode_free_range(dn, chunk_begin, chunk_end - chunk_begin, tx);
+
+ mutex_enter(&dp->dp_lock);
+ dp->dp_long_free_dirty_pertxg[dmu_tx_get_txg(tx) & TXG_MASK] +=
+ chunk_len;
+ mutex_exit(&dp->dp_lock);
+ DTRACE_PROBE3(free__long__range,
+ uint64_t, long_free_dirty_all_txgs, uint64_t, chunk_len,
+ uint64_t, dmu_tx_get_txg(tx));
+ dnode_free_range(dn, chunk_begin, chunk_len, tx);
dmu_tx_commit(tx);
- length -= chunk_end - chunk_begin;
+ length -= chunk_len;
}
return (0);
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
index 9b3b79bfb517..0ac2f70cf3b6 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
@@ -24,6 +24,7 @@
* Copyright (c) 2013 Steven Hartland. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
+ * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
#include <sys/dsl_pool.h>
@@ -593,6 +594,16 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t txg)
dsl_pool_undirty_space(dp, dp->dp_dirty_pertxg[txg & TXG_MASK], txg);
/*
+ * Update the long range free counter after
+ * we're done syncing user data
+ */
+ mutex_enter(&dp->dp_lock);
+ ASSERT(spa_sync_pass(dp->dp_spa) == 1 ||
+ dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] == 0);
+ dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] = 0;
+ mutex_exit(&dp->dp_lock);
+
+ /*
* After the data blocks have been written (ensured by the zio_wait()
* above), update the user/group space accounting.
*/
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
index 0e27a538208c..3e2914640c9a 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _SYS_DSL_POOL_H
@@ -103,6 +104,7 @@ typedef struct dsl_pool {
kcondvar_t dp_spaceavail_cv;
uint64_t dp_dirty_pertxg[TXG_SIZE];
uint64_t dp_dirty_total;
+ uint64_t dp_long_free_dirty_pertxg[TXG_SIZE];
uint64_t dp_mos_used_delta;
uint64_t dp_mos_compressed_delta;
uint64_t dp_mos_uncompressed_delta;
diff --git a/sys/cddl/dev/fbt/arm/fbt_isa.c b/sys/cddl/dev/fbt/arm/fbt_isa.c
index f1fae1ca66f4..96dd13029d6a 100644
--- a/sys/cddl/dev/fbt/arm/fbt_isa.c
+++ b/sys/cddl/dev/fbt/arm/fbt_isa.c
@@ -61,7 +61,7 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval)
/* Get 5th parameter from stack */
DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
- fifthparam = *(register_t *)frame->tf_usr_sp;
+ fifthparam = *(register_t *)frame->tf_svc_sp;
DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR);
dtrace_probe(fbt->fbtp_id, frame->tf_r0,
diff --git a/sys/compat/cloudabi/cloudabi_file.c b/sys/compat/cloudabi/cloudabi_file.c
index f48b7541da7c..f5417e0bb3a8 100644
--- a/sys/compat/cloudabi/cloudabi_file.c
+++ b/sys/compat/cloudabi/cloudabi_file.c
@@ -146,7 +146,7 @@ cloudabi_sys_file_create(struct thread *td,
char *path;
int error;
- error = copyin_path(uap->path, uap->pathlen, &path);
+ error = copyin_path(uap->path, uap->path_len, &path);
if (error != 0)
return (error);
@@ -177,10 +177,10 @@ cloudabi_sys_file_link(struct thread *td,
char *path1, *path2;
int error;
- error = copyin_path(uap->path1, uap->path1len, &path1);
+ error = copyin_path(uap->path1, uap->path1_len, &path1);
if (error != 0)
return (error);
- error = copyin_path(uap->path2, uap->path2len, &path2);
+ error = copyin_path(uap->path2, uap->path2_len, &path2);
if (error != 0) {
cloudabi_freestr(path1);
return (error);
@@ -261,7 +261,7 @@ cloudabi_sys_file_open(struct thread *td,
fp->f_flag = fflags & FMASK;
/* Open path. */
- error = copyin_path(uap->path, uap->pathlen, &path);
+ error = copyin_path(uap->path, uap->path_len, &path);
if (error != 0) {
fdrop(fp, td);
return (error);
@@ -380,7 +380,7 @@ cloudabi_sys_file_readdir(struct thread *td,
{
struct iovec iov = {
.iov_base = uap->buf,
- .iov_len = uap->nbyte
+ .iov_len = uap->buf_len
};
struct uio uio = {
.uio_iov = &iov,
@@ -494,7 +494,7 @@ done:
return (error);
/* Return number of bytes copied to userspace. */
- td->td_retval[0] = uap->nbyte - uio.uio_resid;
+ td->td_retval[0] = uap->buf_len - uio.uio_resid;
return (0);
}
@@ -505,12 +505,12 @@ cloudabi_sys_file_readlink(struct thread *td,
char *path;
int error;
- error = copyin_path(uap->path, uap->pathlen, &path);
+ error = copyin_path(uap->path, uap->path_len, &path);
if (error != 0)
return (error);
error = kern_readlinkat(td, uap->fd, path, UIO_SYSSPACE,
- uap->buf, UIO_USERSPACE, uap->bufsize);
+ uap->buf, UIO_USERSPACE, uap->buf_len);
cloudabi_freestr(path);
return (error);
}
@@ -522,16 +522,16 @@ cloudabi_sys_file_rename(struct thread *td,
char *old, *new;
int error;
- error = copyin_path(uap->old, uap->oldlen, &old);
+ error = copyin_path(uap->path1, uap->path1_len, &old);
if (error != 0)
return (error);
- error = copyin_path(uap->new, uap->newlen, &new);
+ error = copyin_path(uap->path2, uap->path2_len, &new);
if (error != 0) {
cloudabi_freestr(old);
return (error);
}
- error = kern_renameat(td, uap->oldfd, old, uap->newfd, new,
+ error = kern_renameat(td, uap->fd1, old, uap->fd2, new,
UIO_SYSSPACE);
cloudabi_freestr(old);
cloudabi_freestr(new);
@@ -653,7 +653,7 @@ cloudabi_sys_file_stat_get(struct thread *td,
char *path;
int error;
- error = copyin_path(uap->path, uap->pathlen, &path);
+ error = copyin_path(uap->path, uap->path_len, &path);
if (error != 0)
return (error);
@@ -707,7 +707,7 @@ cloudabi_sys_file_stat_put(struct thread *td,
error = copyin(uap->buf, &fs, sizeof(fs));
if (error != 0)
return (error);
- error = copyin_path(uap->path, uap->pathlen, &path);
+ error = copyin_path(uap->path, uap->path_len, &path);
if (error != 0)
return (error);
@@ -726,10 +726,10 @@ cloudabi_sys_file_symlink(struct thread *td,
char *path1, *path2;
int error;
- error = copyin_path(uap->path1, uap->path1len, &path1);
+ error = copyin_path(uap->path1, uap->path1_len, &path1);
if (error != 0)
return (error);
- error = copyin_path(uap->path2, uap->path2len, &path2);
+ error = copyin_path(uap->path2, uap->path2_len, &path2);
if (error != 0) {
cloudabi_freestr(path1);
return (error);
@@ -748,7 +748,7 @@ cloudabi_sys_file_unlink(struct thread *td,
char *path;
int error;
- error = copyin_path(uap->path, uap->pathlen, &path);
+ error = copyin_path(uap->path, uap->path_len, &path);
if (error != 0)
return (error);
diff --git a/sys/compat/cloudabi/cloudabi_mem.c b/sys/compat/cloudabi/cloudabi_mem.c
index 34ee14ab2235..55685284fa9e 100644
--- a/sys/compat/cloudabi/cloudabi_mem.c
+++ b/sys/compat/cloudabi/cloudabi_mem.c
@@ -63,8 +63,8 @@ cloudabi_sys_mem_advise(struct thread *td,
struct cloudabi_sys_mem_advise_args *uap)
{
struct madvise_args madvise_args = {
- .addr = uap->addr,
- .len = uap->len
+ .addr = uap->mapping,
+ .len = uap->mapping_len
};
switch (uap->advice) {
@@ -94,8 +94,8 @@ int
cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap)
{
struct mlock_args mlock_args = {
- .addr = uap->addr,
- .len = uap->len
+ .addr = uap->mapping,
+ .len = uap->mapping_len
};
return (sys_mlock(td, &mlock_args));
@@ -135,8 +135,8 @@ cloudabi_sys_mem_protect(struct thread *td,
struct cloudabi_sys_mem_protect_args *uap)
{
struct mprotect_args mprotect_args = {
- .addr = uap->addr,
- .len = uap->len,
+ .addr = uap->mapping,
+ .len = uap->mapping_len,
};
int error;
@@ -152,8 +152,8 @@ int
cloudabi_sys_mem_sync(struct thread *td, struct cloudabi_sys_mem_sync_args *uap)
{
struct msync_args msync_args = {
- .addr = uap->addr,
- .len = uap->len,
+ .addr = uap->mapping,
+ .len = uap->mapping_len,
};
/* Convert flags. */
@@ -178,8 +178,8 @@ cloudabi_sys_mem_unlock(struct thread *td,
struct cloudabi_sys_mem_unlock_args *uap)
{
struct munlock_args munlock_args = {
- .addr = uap->addr,
- .len = uap->len
+ .addr = uap->mapping,
+ .len = uap->mapping_len
};
return (sys_munlock(td, &munlock_args));
@@ -190,8 +190,8 @@ cloudabi_sys_mem_unmap(struct thread *td,
struct cloudabi_sys_mem_unmap_args *uap)
{
struct munmap_args munmap_args = {
- .addr = uap->addr,
- .len = uap->len
+ .addr = uap->mapping,
+ .len = uap->mapping_len
};
return (sys_munmap(td, &munmap_args));
diff --git a/sys/compat/cloudabi/cloudabi_proc.c b/sys/compat/cloudabi/cloudabi_proc.c
index 139af2cfc73a..24333311d38c 100644
--- a/sys/compat/cloudabi/cloudabi_proc.c
+++ b/sys/compat/cloudabi/cloudabi_proc.c
@@ -53,8 +53,8 @@ cloudabi_sys_proc_exec(struct thread *td,
error = pre_execve(td, &oldvmspace);
if (error != 0)
return (error);
- error = exec_copyin_data_fds(td, &args, uap->data, uap->datalen,
- uap->fds, uap->fdslen);
+ error = exec_copyin_data_fds(td, &args, uap->data, uap->data_len,
+ uap->fds, uap->fds_len);
if (error == 0) {
args.fd = uap->fd;
error = kern_execve(td, &args, NULL);
diff --git a/sys/compat/cloudabi/cloudabi_random.c b/sys/compat/cloudabi/cloudabi_random.c
index 76a93604d299..02a3252a1b54 100644
--- a/sys/compat/cloudabi/cloudabi_random.c
+++ b/sys/compat/cloudabi/cloudabi_random.c
@@ -38,7 +38,7 @@ cloudabi_sys_random_get(struct thread *td,
{
struct iovec iov = {
.iov_base = uap->buf,
- .iov_len = uap->nbyte
+ .iov_len = uap->buf_len
};
struct uio uio = {
.uio_iov = &iov,
diff --git a/sys/compat/cloudabi/cloudabi_sock.c b/sys/compat/cloudabi/cloudabi_sock.c
index c66e2096f5b0..8605b18353fe 100644
--- a/sys/compat/cloudabi/cloudabi_sock.c
+++ b/sys/compat/cloudabi/cloudabi_sock.c
@@ -141,7 +141,7 @@ cloudabi_sys_sock_bind(struct thread *td,
struct sockaddr_un sun;
int error;
- error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun);
+ error = copyin_sockaddr_un(uap->path, uap->path_len, &sun);
if (error != 0)
return (error);
return (kern_bindat(td, uap->fd, uap->sock, (struct sockaddr *)&sun));
@@ -154,7 +154,7 @@ cloudabi_sys_sock_connect(struct thread *td,
struct sockaddr_un sun;
int error;
- error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun);
+ error = copyin_sockaddr_un(uap->path, uap->path_len, &sun);
if (error != 0)
return (error);
return (kern_connectat(td, uap->fd, uap->sock,
diff --git a/sys/compat/cloudabi32/cloudabi32_fd.c b/sys/compat/cloudabi32/cloudabi32_fd.c
index 1754c482c98c..19907a95b07e 100644
--- a/sys/compat/cloudabi32/cloudabi32_fd.c
+++ b/sys/compat/cloudabi32/cloudabi32_fd.c
@@ -71,8 +71,8 @@ cloudabi32_copyinuio(const cloudabi32_iovec_t *iovp, size_t iovcnt,
free(uio, M_IOV);
return (error);
}
- iov[i].iov_base = TO_PTR(iovobj.iov_base);
- iov[i].iov_len = iovobj.iov_len;
+ iov[i].iov_base = TO_PTR(iovobj.buf);
+ iov[i].iov_len = iovobj.buf_len;
if (iov[i].iov_len > INT32_MAX - uio->uio_resid) {
free(uio, M_IOV);
return (EINVAL);
@@ -91,7 +91,7 @@ cloudabi32_sys_fd_pread(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio);
+ error = cloudabi32_copyinuio(uap->iovs, uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_preadv(td, uap->fd, uio, uap->offset);
@@ -106,7 +106,7 @@ cloudabi32_sys_fd_pwrite(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
+ error = cloudabi32_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_pwritev(td, uap->fd, uio, uap->offset);
@@ -121,7 +121,7 @@ cloudabi32_sys_fd_read(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio);
+ error = cloudabi32_copyinuio(uap->iovs, uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_readv(td, uap->fd, uio);
@@ -136,7 +136,7 @@ cloudabi32_sys_fd_write(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
+ error = cloudabi32_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_writev(td, uap->fd, uio);
diff --git a/sys/compat/cloudabi32/cloudabi32_poll.c b/sys/compat/cloudabi32/cloudabi32_poll.c
index 5215580df497..dfffdc6c97e3 100644
--- a/sys/compat/cloudabi32/cloudabi32_poll.c
+++ b/sys/compat/cloudabi32/cloudabi32_poll.c
@@ -398,11 +398,11 @@ cloudabi32_sys_poll_fd(struct thread *td,
return (EINVAL);
timeout.tv_sec = subtimo.clock.timeout / 1000000000;
timeout.tv_nsec = subtimo.clock.timeout % 1000000000;
- return (kern_kevent(td, uap->fd, uap->nin, uap->nout, &copyops,
- &timeout));
+ return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
+ &copyops, &timeout));
} else {
/* Poll without a timeout. */
- return (kern_kevent(td, uap->fd, uap->nin, uap->nout, &copyops,
- NULL));
+ return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
+ &copyops, NULL));
}
}
diff --git a/sys/compat/cloudabi32/cloudabi32_proto.h b/sys/compat/cloudabi32/cloudabi32_proto.h
index 3f028d5f0309..ca03f67b41d6 100644
--- a/sys/compat/cloudabi32/cloudabi32_proto.h
+++ b/sys/compat/cloudabi32/cloudabi32_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed
*/
#ifndef _CLOUDABI32_SYSPROTO_H_
@@ -63,20 +63,20 @@ struct cloudabi_sys_fd_dup_args {
};
struct cloudabi32_sys_fd_pread_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_iovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
};
struct cloudabi32_sys_fd_pwrite_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_ciovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
};
struct cloudabi32_sys_fd_read_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_iovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_fd_replace_args {
char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)];
@@ -101,8 +101,8 @@ struct cloudabi_sys_fd_sync_args {
};
struct cloudabi32_sys_fd_write_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_ciovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_advise_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
@@ -118,44 +118,44 @@ struct cloudabi_sys_file_allocate_args {
struct cloudabi_sys_file_create_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)];
};
struct cloudabi_sys_file_link_args {
char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)];
char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
- char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)];
+ char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)];
char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)];
char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
- char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)];
+ char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_open_args {
char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)];
char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)];
};
struct cloudabi_sys_file_readdir_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
- char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+ char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)];
char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)];
};
struct cloudabi_sys_file_readlink_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
- char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)];
+ char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_rename_args {
- char oldfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t oldfd; char oldfd_r_[PADR_(cloudabi_fd_t)];
- char old_l_[PADL_(const char *)]; const char * old; char old_r_[PADR_(const char *)];
- char oldlen_l_[PADL_(size_t)]; size_t oldlen; char oldlen_r_[PADR_(size_t)];
- char newfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t newfd; char newfd_r_[PADR_(cloudabi_fd_t)];
- char new_l_[PADL_(const char *)]; const char * new; char new_r_[PADR_(const char *)];
- char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)];
+ char fd1_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd1; char fd1_r_[PADR_(cloudabi_fd_t)];
+ char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
+ char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)];
+ char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)];
+ char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
+ char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_stat_fget_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
@@ -169,27 +169,27 @@ struct cloudabi_sys_file_stat_fput_args {
struct cloudabi_sys_file_stat_get_args {
char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)];
};
struct cloudabi_sys_file_stat_put_args {
char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)];
char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)];
};
struct cloudabi_sys_file_symlink_args {
char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
- char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)];
+ char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)];
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
- char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)];
+ char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_unlink_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)];
};
struct cloudabi_sys_lock_unlock_args {
@@ -197,13 +197,13 @@ struct cloudabi_sys_lock_unlock_args {
char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)];
};
struct cloudabi_sys_mem_advise_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)];
};
struct cloudabi_sys_mem_lock_args {
- char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_mem_map_args {
char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
@@ -214,22 +214,22 @@ struct cloudabi_sys_mem_map_args {
char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)];
};
struct cloudabi_sys_mem_protect_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)];
};
struct cloudabi_sys_mem_sync_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)];
};
struct cloudabi_sys_mem_unlock_args {
- char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_mem_unmap_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi32_sys_poll_args {
char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)];
@@ -239,17 +239,17 @@ struct cloudabi32_sys_poll_args {
struct cloudabi32_sys_poll_fd_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)];
- char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)];
+ char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)];
char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)];
- char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)];
+ char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)];
char timeout_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi32_subscription_t *)];
};
struct cloudabi_sys_proc_exec_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)];
- char datalen_l_[PADL_(size_t)]; size_t datalen; char datalen_r_[PADR_(size_t)];
+ char data_len_l_[PADL_(size_t)]; size_t data_len; char data_len_r_[PADR_(size_t)];
char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)];
- char fdslen_l_[PADL_(size_t)]; size_t fdslen; char fdslen_r_[PADR_(size_t)];
+ char fds_len_l_[PADL_(size_t)]; size_t fds_len; char fds_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_proc_exit_args {
char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)];
@@ -262,7 +262,7 @@ struct cloudabi_sys_proc_raise_args {
};
struct cloudabi_sys_random_get_args {
char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
- char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+ char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_sock_accept_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
@@ -272,13 +272,13 @@ struct cloudabi_sys_sock_bind_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_sock_connect_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_sock_listen_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
diff --git a/sys/compat/cloudabi32/cloudabi32_sock.c b/sys/compat/cloudabi32/cloudabi32_sock.c
index 24ed32c2606a..756c247f9e26 100644
--- a/sys/compat/cloudabi32/cloudabi32_sock.c
+++ b/sys/compat/cloudabi32/cloudabi32_sock.c
@@ -62,9 +62,9 @@ cloudabi32_sys_sock_recv(struct thread *td,
return (error);
/* Convert results in cloudabi_recv_in_t to struct msghdr. */
- if (ri.ri_datalen > UIO_MAXIOV)
+ if (ri.ri_data_len > UIO_MAXIOV)
return (EINVAL);
- msghdr.msg_iovlen = ri.ri_datalen;
+ msghdr.msg_iovlen = ri.ri_data_len;
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
M_SOCKET, M_WAITOK);
user_iov = TO_PTR(ri.ri_data);
@@ -74,8 +74,8 @@ cloudabi32_sys_sock_recv(struct thread *td,
free(msghdr.msg_iov, M_SOCKET);
return (error);
}
- msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
- msghdr.msg_iov[i].iov_len = iovobj.iov_len;
+ msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
+ msghdr.msg_iov[i].iov_len = iovobj.buf_len;
}
msghdr.msg_name = &ss;
msghdr.msg_namelen = sizeof(ss);
@@ -115,9 +115,9 @@ cloudabi32_sys_sock_send(struct thread *td,
return (error);
/* Convert results in cloudabi_send_in_t to struct msghdr. */
- if (si.si_datalen > UIO_MAXIOV)
+ if (si.si_data_len > UIO_MAXIOV)
return (EINVAL);
- msghdr.msg_iovlen = si.si_datalen;
+ msghdr.msg_iovlen = si.si_data_len;
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
M_SOCKET, M_WAITOK);
user_iov = TO_PTR(si.si_data);
@@ -127,8 +127,8 @@ cloudabi32_sys_sock_send(struct thread *td,
free(msghdr.msg_iov, M_SOCKET);
return (error);
}
- msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
- msghdr.msg_iov[i].iov_len = iovobj.iov_len;
+ msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
+ msghdr.msg_iov[i].iov_len = iovobj.buf_len;
}
flags = MSG_NOSIGNAL;
diff --git a/sys/compat/cloudabi32/cloudabi32_syscall.h b/sys/compat/cloudabi32/cloudabi32_syscall.h
index 4cba6fde4a1c..3ec07f13b7df 100644
--- a/sys/compat/cloudabi32/cloudabi32_syscall.h
+++ b/sys/compat/cloudabi32/cloudabi32_syscall.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed
*/
#define CLOUDABI32_SYS_cloudabi_sys_clock_res_get 0
diff --git a/sys/compat/cloudabi32/cloudabi32_syscalls.c b/sys/compat/cloudabi32/cloudabi32_syscalls.c
index 56a46fb5ed18..c24ad817e55e 100644
--- a/sys/compat/cloudabi32/cloudabi32_syscalls.c
+++ b/sys/compat/cloudabi32/cloudabi32_syscalls.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed
*/
const char *cloudabi32_syscallnames[] = {
diff --git a/sys/compat/cloudabi32/cloudabi32_sysent.c b/sys/compat/cloudabi32/cloudabi32_sysent.c
index 187e38449ca3..e2a67ae3bd10 100644
--- a/sys/compat/cloudabi32/cloudabi32_sysent.c
+++ b/sys/compat/cloudabi32/cloudabi32_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed
*/
#include <sys/sysent.h>
diff --git a/sys/compat/cloudabi32/cloudabi32_systrace_args.c b/sys/compat/cloudabi32/cloudabi32_systrace_args.c
index 1b49a5d5eabd..6d037bc70b08 100644
--- a/sys/compat/cloudabi32/cloudabi32_systrace_args.c
+++ b/sys/compat/cloudabi32/cloudabi32_systrace_args.c
@@ -74,8 +74,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 8: {
struct cloudabi32_sys_fd_pread_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi32_iovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_iovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
iarg[3] = p->offset; /* cloudabi_filesize_t */
*n_args = 4;
break;
@@ -84,8 +84,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 9: {
struct cloudabi32_sys_fd_pwrite_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi32_ciovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_ciovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
iarg[3] = p->offset; /* cloudabi_filesize_t */
*n_args = 4;
break;
@@ -94,8 +94,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 10: {
struct cloudabi32_sys_fd_read_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi32_iovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_iovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
*n_args = 3;
break;
}
@@ -144,8 +144,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 16: {
struct cloudabi32_sys_fd_write_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi32_ciovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_ciovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
*n_args = 3;
break;
}
@@ -173,7 +173,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_create_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
iarg[3] = p->type; /* cloudabi_filetype_t */
*n_args = 4;
break;
@@ -183,10 +183,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_link_args *p = params;
iarg[0] = p->fd1; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path1; /* const char * */
- uarg[2] = p->path1len; /* size_t */
+ uarg[2] = p->path1_len; /* size_t */
iarg[3] = p->fd2; /* cloudabi_fd_t */
uarg[4] = (intptr_t) p->path2; /* const char * */
- uarg[5] = p->path2len; /* size_t */
+ uarg[5] = p->path2_len; /* size_t */
*n_args = 6;
break;
}
@@ -195,7 +195,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_open_args *p = params;
iarg[0] = p->dirfd; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
iarg[3] = p->oflags; /* cloudabi_oflags_t */
uarg[4] = (intptr_t) p->fds; /* const cloudabi_fdstat_t * */
*n_args = 5;
@@ -206,7 +206,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_readdir_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->buf; /* void * */
- uarg[2] = p->nbyte; /* size_t */
+ uarg[2] = p->buf_len; /* size_t */
iarg[3] = p->cookie; /* cloudabi_dircookie_t */
*n_args = 4;
break;
@@ -216,21 +216,21 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_readlink_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
uarg[3] = (intptr_t) p->buf; /* char * */
- uarg[4] = p->bufsize; /* size_t */
+ uarg[4] = p->buf_len; /* size_t */
*n_args = 5;
break;
}
/* cloudabi_sys_file_rename */
case 24: {
struct cloudabi_sys_file_rename_args *p = params;
- iarg[0] = p->oldfd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->old; /* const char * */
- uarg[2] = p->oldlen; /* size_t */
- iarg[3] = p->newfd; /* cloudabi_fd_t */
- uarg[4] = (intptr_t) p->new; /* const char * */
- uarg[5] = p->newlen; /* size_t */
+ iarg[0] = p->fd1; /* cloudabi_fd_t */
+ uarg[1] = (intptr_t) p->path1; /* const char * */
+ uarg[2] = p->path1_len; /* size_t */
+ iarg[3] = p->fd2; /* cloudabi_fd_t */
+ uarg[4] = (intptr_t) p->path2; /* const char * */
+ uarg[5] = p->path2_len; /* size_t */
*n_args = 6;
break;
}
@@ -256,7 +256,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_stat_get_args *p = params;
iarg[0] = p->fd; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
uarg[3] = (intptr_t) p->buf; /* cloudabi_filestat_t * */
*n_args = 4;
break;
@@ -266,7 +266,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_stat_put_args *p = params;
iarg[0] = p->fd; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
uarg[3] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */
iarg[4] = p->flags; /* cloudabi_fsflags_t */
*n_args = 5;
@@ -276,10 +276,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 29: {
struct cloudabi_sys_file_symlink_args *p = params;
uarg[0] = (intptr_t) p->path1; /* const char * */
- uarg[1] = p->path1len; /* size_t */
+ uarg[1] = p->path1_len; /* size_t */
iarg[2] = p->fd; /* cloudabi_fd_t */
uarg[3] = (intptr_t) p->path2; /* const char * */
- uarg[4] = p->path2len; /* size_t */
+ uarg[4] = p->path2_len; /* size_t */
*n_args = 5;
break;
}
@@ -288,7 +288,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_unlink_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
iarg[3] = p->flags; /* cloudabi_ulflags_t */
*n_args = 4;
break;
@@ -304,8 +304,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_advise */
case 32: {
struct cloudabi_sys_mem_advise_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
iarg[2] = p->advice; /* cloudabi_advice_t */
*n_args = 3;
break;
@@ -313,8 +313,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_lock */
case 33: {
struct cloudabi_sys_mem_lock_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* const void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* const void * */
+ uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
@@ -333,8 +333,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_protect */
case 35: {
struct cloudabi_sys_mem_protect_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
iarg[2] = p->prot; /* cloudabi_mprot_t */
*n_args = 3;
break;
@@ -342,8 +342,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_sync */
case 36: {
struct cloudabi_sys_mem_sync_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
iarg[2] = p->flags; /* cloudabi_msflags_t */
*n_args = 3;
break;
@@ -351,16 +351,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_unlock */
case 37: {
struct cloudabi_sys_mem_unlock_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* const void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* const void * */
+ uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
/* cloudabi_sys_mem_unmap */
case 38: {
struct cloudabi_sys_mem_unmap_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
@@ -378,9 +378,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi32_sys_poll_fd_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */
- uarg[2] = p->nin; /* size_t */
+ uarg[2] = p->in_len; /* size_t */
uarg[3] = (intptr_t) p->out; /* cloudabi32_event_t * */
- uarg[4] = p->nout; /* size_t */
+ uarg[4] = p->out_len; /* size_t */
uarg[5] = (intptr_t) p->timeout; /* const cloudabi32_subscription_t * */
*n_args = 6;
break;
@@ -390,9 +390,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_proc_exec_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->data; /* const void * */
- uarg[2] = p->datalen; /* size_t */
+ uarg[2] = p->data_len; /* size_t */
uarg[3] = (intptr_t) p->fds; /* const cloudabi_fd_t * */
- uarg[4] = p->fdslen; /* size_t */
+ uarg[4] = p->fds_len; /* size_t */
*n_args = 5;
break;
}
@@ -419,7 +419,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 45: {
struct cloudabi_sys_random_get_args *p = params;
uarg[0] = (intptr_t) p->buf; /* void * */
- uarg[1] = p->nbyte; /* size_t */
+ uarg[1] = p->buf_len; /* size_t */
*n_args = 2;
break;
}
@@ -437,7 +437,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
uarg[2] = (intptr_t) p->path; /* const char * */
- uarg[3] = p->pathlen; /* size_t */
+ uarg[3] = p->path_len; /* size_t */
*n_args = 4;
break;
}
@@ -447,7 +447,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
uarg[2] = (intptr_t) p->path; /* const char * */
- uarg[3] = p->pathlen; /* size_t */
+ uarg[3] = p->path_len; /* size_t */
*n_args = 4;
break;
}
diff --git a/sys/compat/cloudabi32/cloudabi32_thread.c b/sys/compat/cloudabi32/cloudabi32_thread.c
index 50538d971f09..233700b40f1f 100644
--- a/sys/compat/cloudabi32/cloudabi32_thread.c
+++ b/sys/compat/cloudabi32/cloudabi32_thread.c
@@ -65,9 +65,9 @@ cloudabi32_sys_thread_create(struct thread *td,
return (error);
/* Remove some space on the top of the stack for the TCB. */
- args.tcb = rounddown(args.attr.stack + args.attr.stack_size -
+ args.tcb = rounddown(args.attr.stack + args.attr.stack_len -
sizeof(cloudabi32_tcb_t), _Alignof(cloudabi32_tcb_t));
- args.attr.stack_size = args.tcb - args.attr.stack;
+ args.attr.stack_len = args.tcb - args.attr.stack;
error = thread_create(td, NULL, initialize_thread, &args);
if (error != 0)
diff --git a/sys/compat/cloudabi64/cloudabi64_fd.c b/sys/compat/cloudabi64/cloudabi64_fd.c
index fcfcc42025ea..ea403cf3559f 100644
--- a/sys/compat/cloudabi64/cloudabi64_fd.c
+++ b/sys/compat/cloudabi64/cloudabi64_fd.c
@@ -71,8 +71,8 @@ cloudabi64_copyinuio(const cloudabi64_iovec_t *iovp, size_t iovcnt,
free(uio, M_IOV);
return (error);
}
- iov[i].iov_base = TO_PTR(iovobj.iov_base);
- iov[i].iov_len = iovobj.iov_len;
+ iov[i].iov_base = TO_PTR(iovobj.buf);
+ iov[i].iov_len = iovobj.buf_len;
if (iov[i].iov_len > INT64_MAX - uio->uio_resid) {
free(uio, M_IOV);
return (EINVAL);
@@ -91,7 +91,7 @@ cloudabi64_sys_fd_pread(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio);
+ error = cloudabi64_copyinuio(uap->iovs, uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_preadv(td, uap->fd, uio, uap->offset);
@@ -106,7 +106,7 @@ cloudabi64_sys_fd_pwrite(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
+ error = cloudabi64_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_pwritev(td, uap->fd, uio, uap->offset);
@@ -121,7 +121,7 @@ cloudabi64_sys_fd_read(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio);
+ error = cloudabi64_copyinuio(uap->iovs, uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_readv(td, uap->fd, uio);
@@ -136,7 +136,7 @@ cloudabi64_sys_fd_write(struct thread *td,
struct uio *uio;
int error;
- error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
+ error = cloudabi64_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
if (error != 0)
return (error);
error = kern_writev(td, uap->fd, uio);
diff --git a/sys/compat/cloudabi64/cloudabi64_poll.c b/sys/compat/cloudabi64/cloudabi64_poll.c
index 63d8120b63e6..3df526598934 100644
--- a/sys/compat/cloudabi64/cloudabi64_poll.c
+++ b/sys/compat/cloudabi64/cloudabi64_poll.c
@@ -398,11 +398,11 @@ cloudabi64_sys_poll_fd(struct thread *td,
return (EINVAL);
timeout.tv_sec = subtimo.clock.timeout / 1000000000;
timeout.tv_nsec = subtimo.clock.timeout % 1000000000;
- return (kern_kevent(td, uap->fd, uap->nin, uap->nout, &copyops,
- &timeout));
+ return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
+ &copyops, &timeout));
} else {
/* Poll without a timeout. */
- return (kern_kevent(td, uap->fd, uap->nin, uap->nout, &copyops,
- NULL));
+ return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
+ &copyops, NULL));
}
}
diff --git a/sys/compat/cloudabi64/cloudabi64_proto.h b/sys/compat/cloudabi64/cloudabi64_proto.h
index aed44adae70c..40c3a530088f 100644
--- a/sys/compat/cloudabi64/cloudabi64_proto.h
+++ b/sys/compat/cloudabi64/cloudabi64_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed
*/
#ifndef _CLOUDABI64_SYSPROTO_H_
@@ -63,20 +63,20 @@ struct cloudabi_sys_fd_dup_args {
};
struct cloudabi64_sys_fd_pread_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iov; char iov_r_[PADR_(const cloudabi64_iovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_iovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
};
struct cloudabi64_sys_fd_pwrite_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iov; char iov_r_[PADR_(const cloudabi64_ciovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_ciovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
};
struct cloudabi64_sys_fd_read_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iov; char iov_r_[PADR_(const cloudabi64_iovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_iovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_fd_replace_args {
char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)];
@@ -101,8 +101,8 @@ struct cloudabi_sys_fd_sync_args {
};
struct cloudabi64_sys_fd_write_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
- char iov_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iov; char iov_r_[PADR_(const cloudabi64_ciovec_t *)];
- char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+ char iovs_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_ciovec_t *)];
+ char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_advise_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
@@ -118,44 +118,44 @@ struct cloudabi_sys_file_allocate_args {
struct cloudabi_sys_file_create_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)];
};
struct cloudabi_sys_file_link_args {
char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)];
char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
- char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)];
+ char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)];
char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)];
char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
- char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)];
+ char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_open_args {
char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)];
char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)];
};
struct cloudabi_sys_file_readdir_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
- char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+ char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)];
char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)];
};
struct cloudabi_sys_file_readlink_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
- char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)];
+ char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_rename_args {
- char oldfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t oldfd; char oldfd_r_[PADR_(cloudabi_fd_t)];
- char old_l_[PADL_(const char *)]; const char * old; char old_r_[PADR_(const char *)];
- char oldlen_l_[PADL_(size_t)]; size_t oldlen; char oldlen_r_[PADR_(size_t)];
- char newfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t newfd; char newfd_r_[PADR_(cloudabi_fd_t)];
- char new_l_[PADL_(const char *)]; const char * new; char new_r_[PADR_(const char *)];
- char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)];
+ char fd1_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd1; char fd1_r_[PADR_(cloudabi_fd_t)];
+ char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
+ char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)];
+ char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)];
+ char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
+ char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_stat_fget_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
@@ -169,27 +169,27 @@ struct cloudabi_sys_file_stat_fput_args {
struct cloudabi_sys_file_stat_get_args {
char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)];
};
struct cloudabi_sys_file_stat_put_args {
char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)];
char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)];
};
struct cloudabi_sys_file_symlink_args {
char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
- char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)];
+ char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)];
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
- char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)];
+ char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_file_unlink_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)];
};
struct cloudabi_sys_lock_unlock_args {
@@ -197,13 +197,13 @@ struct cloudabi_sys_lock_unlock_args {
char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)];
};
struct cloudabi_sys_mem_advise_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)];
};
struct cloudabi_sys_mem_lock_args {
- char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_mem_map_args {
char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
@@ -214,22 +214,22 @@ struct cloudabi_sys_mem_map_args {
char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)];
};
struct cloudabi_sys_mem_protect_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)];
};
struct cloudabi_sys_mem_sync_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)];
};
struct cloudabi_sys_mem_unlock_args {
- char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_mem_unmap_args {
- char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
- char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+ char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
+ char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi64_sys_poll_args {
char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)];
@@ -239,17 +239,17 @@ struct cloudabi64_sys_poll_args {
struct cloudabi64_sys_poll_fd_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)];
- char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)];
+ char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)];
char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)];
- char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)];
+ char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)];
char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)];
};
struct cloudabi_sys_proc_exec_args {
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)];
- char datalen_l_[PADL_(size_t)]; size_t datalen; char datalen_r_[PADR_(size_t)];
+ char data_len_l_[PADL_(size_t)]; size_t data_len; char data_len_r_[PADR_(size_t)];
char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)];
- char fdslen_l_[PADL_(size_t)]; size_t fdslen; char fdslen_r_[PADR_(size_t)];
+ char fds_len_l_[PADL_(size_t)]; size_t fds_len; char fds_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_proc_exit_args {
char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)];
@@ -262,7 +262,7 @@ struct cloudabi_sys_proc_raise_args {
};
struct cloudabi_sys_random_get_args {
char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
- char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+ char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_sock_accept_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
@@ -272,13 +272,13 @@ struct cloudabi_sys_sock_bind_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_sock_connect_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
- char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+ char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_sock_listen_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
diff --git a/sys/compat/cloudabi64/cloudabi64_sock.c b/sys/compat/cloudabi64/cloudabi64_sock.c
index 3915ddf0c21b..c445c145c23a 100644
--- a/sys/compat/cloudabi64/cloudabi64_sock.c
+++ b/sys/compat/cloudabi64/cloudabi64_sock.c
@@ -62,9 +62,9 @@ cloudabi64_sys_sock_recv(struct thread *td,
return (error);
/* Convert results in cloudabi_recv_in_t to struct msghdr. */
- if (ri.ri_datalen > UIO_MAXIOV)
+ if (ri.ri_data_len > UIO_MAXIOV)
return (EINVAL);
- msghdr.msg_iovlen = ri.ri_datalen;
+ msghdr.msg_iovlen = ri.ri_data_len;
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
M_SOCKET, M_WAITOK);
user_iov = TO_PTR(ri.ri_data);
@@ -74,8 +74,8 @@ cloudabi64_sys_sock_recv(struct thread *td,
free(msghdr.msg_iov, M_SOCKET);
return (error);
}
- msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
- msghdr.msg_iov[i].iov_len = iovobj.iov_len;
+ msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
+ msghdr.msg_iov[i].iov_len = iovobj.buf_len;
}
msghdr.msg_name = &ss;
msghdr.msg_namelen = sizeof(ss);
@@ -115,9 +115,9 @@ cloudabi64_sys_sock_send(struct thread *td,
return (error);
/* Convert results in cloudabi_send_in_t to struct msghdr. */
- if (si.si_datalen > UIO_MAXIOV)
+ if (si.si_data_len > UIO_MAXIOV)
return (EINVAL);
- msghdr.msg_iovlen = si.si_datalen;
+ msghdr.msg_iovlen = si.si_data_len;
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
M_SOCKET, M_WAITOK);
user_iov = TO_PTR(si.si_data);
@@ -127,8 +127,8 @@ cloudabi64_sys_sock_send(struct thread *td,
free(msghdr.msg_iov, M_SOCKET);
return (error);
}
- msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
- msghdr.msg_iov[i].iov_len = iovobj.iov_len;
+ msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
+ msghdr.msg_iov[i].iov_len = iovobj.buf_len;
}
flags = MSG_NOSIGNAL;
diff --git a/sys/compat/cloudabi64/cloudabi64_syscall.h b/sys/compat/cloudabi64/cloudabi64_syscall.h
index 7d99d5ed1d7c..50089dd6961b 100644
--- a/sys/compat/cloudabi64/cloudabi64_syscall.h
+++ b/sys/compat/cloudabi64/cloudabi64_syscall.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed
*/
#define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0
diff --git a/sys/compat/cloudabi64/cloudabi64_syscalls.c b/sys/compat/cloudabi64/cloudabi64_syscalls.c
index d430056d9cbd..5388299a0920 100644
--- a/sys/compat/cloudabi64/cloudabi64_syscalls.c
+++ b/sys/compat/cloudabi64/cloudabi64_syscalls.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed
*/
const char *cloudabi64_syscallnames[] = {
diff --git a/sys/compat/cloudabi64/cloudabi64_sysent.c b/sys/compat/cloudabi64/cloudabi64_sysent.c
index 3b1185023cbe..d922a060fef4 100644
--- a/sys/compat/cloudabi64/cloudabi64_sysent.c
+++ b/sys/compat/cloudabi64/cloudabi64_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed
*/
#include <sys/sysent.h>
diff --git a/sys/compat/cloudabi64/cloudabi64_systrace_args.c b/sys/compat/cloudabi64/cloudabi64_systrace_args.c
index 032eefd05f47..74005abcf11b 100644
--- a/sys/compat/cloudabi64/cloudabi64_systrace_args.c
+++ b/sys/compat/cloudabi64/cloudabi64_systrace_args.c
@@ -74,8 +74,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 8: {
struct cloudabi64_sys_fd_pread_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi64_iovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_iovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
iarg[3] = p->offset; /* cloudabi_filesize_t */
*n_args = 4;
break;
@@ -84,8 +84,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 9: {
struct cloudabi64_sys_fd_pwrite_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi64_ciovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_ciovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
iarg[3] = p->offset; /* cloudabi_filesize_t */
*n_args = 4;
break;
@@ -94,8 +94,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 10: {
struct cloudabi64_sys_fd_read_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi64_iovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_iovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
*n_args = 3;
break;
}
@@ -144,8 +144,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 16: {
struct cloudabi64_sys_fd_write_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->iov; /* const cloudabi64_ciovec_t * */
- uarg[2] = p->iovcnt; /* size_t */
+ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_ciovec_t * */
+ uarg[2] = p->iovs_len; /* size_t */
*n_args = 3;
break;
}
@@ -173,7 +173,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_create_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
iarg[3] = p->type; /* cloudabi_filetype_t */
*n_args = 4;
break;
@@ -183,10 +183,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_link_args *p = params;
iarg[0] = p->fd1; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path1; /* const char * */
- uarg[2] = p->path1len; /* size_t */
+ uarg[2] = p->path1_len; /* size_t */
iarg[3] = p->fd2; /* cloudabi_fd_t */
uarg[4] = (intptr_t) p->path2; /* const char * */
- uarg[5] = p->path2len; /* size_t */
+ uarg[5] = p->path2_len; /* size_t */
*n_args = 6;
break;
}
@@ -195,7 +195,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_open_args *p = params;
iarg[0] = p->dirfd; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
iarg[3] = p->oflags; /* cloudabi_oflags_t */
uarg[4] = (intptr_t) p->fds; /* const cloudabi_fdstat_t * */
*n_args = 5;
@@ -206,7 +206,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_readdir_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->buf; /* void * */
- uarg[2] = p->nbyte; /* size_t */
+ uarg[2] = p->buf_len; /* size_t */
iarg[3] = p->cookie; /* cloudabi_dircookie_t */
*n_args = 4;
break;
@@ -216,21 +216,21 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_readlink_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
uarg[3] = (intptr_t) p->buf; /* char * */
- uarg[4] = p->bufsize; /* size_t */
+ uarg[4] = p->buf_len; /* size_t */
*n_args = 5;
break;
}
/* cloudabi_sys_file_rename */
case 24: {
struct cloudabi_sys_file_rename_args *p = params;
- iarg[0] = p->oldfd; /* cloudabi_fd_t */
- uarg[1] = (intptr_t) p->old; /* const char * */
- uarg[2] = p->oldlen; /* size_t */
- iarg[3] = p->newfd; /* cloudabi_fd_t */
- uarg[4] = (intptr_t) p->new; /* const char * */
- uarg[5] = p->newlen; /* size_t */
+ iarg[0] = p->fd1; /* cloudabi_fd_t */
+ uarg[1] = (intptr_t) p->path1; /* const char * */
+ uarg[2] = p->path1_len; /* size_t */
+ iarg[3] = p->fd2; /* cloudabi_fd_t */
+ uarg[4] = (intptr_t) p->path2; /* const char * */
+ uarg[5] = p->path2_len; /* size_t */
*n_args = 6;
break;
}
@@ -256,7 +256,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_stat_get_args *p = params;
iarg[0] = p->fd; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
uarg[3] = (intptr_t) p->buf; /* cloudabi_filestat_t * */
*n_args = 4;
break;
@@ -266,7 +266,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_stat_put_args *p = params;
iarg[0] = p->fd; /* cloudabi_lookup_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
uarg[3] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */
iarg[4] = p->flags; /* cloudabi_fsflags_t */
*n_args = 5;
@@ -276,10 +276,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 29: {
struct cloudabi_sys_file_symlink_args *p = params;
uarg[0] = (intptr_t) p->path1; /* const char * */
- uarg[1] = p->path1len; /* size_t */
+ uarg[1] = p->path1_len; /* size_t */
iarg[2] = p->fd; /* cloudabi_fd_t */
uarg[3] = (intptr_t) p->path2; /* const char * */
- uarg[4] = p->path2len; /* size_t */
+ uarg[4] = p->path2_len; /* size_t */
*n_args = 5;
break;
}
@@ -288,7 +288,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_file_unlink_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->path; /* const char * */
- uarg[2] = p->pathlen; /* size_t */
+ uarg[2] = p->path_len; /* size_t */
iarg[3] = p->flags; /* cloudabi_ulflags_t */
*n_args = 4;
break;
@@ -304,8 +304,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_advise */
case 32: {
struct cloudabi_sys_mem_advise_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
iarg[2] = p->advice; /* cloudabi_advice_t */
*n_args = 3;
break;
@@ -313,8 +313,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_lock */
case 33: {
struct cloudabi_sys_mem_lock_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* const void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* const void * */
+ uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
@@ -333,8 +333,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_protect */
case 35: {
struct cloudabi_sys_mem_protect_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
iarg[2] = p->prot; /* cloudabi_mprot_t */
*n_args = 3;
break;
@@ -342,8 +342,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_sync */
case 36: {
struct cloudabi_sys_mem_sync_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
iarg[2] = p->flags; /* cloudabi_msflags_t */
*n_args = 3;
break;
@@ -351,16 +351,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* cloudabi_sys_mem_unlock */
case 37: {
struct cloudabi_sys_mem_unlock_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* const void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* const void * */
+ uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
/* cloudabi_sys_mem_unmap */
case 38: {
struct cloudabi_sys_mem_unmap_args *p = params;
- uarg[0] = (intptr_t) p->addr; /* void * */
- uarg[1] = p->len; /* size_t */
+ uarg[0] = (intptr_t) p->mapping; /* void * */
+ uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
@@ -378,9 +378,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi64_sys_poll_fd_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */
- uarg[2] = p->nin; /* size_t */
+ uarg[2] = p->in_len; /* size_t */
uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */
- uarg[4] = p->nout; /* size_t */
+ uarg[4] = p->out_len; /* size_t */
uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */
*n_args = 6;
break;
@@ -390,9 +390,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
struct cloudabi_sys_proc_exec_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->data; /* const void * */
- uarg[2] = p->datalen; /* size_t */
+ uarg[2] = p->data_len; /* size_t */
uarg[3] = (intptr_t) p->fds; /* const cloudabi_fd_t * */
- uarg[4] = p->fdslen; /* size_t */
+ uarg[4] = p->fds_len; /* size_t */
*n_args = 5;
break;
}
@@ -419,7 +419,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 45: {
struct cloudabi_sys_random_get_args *p = params;
uarg[0] = (intptr_t) p->buf; /* void * */
- uarg[1] = p->nbyte; /* size_t */
+ uarg[1] = p->buf_len; /* size_t */
*n_args = 2;
break;
}
@@ -437,7 +437,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
uarg[2] = (intptr_t) p->path; /* const char * */
- uarg[3] = p->pathlen; /* size_t */
+ uarg[3] = p->path_len; /* size_t */
*n_args = 4;
break;
}
@@ -447,7 +447,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
uarg[2] = (intptr_t) p->path; /* const char * */
- uarg[3] = p->pathlen; /* size_t */
+ uarg[3] = p->path_len; /* size_t */
*n_args = 4;
break;
}
diff --git a/sys/compat/cloudabi64/cloudabi64_thread.c b/sys/compat/cloudabi64/cloudabi64_thread.c
index 429ad3398be6..4cb980b1530d 100644
--- a/sys/compat/cloudabi64/cloudabi64_thread.c
+++ b/sys/compat/cloudabi64/cloudabi64_thread.c
@@ -65,9 +65,9 @@ cloudabi64_sys_thread_create(struct thread *td,
return (error);
/* Remove some space on the top of the stack for the TCB. */
- args.tcb = rounddown(args.attr.stack + args.attr.stack_size -
+ args.tcb = rounddown(args.attr.stack + args.attr.stack_len -
sizeof(cloudabi64_tcb_t), _Alignof(cloudabi64_tcb_t));
- args.attr.stack_size = args.tcb - args.attr.stack;
+ args.attr.stack_len = args.tcb - args.attr.stack;
error = thread_create(td, NULL, initialize_thread, &args);
if (error != 0)
diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc
index e529ef7cc11d..3d01a342d7df 100644
--- a/sys/conf/Makefile.powerpc
+++ b/sys/conf/Makefile.powerpc
@@ -39,7 +39,8 @@ INCLUDES+= -I$S/contrib/libfdt
# Force __SPE__, since the builtin will be removed later with -mno-spe
CFLAGS+= -mabi=spe -D__SPE__
.endif
-CFLAGS+= -msoft-float -Wa,-many
+CFLAGS+= -msoft-float
+CFLAGS.gcc+= -Wa,-many
# Build position-independent kernel
CFLAGS+= -fPIC
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 2e430bc129da..c8ac5de69ae5 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -619,6 +619,8 @@ options HWPMC_HOOKS # Other necessary kernel hooks
options INET #Internet communications protocols
options INET6 #IPv6 communications protocols
+options RATELIMIT # TX rate limiting support
+
options ROUTETABLES=2 # allocated fibs up to 65536. default is 1.
# but that would be a bad idea as they are large.
@@ -772,8 +774,7 @@ options NETGRAPH_IPFW
options NETGRAPH_KSOCKET
options NETGRAPH_L2TP
options NETGRAPH_LMI
-# MPPC compression requires proprietary files (not included)
-#options NETGRAPH_MPPC_COMPRESSION
+options NETGRAPH_MPPC_COMPRESSION
options NETGRAPH_MPPC_ENCRYPTION
options NETGRAPH_NETFLOW
options NETGRAPH_NAT
diff --git a/sys/conf/config.mk b/sys/conf/config.mk
index 0a3e7b9834d7..50294961ca12 100644
--- a/sys/conf/config.mk
+++ b/sys/conf/config.mk
@@ -19,6 +19,10 @@ opt_inet.h:
opt_inet6.h:
@echo "#define INET6 1" > ${.TARGET}
.endif
+.if ${MK_RATELIMIT} != "no"
+opt_ratelimit.h:
+ @echo "#define RATELIMIT 1" > ${.TARGET}
+.endif
.if ${MK_EISA} != "no"
opt_eisa.h:
@echo "#define DEV_EISA 1" > ${.TARGET}
diff --git a/sys/conf/files b/sys/conf/files
index a17b3421039a..fb17efbbc5db 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -2716,6 +2716,7 @@ dev/rtwn/rtl8821a/r21a_led.c optional rtwn
dev/rtwn/rtl8821a/r21a_rom.c optional rtwn
dev/rtwn/rtl8821a/r21a_rx.c optional rtwn
dev/rtwn/rtl8821a/usb/r21au_attach.c optional rtwn_usb
+dev/rtwn/rtl8821a/usb/r21au_dfs.c optional rtwn_usb
dev/rtwn/rtl8821a/usb/r21au_init.c optional rtwn_usb
rtwn-rtl8188eufw.c optional rtwn-rtl8188eufw | rtwnfw \
compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eufw.fw:rtwn-rtl8188eufw:111 -mrtwn-rtl8188eufw -c${.TARGET}" \
diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk
index 66d43b2ac511..8b793cf5184d 100644
--- a/sys/conf/kern.opts.mk
+++ b/sys/conf/kern.opts.mk
@@ -48,6 +48,7 @@ __DEFAULT_NO_OPTIONS = \
EXTRA_TCP_STACKS \
NAND \
OFED \
+ RATELIMIT \
REPRODUCIBLE_BUILD
# Some options are totally broken on some architectures. We disable
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index ee72dbe0ebe1..2afc70808813 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -192,7 +192,7 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
SYSTEM_DEP+= ${LDSCRIPT}
# Calculate path for .m files early, if needed.
-.if !defined(NO_MODULES) && !defined(__MPATH)
+.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install)
__MPATH!=find ${S:tA}/ -name \*_if.m
.endif
diff --git a/sys/conf/options b/sys/conf/options
index dee1eaddbb0d..beea9bd507d3 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -412,6 +412,7 @@ BOOTP_NFSV3 opt_bootp.h
BOOTP_WIRED_TO opt_bootp.h
DEVICE_POLLING
DUMMYNET opt_ipdn.h
+RATELIMIT opt_ratelimit.h
INET opt_inet.h
INET6 opt_inet6.h
IPDIVERT
@@ -516,7 +517,6 @@ NETGRAPH_IPFW opt_netgraph.h
NETGRAPH_KSOCKET opt_netgraph.h
NETGRAPH_L2TP opt_netgraph.h
NETGRAPH_LMI opt_netgraph.h
-# MPPC compression requires proprietary files (not included)
NETGRAPH_MPPC_COMPRESSION opt_netgraph.h
NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h
NETGRAPH_NAT opt_netgraph.h
diff --git a/sys/contrib/cloudabi/cloudabi32_types.h b/sys/contrib/cloudabi/cloudabi32_types.h
index 71d6429598af..2986e894c2b9 100644
--- a/sys/contrib/cloudabi/cloudabi32_types.h
+++ b/sys/contrib/cloudabi/cloudabi32_types.h
@@ -44,11 +44,11 @@ _Static_assert(sizeof(cloudabi32_auxv_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_auxv_t) == 4, "Incorrect layout");
typedef struct {
- _Alignas(4) uint32_t iov_base;
- _Alignas(4) uint32_t iov_len;
+ _Alignas(4) uint32_t buf;
+ _Alignas(4) uint32_t buf_len;
} cloudabi32_ciovec_t;
-_Static_assert(offsetof(cloudabi32_ciovec_t, iov_base) == 0, "Incorrect layout");
-_Static_assert(offsetof(cloudabi32_ciovec_t, iov_len) == 4, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_ciovec_t, buf) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_ciovec_t, buf_len) == 4, "Incorrect layout");
_Static_assert(sizeof(cloudabi32_ciovec_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_ciovec_t) == 4, "Incorrect layout");
@@ -94,11 +94,11 @@ _Static_assert(sizeof(cloudabi32_event_t) == 32, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_event_t) == 8, "Incorrect layout");
typedef struct {
- _Alignas(4) uint32_t iov_base;
- _Alignas(4) uint32_t iov_len;
+ _Alignas(4) uint32_t buf;
+ _Alignas(4) uint32_t buf_len;
} cloudabi32_iovec_t;
-_Static_assert(offsetof(cloudabi32_iovec_t, iov_base) == 0, "Incorrect layout");
-_Static_assert(offsetof(cloudabi32_iovec_t, iov_len) == 4, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_iovec_t, buf) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_iovec_t, buf_len) == 4, "Incorrect layout");
_Static_assert(sizeof(cloudabi32_iovec_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_iovec_t) == 4, "Incorrect layout");
@@ -106,30 +106,30 @@ typedef void cloudabi32_processentry_t(uint32_t auxv);
typedef struct {
_Alignas(4) uint32_t ri_data;
- _Alignas(4) uint32_t ri_datalen;
+ _Alignas(4) uint32_t ri_data_len;
_Alignas(4) uint32_t ri_fds;
- _Alignas(4) uint32_t ri_fdslen;
+ _Alignas(4) uint32_t ri_fds_len;
_Alignas(2) cloudabi_msgflags_t ri_flags;
} cloudabi32_recv_in_t;
_Static_assert(offsetof(cloudabi32_recv_in_t, ri_data) == 0, "Incorrect layout");
-_Static_assert(offsetof(cloudabi32_recv_in_t, ri_datalen) == 4, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_recv_in_t, ri_data_len) == 4, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_in_t, ri_fds) == 8, "Incorrect layout");
-_Static_assert(offsetof(cloudabi32_recv_in_t, ri_fdslen) == 12, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_recv_in_t, ri_fds_len) == 12, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_in_t, ri_flags) == 16, "Incorrect layout");
_Static_assert(sizeof(cloudabi32_recv_in_t) == 20, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_recv_in_t) == 4, "Incorrect layout");
typedef struct {
_Alignas(4) uint32_t si_data;
- _Alignas(4) uint32_t si_datalen;
+ _Alignas(4) uint32_t si_data_len;
_Alignas(4) uint32_t si_fds;
- _Alignas(4) uint32_t si_fdslen;
+ _Alignas(4) uint32_t si_fds_len;
_Alignas(2) cloudabi_msgflags_t si_flags;
} cloudabi32_send_in_t;
_Static_assert(offsetof(cloudabi32_send_in_t, si_data) == 0, "Incorrect layout");
-_Static_assert(offsetof(cloudabi32_send_in_t, si_datalen) == 4, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_send_in_t, si_data_len) == 4, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_send_in_t, si_fds) == 8, "Incorrect layout");
-_Static_assert(offsetof(cloudabi32_send_in_t, si_fdslen) == 12, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_send_in_t, si_fds_len) == 12, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_send_in_t, si_flags) == 16, "Incorrect layout");
_Static_assert(sizeof(cloudabi32_send_in_t) == 20, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_send_in_t) == 4, "Incorrect layout");
@@ -219,12 +219,12 @@ _Static_assert(_Alignof(cloudabi32_recv_out_t) == 4, "Incorrect layout");
typedef struct {
_Alignas(4) uint32_t entry_point;
_Alignas(4) uint32_t stack;
- _Alignas(4) uint32_t stack_size;
+ _Alignas(4) uint32_t stack_len;
_Alignas(4) uint32_t argument;
} cloudabi32_threadattr_t;
_Static_assert(offsetof(cloudabi32_threadattr_t, entry_point) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_threadattr_t, stack) == 4, "Incorrect layout");
-_Static_assert(offsetof(cloudabi32_threadattr_t, stack_size) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi32_threadattr_t, stack_len) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_threadattr_t, argument) == 12, "Incorrect layout");
_Static_assert(sizeof(cloudabi32_threadattr_t) == 16, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_threadattr_t) == 4, "Incorrect layout");
diff --git a/sys/contrib/cloudabi/cloudabi64_types.h b/sys/contrib/cloudabi/cloudabi64_types.h
index 5d54e7e47e44..0a185ac47d0e 100644
--- a/sys/contrib/cloudabi/cloudabi64_types.h
+++ b/sys/contrib/cloudabi/cloudabi64_types.h
@@ -44,12 +44,11 @@ _Static_assert(sizeof(cloudabi64_auxv_t) == 16, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_auxv_t) == 8, "Incorrect layout");
typedef struct {
- _Alignas(8) uint64_t iov_base;
- _Alignas(8) uint64_t iov_len;
+ _Alignas(8) uint64_t buf;
+ _Alignas(8) uint64_t buf_len;
} cloudabi64_ciovec_t;
-_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_ciovec_t, iov_len) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_ciovec_t, buf) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_ciovec_t, buf_len) == 8, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_ciovec_t) == 16, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_ciovec_t) == 8, "Incorrect layout");
@@ -82,33 +81,24 @@ typedef struct {
_Static_assert(offsetof(cloudabi64_event_t, userdata) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, error) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, type) == 10, "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_event_t) == 32, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_event_t) == 8, "Incorrect layout");
typedef struct {
- _Alignas(8) uint64_t iov_base;
- _Alignas(8) uint64_t iov_len;
+ _Alignas(8) uint64_t buf;
+ _Alignas(8) uint64_t buf_len;
} cloudabi64_iovec_t;
-_Static_assert(offsetof(cloudabi64_iovec_t, iov_base) == 0, "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_iovec_t, iov_len) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_iovec_t, buf) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_iovec_t, buf_len) == 8, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_iovec_t) == 16, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_iovec_t) == 8, "Incorrect layout");
@@ -116,47 +106,38 @@ typedef void cloudabi64_processentry_t(uint64_t auxv);
typedef struct {
_Alignas(8) uint64_t ri_data;
- _Alignas(8) uint64_t ri_datalen;
+ _Alignas(8) uint64_t ri_data_len;
_Alignas(8) uint64_t ri_fds;
- _Alignas(8) uint64_t ri_fdslen;
+ _Alignas(8) uint64_t ri_fds_len;
_Alignas(2) cloudabi_msgflags_t ri_flags;
} cloudabi64_recv_in_t;
-_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data_len) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds_len) == 24, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_recv_in_t) == 40, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_recv_in_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t si_data;
- _Alignas(8) uint64_t si_datalen;
+ _Alignas(8) uint64_t si_data_len;
_Alignas(8) uint64_t si_fds;
- _Alignas(8) uint64_t si_fdslen;
+ _Alignas(8) uint64_t si_fds_len;
_Alignas(2) cloudabi_msgflags_t si_flags;
} cloudabi64_send_in_t;
-_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_send_in_t, si_data_len) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_send_in_t, si_fds_len) == 24, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_send_in_t) == 40, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_send_in_t) == 8, "Incorrect layout");
-typedef struct { _Alignas(8) uint64_t so_datalen; } cloudabi64_send_out_t;
-_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0,
- "Incorrect layout");
+typedef struct {
+ _Alignas(8) uint64_t so_datalen;
+} cloudabi64_send_out_t;
+_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_send_out_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_send_out_t) == 8, "Incorrect layout");
@@ -191,44 +172,29 @@ typedef struct {
} proc_terminate;
};
} cloudabi64_subscription_t;
-_Static_assert(offsetof(cloudabi64_subscription_t, userdata) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, flags) == 8,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, type) == 10,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, clock.identifier) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, clock.clock_id) == 24,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, clock.timeout) == 32,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, clock.precision) == 40,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, clock.flags) == 48,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock) == 24,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar_scope) == 32,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock_scope) == 33,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.fd) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.flags) == 20,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock_scope) == 24,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_subscription_t, proc_terminate.fd) == 16,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, userdata) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, flags) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, type) == 10, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, clock.identifier) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, clock.clock_id) == 24, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, clock.timeout) == 32, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, clock.precision) == 40, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, clock.flags) == 48, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock) == 24, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar_scope) == 32, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock_scope) == 33, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.fd) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.flags) == 20, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock_scope) == 24, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_subscription_t, proc_terminate.fd) == 16, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_subscription_t) == 56, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_subscription_t) == 8, "Incorrect layout");
-typedef struct { _Alignas(8) uint64_t parent; } cloudabi64_tcb_t;
+typedef struct {
+ _Alignas(8) uint64_t parent;
+} cloudabi64_tcb_t;
_Static_assert(offsetof(cloudabi64_tcb_t, parent) == 0, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_tcb_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_tcb_t) == 8, "Incorrect layout");
@@ -242,33 +208,24 @@ typedef struct {
_Alignas(2) cloudabi_sockaddr_t ro_peername;
_Alignas(2) cloudabi_msgflags_t ro_flags;
} cloudabi64_recv_out_t;
-_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_recv_out_t) == 64, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_recv_out_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t entry_point;
_Alignas(8) uint64_t stack;
- _Alignas(8) uint64_t stack_size;
+ _Alignas(8) uint64_t stack_len;
_Alignas(8) uint64_t argument;
} cloudabi64_threadattr_t;
-_Static_assert(offsetof(cloudabi64_threadattr_t, entry_point) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_threadattr_t, stack) == 8,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_threadattr_t, stack_size) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi64_threadattr_t, argument) == 24,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_threadattr_t, entry_point) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_threadattr_t, stack) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_threadattr_t, stack_len) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi64_threadattr_t, argument) == 24, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_threadattr_t) == 32, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_threadattr_t) == 8, "Incorrect layout");
diff --git a/sys/contrib/cloudabi/cloudabi_types_common.h b/sys/contrib/cloudabi/cloudabi_types_common.h
index 0297e2a9d99a..86e76d3fbbbf 100644
--- a/sys/contrib/cloudabi/cloudabi_types_common.h
+++ b/sys/contrib/cloudabi/cloudabi_types_common.h
@@ -38,34 +38,34 @@
#endif
typedef uint8_t cloudabi_advice_t;
-#define CLOUDABI_ADVICE_DONTNEED 1
-#define CLOUDABI_ADVICE_NOREUSE 2
-#define CLOUDABI_ADVICE_NORMAL 3
-#define CLOUDABI_ADVICE_RANDOM 4
+#define CLOUDABI_ADVICE_DONTNEED 1
+#define CLOUDABI_ADVICE_NOREUSE 2
+#define CLOUDABI_ADVICE_NORMAL 3
+#define CLOUDABI_ADVICE_RANDOM 4
#define CLOUDABI_ADVICE_SEQUENTIAL 5
-#define CLOUDABI_ADVICE_WILLNEED 6
+#define CLOUDABI_ADVICE_WILLNEED 6
typedef uint32_t cloudabi_auxtype_t;
-#define CLOUDABI_AT_ARGDATA 256
-#define CLOUDABI_AT_ARGDATALEN 257
-#define CLOUDABI_AT_BASE 7
-#define CLOUDABI_AT_CANARY 258
-#define CLOUDABI_AT_CANARYLEN 259
-#define CLOUDABI_AT_NCPUS 260
-#define CLOUDABI_AT_NULL 0
-#define CLOUDABI_AT_PAGESZ 6
-#define CLOUDABI_AT_PHDR 3
-#define CLOUDABI_AT_PHNUM 4
+#define CLOUDABI_AT_ARGDATA 256
+#define CLOUDABI_AT_ARGDATALEN 257
+#define CLOUDABI_AT_BASE 7
+#define CLOUDABI_AT_CANARY 258
+#define CLOUDABI_AT_CANARYLEN 259
+#define CLOUDABI_AT_NCPUS 260
+#define CLOUDABI_AT_NULL 0
+#define CLOUDABI_AT_PAGESZ 6
+#define CLOUDABI_AT_PHDR 3
+#define CLOUDABI_AT_PHNUM 4
#define CLOUDABI_AT_SYSINFO_EHDR 262
-#define CLOUDABI_AT_TID 261
+#define CLOUDABI_AT_TID 261
typedef uint32_t cloudabi_backlog_t;
typedef uint32_t cloudabi_clockid_t;
-#define CLOUDABI_CLOCK_MONOTONIC 1
+#define CLOUDABI_CLOCK_MONOTONIC 1
#define CLOUDABI_CLOCK_PROCESS_CPUTIME_ID 2
-#define CLOUDABI_CLOCK_REALTIME 3
-#define CLOUDABI_CLOCK_THREAD_CPUTIME_ID 4
+#define CLOUDABI_CLOCK_REALTIME 3
+#define CLOUDABI_CLOCK_THREAD_CPUTIME_ID 4
typedef uint32_t cloudabi_condvar_t;
#define CLOUDABI_CONDVAR_HAS_NO_WAITERS 0
@@ -76,110 +76,110 @@ typedef uint64_t cloudabi_dircookie_t;
#define CLOUDABI_DIRCOOKIE_START 0
typedef uint16_t cloudabi_errno_t;
-#define CLOUDABI_E2BIG 1
-#define CLOUDABI_EACCES 2
-#define CLOUDABI_EADDRINUSE 3
-#define CLOUDABI_EADDRNOTAVAIL 4
-#define CLOUDABI_EAFNOSUPPORT 5
-#define CLOUDABI_EAGAIN 6
-#define CLOUDABI_EALREADY 7
-#define CLOUDABI_EBADF 8
-#define CLOUDABI_EBADMSG 9
-#define CLOUDABI_EBUSY 10
-#define CLOUDABI_ECANCELED 11
-#define CLOUDABI_ECHILD 12
-#define CLOUDABI_ECONNABORTED 13
-#define CLOUDABI_ECONNREFUSED 14
-#define CLOUDABI_ECONNRESET 15
-#define CLOUDABI_EDEADLK 16
-#define CLOUDABI_EDESTADDRREQ 17
-#define CLOUDABI_EDOM 18
-#define CLOUDABI_EDQUOT 19
-#define CLOUDABI_EEXIST 20
-#define CLOUDABI_EFAULT 21
-#define CLOUDABI_EFBIG 22
-#define CLOUDABI_EHOSTUNREACH 23
-#define CLOUDABI_EIDRM 24
-#define CLOUDABI_EILSEQ 25
-#define CLOUDABI_EINPROGRESS 26
-#define CLOUDABI_EINTR 27
-#define CLOUDABI_EINVAL 28
-#define CLOUDABI_EIO 29
-#define CLOUDABI_EISCONN 30
-#define CLOUDABI_EISDIR 31
-#define CLOUDABI_ELOOP 32
-#define CLOUDABI_EMFILE 33
-#define CLOUDABI_EMLINK 34
-#define CLOUDABI_EMSGSIZE 35
-#define CLOUDABI_EMULTIHOP 36
-#define CLOUDABI_ENAMETOOLONG 37
-#define CLOUDABI_ENETDOWN 38
-#define CLOUDABI_ENETRESET 39
-#define CLOUDABI_ENETUNREACH 40
-#define CLOUDABI_ENFILE 41
-#define CLOUDABI_ENOBUFS 42
-#define CLOUDABI_ENODEV 43
-#define CLOUDABI_ENOENT 44
-#define CLOUDABI_ENOEXEC 45
-#define CLOUDABI_ENOLCK 46
-#define CLOUDABI_ENOLINK 47
-#define CLOUDABI_ENOMEM 48
-#define CLOUDABI_ENOMSG 49
-#define CLOUDABI_ENOPROTOOPT 50
-#define CLOUDABI_ENOSPC 51
-#define CLOUDABI_ENOSYS 52
-#define CLOUDABI_ENOTCONN 53
-#define CLOUDABI_ENOTDIR 54
-#define CLOUDABI_ENOTEMPTY 55
+#define CLOUDABI_E2BIG 1
+#define CLOUDABI_EACCES 2
+#define CLOUDABI_EADDRINUSE 3
+#define CLOUDABI_EADDRNOTAVAIL 4
+#define CLOUDABI_EAFNOSUPPORT 5
+#define CLOUDABI_EAGAIN 6
+#define CLOUDABI_EALREADY 7
+#define CLOUDABI_EBADF 8
+#define CLOUDABI_EBADMSG 9
+#define CLOUDABI_EBUSY 10
+#define CLOUDABI_ECANCELED 11
+#define CLOUDABI_ECHILD 12
+#define CLOUDABI_ECONNABORTED 13
+#define CLOUDABI_ECONNREFUSED 14
+#define CLOUDABI_ECONNRESET 15
+#define CLOUDABI_EDEADLK 16
+#define CLOUDABI_EDESTADDRREQ 17
+#define CLOUDABI_EDOM 18
+#define CLOUDABI_EDQUOT 19
+#define CLOUDABI_EEXIST 20
+#define CLOUDABI_EFAULT 21
+#define CLOUDABI_EFBIG 22
+#define CLOUDABI_EHOSTUNREACH 23
+#define CLOUDABI_EIDRM 24
+#define CLOUDABI_EILSEQ 25
+#define CLOUDABI_EINPROGRESS 26
+#define CLOUDABI_EINTR 27
+#define CLOUDABI_EINVAL 28
+#define CLOUDABI_EIO 29
+#define CLOUDABI_EISCONN 30
+#define CLOUDABI_EISDIR 31
+#define CLOUDABI_ELOOP 32
+#define CLOUDABI_EMFILE 33
+#define CLOUDABI_EMLINK 34
+#define CLOUDABI_EMSGSIZE 35
+#define CLOUDABI_EMULTIHOP 36
+#define CLOUDABI_ENAMETOOLONG 37
+#define CLOUDABI_ENETDOWN 38
+#define CLOUDABI_ENETRESET 39
+#define CLOUDABI_ENETUNREACH 40
+#define CLOUDABI_ENFILE 41
+#define CLOUDABI_ENOBUFS 42
+#define CLOUDABI_ENODEV 43
+#define CLOUDABI_ENOENT 44
+#define CLOUDABI_ENOEXEC 45
+#define CLOUDABI_ENOLCK 46
+#define CLOUDABI_ENOLINK 47
+#define CLOUDABI_ENOMEM 48
+#define CLOUDABI_ENOMSG 49
+#define CLOUDABI_ENOPROTOOPT 50
+#define CLOUDABI_ENOSPC 51
+#define CLOUDABI_ENOSYS 52
+#define CLOUDABI_ENOTCONN 53
+#define CLOUDABI_ENOTDIR 54
+#define CLOUDABI_ENOTEMPTY 55
#define CLOUDABI_ENOTRECOVERABLE 56
-#define CLOUDABI_ENOTSOCK 57
-#define CLOUDABI_ENOTSUP 58
-#define CLOUDABI_ENOTTY 59
-#define CLOUDABI_ENXIO 60
-#define CLOUDABI_EOVERFLOW 61
-#define CLOUDABI_EOWNERDEAD 62
-#define CLOUDABI_EPERM 63
-#define CLOUDABI_EPIPE 64
-#define CLOUDABI_EPROTO 65
+#define CLOUDABI_ENOTSOCK 57
+#define CLOUDABI_ENOTSUP 58
+#define CLOUDABI_ENOTTY 59
+#define CLOUDABI_ENXIO 60
+#define CLOUDABI_EOVERFLOW 61
+#define CLOUDABI_EOWNERDEAD 62
+#define CLOUDABI_EPERM 63
+#define CLOUDABI_EPIPE 64
+#define CLOUDABI_EPROTO 65
#define CLOUDABI_EPROTONOSUPPORT 66
-#define CLOUDABI_EPROTOTYPE 67
-#define CLOUDABI_ERANGE 68
-#define CLOUDABI_EROFS 69
-#define CLOUDABI_ESPIPE 70
-#define CLOUDABI_ESRCH 71
-#define CLOUDABI_ESTALE 72
-#define CLOUDABI_ETIMEDOUT 73
-#define CLOUDABI_ETXTBSY 74
-#define CLOUDABI_EXDEV 75
-#define CLOUDABI_ENOTCAPABLE 76
+#define CLOUDABI_EPROTOTYPE 67
+#define CLOUDABI_ERANGE 68
+#define CLOUDABI_EROFS 69
+#define CLOUDABI_ESPIPE 70
+#define CLOUDABI_ESRCH 71
+#define CLOUDABI_ESTALE 72
+#define CLOUDABI_ETIMEDOUT 73
+#define CLOUDABI_ETXTBSY 74
+#define CLOUDABI_EXDEV 75
+#define CLOUDABI_ENOTCAPABLE 76
typedef uint16_t cloudabi_eventrwflags_t;
#define CLOUDABI_EVENT_FD_READWRITE_HANGUP 0x0001
typedef uint8_t cloudabi_eventtype_t;
-#define CLOUDABI_EVENTTYPE_CLOCK 1
-#define CLOUDABI_EVENTTYPE_CONDVAR 2
-#define CLOUDABI_EVENTTYPE_FD_READ 3
-#define CLOUDABI_EVENTTYPE_FD_WRITE 4
-#define CLOUDABI_EVENTTYPE_LOCK_RDLOCK 5
-#define CLOUDABI_EVENTTYPE_LOCK_WRLOCK 6
+#define CLOUDABI_EVENTTYPE_CLOCK 1
+#define CLOUDABI_EVENTTYPE_CONDVAR 2
+#define CLOUDABI_EVENTTYPE_FD_READ 3
+#define CLOUDABI_EVENTTYPE_FD_WRITE 4
+#define CLOUDABI_EVENTTYPE_LOCK_RDLOCK 5
+#define CLOUDABI_EVENTTYPE_LOCK_WRLOCK 6
#define CLOUDABI_EVENTTYPE_PROC_TERMINATE 7
typedef uint32_t cloudabi_exitcode_t;
typedef uint32_t cloudabi_fd_t;
#define CLOUDABI_PROCESS_CHILD 0xffffffff
-#define CLOUDABI_MAP_ANON_FD 0xffffffff
+#define CLOUDABI_MAP_ANON_FD 0xffffffff
typedef uint16_t cloudabi_fdflags_t;
-#define CLOUDABI_FDFLAG_APPEND 0x0001
-#define CLOUDABI_FDFLAG_DSYNC 0x0002
+#define CLOUDABI_FDFLAG_APPEND 0x0001
+#define CLOUDABI_FDFLAG_DSYNC 0x0002
#define CLOUDABI_FDFLAG_NONBLOCK 0x0004
-#define CLOUDABI_FDFLAG_RSYNC 0x0008
-#define CLOUDABI_FDFLAG_SYNC 0x0010
+#define CLOUDABI_FDFLAG_RSYNC 0x0008
+#define CLOUDABI_FDFLAG_SYNC 0x0010
typedef uint16_t cloudabi_fdsflags_t;
-#define CLOUDABI_FDSTAT_FLAGS 0x0001
+#define CLOUDABI_FDSTAT_FLAGS 0x0001
#define CLOUDABI_FDSTAT_RIGHTS 0x0002
typedef int64_t cloudabi_filedelta_t;
@@ -187,155 +187,155 @@ typedef int64_t cloudabi_filedelta_t;
typedef uint64_t cloudabi_filesize_t;
typedef uint8_t cloudabi_filetype_t;
-#define CLOUDABI_FILETYPE_UNKNOWN 0
-#define CLOUDABI_FILETYPE_BLOCK_DEVICE 16
-#define CLOUDABI_FILETYPE_CHARACTER_DEVICE 17
-#define CLOUDABI_FILETYPE_DIRECTORY 32
-#define CLOUDABI_FILETYPE_FIFO 48
-#define CLOUDABI_FILETYPE_POLL 64
-#define CLOUDABI_FILETYPE_PROCESS 80
-#define CLOUDABI_FILETYPE_REGULAR_FILE 96
-#define CLOUDABI_FILETYPE_SHARED_MEMORY 112
-#define CLOUDABI_FILETYPE_SOCKET_DGRAM 128
+#define CLOUDABI_FILETYPE_UNKNOWN 0
+#define CLOUDABI_FILETYPE_BLOCK_DEVICE 16
+#define CLOUDABI_FILETYPE_CHARACTER_DEVICE 17
+#define CLOUDABI_FILETYPE_DIRECTORY 32
+#define CLOUDABI_FILETYPE_FIFO 48
+#define CLOUDABI_FILETYPE_POLL 64
+#define CLOUDABI_FILETYPE_PROCESS 80
+#define CLOUDABI_FILETYPE_REGULAR_FILE 96
+#define CLOUDABI_FILETYPE_SHARED_MEMORY 112
+#define CLOUDABI_FILETYPE_SOCKET_DGRAM 128
#define CLOUDABI_FILETYPE_SOCKET_SEQPACKET 129
-#define CLOUDABI_FILETYPE_SOCKET_STREAM 130
-#define CLOUDABI_FILETYPE_SYMBOLIC_LINK 144
+#define CLOUDABI_FILETYPE_SOCKET_STREAM 130
+#define CLOUDABI_FILETYPE_SYMBOLIC_LINK 144
typedef uint16_t cloudabi_fsflags_t;
-#define CLOUDABI_FILESTAT_ATIM 0x0001
+#define CLOUDABI_FILESTAT_ATIM 0x0001
#define CLOUDABI_FILESTAT_ATIM_NOW 0x0002
-#define CLOUDABI_FILESTAT_MTIM 0x0004
+#define CLOUDABI_FILESTAT_MTIM 0x0004
#define CLOUDABI_FILESTAT_MTIM_NOW 0x0008
-#define CLOUDABI_FILESTAT_SIZE 0x0010
+#define CLOUDABI_FILESTAT_SIZE 0x0010
typedef uint64_t cloudabi_inode_t;
typedef uint32_t cloudabi_linkcount_t;
typedef uint32_t cloudabi_lock_t;
-#define CLOUDABI_LOCK_UNLOCKED 0x00000000
-#define CLOUDABI_LOCK_WRLOCKED 0x40000000
+#define CLOUDABI_LOCK_UNLOCKED 0x00000000
+#define CLOUDABI_LOCK_WRLOCKED 0x40000000
#define CLOUDABI_LOCK_KERNEL_MANAGED 0x80000000
-#define CLOUDABI_LOCK_BOGUS 0x80000000
+#define CLOUDABI_LOCK_BOGUS 0x80000000
typedef uint32_t cloudabi_lookupflags_t;
#define CLOUDABI_LOOKUP_SYMLINK_FOLLOW 0x00000001
typedef uint8_t cloudabi_mflags_t;
-#define CLOUDABI_MAP_ANON 0x01
-#define CLOUDABI_MAP_FIXED 0x02
+#define CLOUDABI_MAP_ANON 0x01
+#define CLOUDABI_MAP_FIXED 0x02
#define CLOUDABI_MAP_PRIVATE 0x04
-#define CLOUDABI_MAP_SHARED 0x08
+#define CLOUDABI_MAP_SHARED 0x08
typedef uint8_t cloudabi_mprot_t;
-#define CLOUDABI_PROT_EXEC 0x01
+#define CLOUDABI_PROT_EXEC 0x01
#define CLOUDABI_PROT_WRITE 0x02
-#define CLOUDABI_PROT_READ 0x04
+#define CLOUDABI_PROT_READ 0x04
typedef uint8_t cloudabi_msflags_t;
-#define CLOUDABI_MS_ASYNC 0x01
+#define CLOUDABI_MS_ASYNC 0x01
#define CLOUDABI_MS_INVALIDATE 0x02
-#define CLOUDABI_MS_SYNC 0x04
+#define CLOUDABI_MS_SYNC 0x04
typedef uint16_t cloudabi_msgflags_t;
-#define CLOUDABI_MSG_CTRUNC 0x0001
-#define CLOUDABI_MSG_EOR 0x0002
-#define CLOUDABI_MSG_PEEK 0x0004
-#define CLOUDABI_MSG_TRUNC 0x0008
+#define CLOUDABI_MSG_CTRUNC 0x0001
+#define CLOUDABI_MSG_EOR 0x0002
+#define CLOUDABI_MSG_PEEK 0x0004
+#define CLOUDABI_MSG_TRUNC 0x0008
#define CLOUDABI_MSG_WAITALL 0x0010
typedef uint32_t cloudabi_nthreads_t;
typedef uint16_t cloudabi_oflags_t;
-#define CLOUDABI_O_CREAT 0x0001
+#define CLOUDABI_O_CREAT 0x0001
#define CLOUDABI_O_DIRECTORY 0x0002
-#define CLOUDABI_O_EXCL 0x0004
-#define CLOUDABI_O_TRUNC 0x0008
+#define CLOUDABI_O_EXCL 0x0004
+#define CLOUDABI_O_TRUNC 0x0008
typedef uint64_t cloudabi_rights_t;
-#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001
-#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002
-#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004
-#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008
-#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010
-#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020
-#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040
-#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080
-#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100
-#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200
-#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400
-#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800
-#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000
-#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000
-#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000
-#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000
-#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000
-#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000
-#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000
-#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000
-#define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE 0x0000000000100000
-#define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES 0x0000000000200000
-#define CLOUDABI_RIGHT_FILE_STAT_GET 0x0000000000400000
-#define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES 0x0000000000800000
-#define CLOUDABI_RIGHT_FILE_SYMLINK 0x0000000001000000
-#define CLOUDABI_RIGHT_FILE_UNLINK 0x0000000002000000
-#define CLOUDABI_RIGHT_MEM_MAP 0x0000000004000000
-#define CLOUDABI_RIGHT_MEM_MAP_EXEC 0x0000000008000000
-#define CLOUDABI_RIGHT_POLL_FD_READWRITE 0x0000000010000000
-#define CLOUDABI_RIGHT_POLL_MODIFY 0x0000000020000000
-#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000
-#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000
-#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000
-#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000
-#define CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY 0x0000000400000000
-#define CLOUDABI_RIGHT_SOCK_BIND_SOCKET 0x0000000800000000
+#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001
+#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002
+#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004
+#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008
+#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010
+#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020
+#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040
+#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080
+#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100
+#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200
+#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400
+#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800
+#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000
+#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000
+#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000
+#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000
+#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000
+#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000
+#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000
+#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000
+#define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE 0x0000000000100000
+#define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES 0x0000000000200000
+#define CLOUDABI_RIGHT_FILE_STAT_GET 0x0000000000400000
+#define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES 0x0000000000800000
+#define CLOUDABI_RIGHT_FILE_SYMLINK 0x0000000001000000
+#define CLOUDABI_RIGHT_FILE_UNLINK 0x0000000002000000
+#define CLOUDABI_RIGHT_MEM_MAP 0x0000000004000000
+#define CLOUDABI_RIGHT_MEM_MAP_EXEC 0x0000000008000000
+#define CLOUDABI_RIGHT_POLL_FD_READWRITE 0x0000000010000000
+#define CLOUDABI_RIGHT_POLL_MODIFY 0x0000000020000000
+#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000
+#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000
+#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000
+#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000
+#define CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY 0x0000000400000000
+#define CLOUDABI_RIGHT_SOCK_BIND_SOCKET 0x0000000800000000
#define CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY 0x0000001000000000
-#define CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET 0x0000002000000000
-#define CLOUDABI_RIGHT_SOCK_LISTEN 0x0000004000000000
-#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000
-#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000
+#define CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET 0x0000002000000000
+#define CLOUDABI_RIGHT_SOCK_LISTEN 0x0000004000000000
+#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000
+#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000
typedef uint8_t cloudabi_sa_family_t;
#define CLOUDABI_AF_UNSPEC 0
-#define CLOUDABI_AF_INET 1
-#define CLOUDABI_AF_INET6 2
-#define CLOUDABI_AF_UNIX 3
+#define CLOUDABI_AF_INET 1
+#define CLOUDABI_AF_INET6 2
+#define CLOUDABI_AF_UNIX 3
typedef uint8_t cloudabi_scope_t;
#define CLOUDABI_SCOPE_PRIVATE 4
-#define CLOUDABI_SCOPE_SHARED 8
+#define CLOUDABI_SCOPE_SHARED 8
typedef uint8_t cloudabi_sdflags_t;
#define CLOUDABI_SHUT_RD 0x01
#define CLOUDABI_SHUT_WR 0x02
typedef uint8_t cloudabi_signal_t;
-#define CLOUDABI_SIGABRT 1
-#define CLOUDABI_SIGALRM 2
-#define CLOUDABI_SIGBUS 3
-#define CLOUDABI_SIGCHLD 4
-#define CLOUDABI_SIGCONT 5
-#define CLOUDABI_SIGFPE 6
-#define CLOUDABI_SIGHUP 7
-#define CLOUDABI_SIGILL 8
-#define CLOUDABI_SIGINT 9
-#define CLOUDABI_SIGKILL 10
-#define CLOUDABI_SIGPIPE 11
-#define CLOUDABI_SIGQUIT 12
-#define CLOUDABI_SIGSEGV 13
-#define CLOUDABI_SIGSTOP 14
-#define CLOUDABI_SIGSYS 15
-#define CLOUDABI_SIGTERM 16
-#define CLOUDABI_SIGTRAP 17
-#define CLOUDABI_SIGTSTP 18
-#define CLOUDABI_SIGTTIN 19
-#define CLOUDABI_SIGTTOU 20
-#define CLOUDABI_SIGURG 21
-#define CLOUDABI_SIGUSR1 22
-#define CLOUDABI_SIGUSR2 23
+#define CLOUDABI_SIGABRT 1
+#define CLOUDABI_SIGALRM 2
+#define CLOUDABI_SIGBUS 3
+#define CLOUDABI_SIGCHLD 4
+#define CLOUDABI_SIGCONT 5
+#define CLOUDABI_SIGFPE 6
+#define CLOUDABI_SIGHUP 7
+#define CLOUDABI_SIGILL 8
+#define CLOUDABI_SIGINT 9
+#define CLOUDABI_SIGKILL 10
+#define CLOUDABI_SIGPIPE 11
+#define CLOUDABI_SIGQUIT 12
+#define CLOUDABI_SIGSEGV 13
+#define CLOUDABI_SIGSTOP 14
+#define CLOUDABI_SIGSYS 15
+#define CLOUDABI_SIGTERM 16
+#define CLOUDABI_SIGTRAP 17
+#define CLOUDABI_SIGTSTP 18
+#define CLOUDABI_SIGTTIN 19
+#define CLOUDABI_SIGTTOU 20
+#define CLOUDABI_SIGURG 21
+#define CLOUDABI_SIGUSR1 22
+#define CLOUDABI_SIGUSR2 23
#define CLOUDABI_SIGVTALRM 24
-#define CLOUDABI_SIGXCPU 25
-#define CLOUDABI_SIGXFSZ 26
+#define CLOUDABI_SIGXCPU 25
+#define CLOUDABI_SIGXFSZ 26
typedef uint8_t cloudabi_ssflags_t;
#define CLOUDABI_SOCKSTAT_CLEAR_ERROR 0x01
@@ -347,11 +347,11 @@ typedef uint16_t cloudabi_subclockflags_t;
#define CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME 0x0001
typedef uint16_t cloudabi_subflags_t;
-#define CLOUDABI_SUBSCRIPTION_ADD 0x0001
-#define CLOUDABI_SUBSCRIPTION_CLEAR 0x0002
-#define CLOUDABI_SUBSCRIPTION_DELETE 0x0004
+#define CLOUDABI_SUBSCRIPTION_ADD 0x0001
+#define CLOUDABI_SUBSCRIPTION_CLEAR 0x0002
+#define CLOUDABI_SUBSCRIPTION_DELETE 0x0004
#define CLOUDABI_SUBSCRIPTION_DISABLE 0x0008
-#define CLOUDABI_SUBSCRIPTION_ENABLE 0x0010
+#define CLOUDABI_SUBSCRIPTION_ENABLE 0x0010
#define CLOUDABI_SUBSCRIPTION_ONESHOT 0x0020
typedef uint16_t cloudabi_subrwflags_t;
@@ -390,13 +390,10 @@ typedef struct {
_Alignas(8) cloudabi_rights_t fs_rights_base;
_Alignas(8) cloudabi_rights_t fs_rights_inheriting;
} cloudabi_fdstat_t;
-_Static_assert(offsetof(cloudabi_fdstat_t, fs_filetype) == 0,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi_fdstat_t, fs_filetype) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_fdstat_t, fs_flags) == 2, "Incorrect layout");
-_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_base) == 8,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_inheriting) == 16,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_base) == 8, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_inheriting) == 16, "Incorrect layout");
_Static_assert(sizeof(cloudabi_fdstat_t) == 24, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_fdstat_t) == 8, "Incorrect layout");
@@ -412,18 +409,12 @@ typedef struct {
} cloudabi_filestat_t;
_Static_assert(offsetof(cloudabi_filestat_t, st_dev) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_filestat_t, st_ino) == 8, "Incorrect layout");
-_Static_assert(offsetof(cloudabi_filestat_t, st_filetype) == 16,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_filestat_t, st_nlink) == 20,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_filestat_t, st_size) == 24,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_filestat_t, st_atim) == 32,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_filestat_t, st_mtim) == 40,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_filestat_t, st_ctim) == 48,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi_filestat_t, st_filetype) == 16, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_filestat_t, st_nlink) == 20, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_filestat_t, st_size) == 24, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_filestat_t, st_atim) == 32, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_filestat_t, st_mtim) == 40, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_filestat_t, st_ctim) == 48, "Incorrect layout");
_Static_assert(sizeof(cloudabi_filestat_t) == 56, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_filestat_t) == 8, "Incorrect layout");
@@ -449,16 +440,11 @@ typedef struct {
} sa_inet6;
};
} cloudabi_sockaddr_t;
-_Static_assert(offsetof(cloudabi_sockaddr_t, sa_family) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.addr) == 2,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.port) == 6,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.addr) == 2,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.port) == 18,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockaddr_t, sa_family) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.addr) == 2, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.port) == 6, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.addr) == 2, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.port) == 18, "Incorrect layout");
_Static_assert(sizeof(cloudabi_sockaddr_t) == 20, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_sockaddr_t) == 2, "Incorrect layout");
@@ -468,14 +454,10 @@ typedef struct {
_Alignas(2) cloudabi_errno_t ss_error;
_Alignas(4) cloudabi_sstate_t ss_state;
} cloudabi_sockstat_t;
-_Static_assert(offsetof(cloudabi_sockstat_t, ss_sockname) == 0,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockstat_t, ss_peername) == 20,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40,
- "Incorrect layout");
-_Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44,
- "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockstat_t, ss_sockname) == 0, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockstat_t, ss_peername) == 20, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40, "Incorrect layout");
+_Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44, "Incorrect layout");
_Static_assert(sizeof(cloudabi_sockstat_t) == 48, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_sockstat_t) == 4, "Incorrect layout");
diff --git a/sys/contrib/cloudabi/syscalls32.master b/sys/contrib/cloudabi/syscalls32.master
index aa3314b8fa70..4e0c2b293249 100644
--- a/sys/contrib/cloudabi/syscalls32.master
+++ b/sys/contrib/cloudabi/syscalls32.master
@@ -65,20 +65,20 @@
8 AUE_NULL STD { size_t cloudabi32_sys_fd_pread( \
cloudabi_fd_t fd, \
- const cloudabi32_iovec_t *iov, \
- size_t iovcnt, \
+ const cloudabi32_iovec_t *iovs, \
+ size_t iovs_len, \
cloudabi_filesize_t offset); }
9 AUE_NULL STD { size_t cloudabi32_sys_fd_pwrite( \
cloudabi_fd_t fd, \
- const cloudabi32_ciovec_t *iov, \
- size_t iovcnt, \
+ const cloudabi32_ciovec_t *iovs, \
+ size_t iovs_len, \
cloudabi_filesize_t offset); }
10 AUE_NULL STD { size_t cloudabi32_sys_fd_read( \
cloudabi_fd_t fd, \
- const cloudabi32_iovec_t *iov, \
- size_t iovcnt); }
+ const cloudabi32_iovec_t *iovs, \
+ size_t iovs_len); }
11 AUE_NULL STD { void cloudabi_sys_fd_replace( \
cloudabi_fd_t from, \
@@ -104,8 +104,8 @@
16 AUE_NULL STD { size_t cloudabi32_sys_fd_write( \
cloudabi_fd_t fd, \
- const cloudabi32_ciovec_t *iov, \
- size_t iovcnt); }
+ const cloudabi32_ciovec_t *iovs, \
+ size_t iovs_len); }
17 AUE_NULL STD { void cloudabi_sys_file_advise( \
cloudabi_fd_t fd, \
@@ -121,44 +121,44 @@
19 AUE_NULL STD { void cloudabi_sys_file_create( \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_filetype_t type); }
20 AUE_NULL STD { void cloudabi_sys_file_link( \
cloudabi_lookup_t fd1, \
const char *path1, \
- size_t path1len, \
+ size_t path1_len, \
cloudabi_fd_t fd2, \
const char *path2, \
- size_t path2len); }
+ size_t path2_len); }
21 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_file_open( \
cloudabi_lookup_t dirfd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_oflags_t oflags, \
const cloudabi_fdstat_t *fds); }
22 AUE_NULL STD { size_t cloudabi_sys_file_readdir( \
cloudabi_fd_t fd, \
void *buf, \
- size_t nbyte, \
+ size_t buf_len, \
cloudabi_dircookie_t cookie); }
23 AUE_NULL STD { size_t cloudabi_sys_file_readlink( \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
char *buf, \
- size_t bufsize); }
+ size_t buf_len); }
24 AUE_NULL STD { void cloudabi_sys_file_rename( \
- cloudabi_fd_t oldfd, \
- const char *old, \
- size_t oldlen, \
- cloudabi_fd_t newfd, \
- const char *new, \
- size_t newlen); }
+ cloudabi_fd_t fd1, \
+ const char *path1, \
+ size_t path1_len, \
+ cloudabi_fd_t fd2, \
+ const char *path2, \
+ size_t path2_len); }
25 AUE_NULL STD { void cloudabi_sys_file_stat_fget( \
cloudabi_fd_t fd, \
@@ -172,27 +172,27 @@
27 AUE_NULL STD { void cloudabi_sys_file_stat_get( \
cloudabi_lookup_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_filestat_t *buf); }
28 AUE_NULL STD { void cloudabi_sys_file_stat_put( \
cloudabi_lookup_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
const cloudabi_filestat_t *buf, \
cloudabi_fsflags_t flags); }
29 AUE_NULL STD { void cloudabi_sys_file_symlink( \
const char *path1, \
- size_t path1len, \
+ size_t path1_len, \
cloudabi_fd_t fd, \
const char *path2, \
- size_t path2len); }
+ size_t path2_len); }
30 AUE_NULL STD { void cloudabi_sys_file_unlink( \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_ulflags_t flags); }
31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \
@@ -200,13 +200,13 @@
cloudabi_scope_t scope); }
32 AUE_NULL STD { void cloudabi_sys_mem_advise( \
- void *addr, \
- size_t len, \
+ void *mapping, \
+ size_t mapping_len, \
cloudabi_advice_t advice); }
33 AUE_NULL STD { void cloudabi_sys_mem_lock( \
- const void *addr, \
- size_t len); }
+ const void *mapping, \
+ size_t mapping_len); }
34 AUE_NULL STD { void cloudabi_sys_mem_map( \
void *addr, \
@@ -217,22 +217,22 @@
cloudabi_filesize_t off); }
35 AUE_NULL STD { void cloudabi_sys_mem_protect( \
- void *addr, \
- size_t len, \
+ void *mapping, \
+ size_t mapping_len, \
cloudabi_mprot_t prot); }
36 AUE_NULL STD { void cloudabi_sys_mem_sync( \
- void *addr, \
- size_t len, \
+ void *mapping, \
+ size_t mapping_len, \
cloudabi_msflags_t flags); }
37 AUE_NULL STD { void cloudabi_sys_mem_unlock( \
- const void *addr, \
- size_t len); }
+ const void *mapping, \
+ size_t mapping_len); }
38 AUE_NULL STD { void cloudabi_sys_mem_unmap( \
- void *addr, \
- size_t len); }
+ void *mapping, \
+ size_t mapping_len); }
39 AUE_NULL STD { size_t cloudabi32_sys_poll( \
const cloudabi32_subscription_t *in, \
@@ -242,17 +242,17 @@
40 AUE_NULL STD { size_t cloudabi32_sys_poll_fd( \
cloudabi_fd_t fd, \
const cloudabi32_subscription_t *in, \
- size_t nin, \
+ size_t in_len, \
cloudabi32_event_t *out, \
- size_t nout, \
+ size_t out_len, \
const cloudabi32_subscription_t *timeout); }
41 AUE_NULL STD { void cloudabi_sys_proc_exec( \
cloudabi_fd_t fd, \
const void *data, \
- size_t datalen, \
+ size_t data_len, \
const cloudabi_fd_t *fds, \
- size_t fdslen); }
+ size_t fds_len); }
42 AUE_NULL STD { void cloudabi_sys_proc_exit( \
cloudabi_exitcode_t rval); }
@@ -264,7 +264,7 @@
45 AUE_NULL STD { void cloudabi_sys_random_get( \
void *buf, \
- size_t nbyte); }
+ size_t buf_len); }
46 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
cloudabi_fd_t sock, \
@@ -274,13 +274,13 @@
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen); }
+ size_t path_len); }
48 AUE_NULL STD { void cloudabi_sys_sock_connect( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen); }
+ size_t path_len); }
49 AUE_NULL STD { void cloudabi_sys_sock_listen( \
cloudabi_fd_t sock, \
diff --git a/sys/contrib/cloudabi/syscalls64.master b/sys/contrib/cloudabi/syscalls64.master
index b2378bdb9fe5..7f57d76ce878 100644
--- a/sys/contrib/cloudabi/syscalls64.master
+++ b/sys/contrib/cloudabi/syscalls64.master
@@ -65,20 +65,20 @@
8 AUE_NULL STD { size_t cloudabi64_sys_fd_pread( \
cloudabi_fd_t fd, \
- const cloudabi64_iovec_t *iov, \
- size_t iovcnt, \
+ const cloudabi64_iovec_t *iovs, \
+ size_t iovs_len, \
cloudabi_filesize_t offset); }
9 AUE_NULL STD { size_t cloudabi64_sys_fd_pwrite( \
cloudabi_fd_t fd, \
- const cloudabi64_ciovec_t *iov, \
- size_t iovcnt, \
+ const cloudabi64_ciovec_t *iovs, \
+ size_t iovs_len, \
cloudabi_filesize_t offset); }
10 AUE_NULL STD { size_t cloudabi64_sys_fd_read( \
cloudabi_fd_t fd, \
- const cloudabi64_iovec_t *iov, \
- size_t iovcnt); }
+ const cloudabi64_iovec_t *iovs, \
+ size_t iovs_len); }
11 AUE_NULL STD { void cloudabi_sys_fd_replace( \
cloudabi_fd_t from, \
@@ -104,8 +104,8 @@
16 AUE_NULL STD { size_t cloudabi64_sys_fd_write( \
cloudabi_fd_t fd, \
- const cloudabi64_ciovec_t *iov, \
- size_t iovcnt); }
+ const cloudabi64_ciovec_t *iovs, \
+ size_t iovs_len); }
17 AUE_NULL STD { void cloudabi_sys_file_advise( \
cloudabi_fd_t fd, \
@@ -121,44 +121,44 @@
19 AUE_NULL STD { void cloudabi_sys_file_create( \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_filetype_t type); }
20 AUE_NULL STD { void cloudabi_sys_file_link( \
cloudabi_lookup_t fd1, \
const char *path1, \
- size_t path1len, \
+ size_t path1_len, \
cloudabi_fd_t fd2, \
const char *path2, \
- size_t path2len); }
+ size_t path2_len); }
21 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_file_open( \
cloudabi_lookup_t dirfd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_oflags_t oflags, \
const cloudabi_fdstat_t *fds); }
22 AUE_NULL STD { size_t cloudabi_sys_file_readdir( \
cloudabi_fd_t fd, \
void *buf, \
- size_t nbyte, \
+ size_t buf_len, \
cloudabi_dircookie_t cookie); }
23 AUE_NULL STD { size_t cloudabi_sys_file_readlink( \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
char *buf, \
- size_t bufsize); }
+ size_t buf_len); }
24 AUE_NULL STD { void cloudabi_sys_file_rename( \
- cloudabi_fd_t oldfd, \
- const char *old, \
- size_t oldlen, \
- cloudabi_fd_t newfd, \
- const char *new, \
- size_t newlen); }
+ cloudabi_fd_t fd1, \
+ const char *path1, \
+ size_t path1_len, \
+ cloudabi_fd_t fd2, \
+ const char *path2, \
+ size_t path2_len); }
25 AUE_NULL STD { void cloudabi_sys_file_stat_fget( \
cloudabi_fd_t fd, \
@@ -172,27 +172,27 @@
27 AUE_NULL STD { void cloudabi_sys_file_stat_get( \
cloudabi_lookup_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_filestat_t *buf); }
28 AUE_NULL STD { void cloudabi_sys_file_stat_put( \
cloudabi_lookup_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
const cloudabi_filestat_t *buf, \
cloudabi_fsflags_t flags); }
29 AUE_NULL STD { void cloudabi_sys_file_symlink( \
const char *path1, \
- size_t path1len, \
+ size_t path1_len, \
cloudabi_fd_t fd, \
const char *path2, \
- size_t path2len); }
+ size_t path2_len); }
30 AUE_NULL STD { void cloudabi_sys_file_unlink( \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen, \
+ size_t path_len, \
cloudabi_ulflags_t flags); }
31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \
@@ -200,13 +200,13 @@
cloudabi_scope_t scope); }
32 AUE_NULL STD { void cloudabi_sys_mem_advise( \
- void *addr, \
- size_t len, \
+ void *mapping, \
+ size_t mapping_len, \
cloudabi_advice_t advice); }
33 AUE_NULL STD { void cloudabi_sys_mem_lock( \
- const void *addr, \
- size_t len); }
+ const void *mapping, \
+ size_t mapping_len); }
34 AUE_NULL STD { void cloudabi_sys_mem_map( \
void *addr, \
@@ -217,22 +217,22 @@
cloudabi_filesize_t off); }
35 AUE_NULL STD { void cloudabi_sys_mem_protect( \
- void *addr, \
- size_t len, \
+ void *mapping, \
+ size_t mapping_len, \
cloudabi_mprot_t prot); }
36 AUE_NULL STD { void cloudabi_sys_mem_sync( \
- void *addr, \
- size_t len, \
+ void *mapping, \
+ size_t mapping_len, \
cloudabi_msflags_t flags); }
37 AUE_NULL STD { void cloudabi_sys_mem_unlock( \
- const void *addr, \
- size_t len); }
+ const void *mapping, \
+ size_t mapping_len); }
38 AUE_NULL STD { void cloudabi_sys_mem_unmap( \
- void *addr, \
- size_t len); }
+ void *mapping, \
+ size_t mapping_len); }
39 AUE_NULL STD { size_t cloudabi64_sys_poll( \
const cloudabi64_subscription_t *in, \
@@ -242,17 +242,17 @@
40 AUE_NULL STD { size_t cloudabi64_sys_poll_fd( \
cloudabi_fd_t fd, \
const cloudabi64_subscription_t *in, \
- size_t nin, \
+ size_t in_len, \
cloudabi64_event_t *out, \
- size_t nout, \
+ size_t out_len, \
const cloudabi64_subscription_t *timeout); }
41 AUE_NULL STD { void cloudabi_sys_proc_exec( \
cloudabi_fd_t fd, \
const void *data, \
- size_t datalen, \
+ size_t data_len, \
const cloudabi_fd_t *fds, \
- size_t fdslen); }
+ size_t fds_len); }
42 AUE_NULL STD { void cloudabi_sys_proc_exit( \
cloudabi_exitcode_t rval); }
@@ -264,7 +264,7 @@
45 AUE_NULL STD { void cloudabi_sys_random_get( \
void *buf, \
- size_t nbyte); }
+ size_t buf_len); }
46 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
cloudabi_fd_t sock, \
@@ -274,13 +274,13 @@
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen); }
+ size_t path_len); }
48 AUE_NULL STD { void cloudabi_sys_sock_connect( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
- size_t pathlen); }
+ size_t path_len); }
49 AUE_NULL STD { void cloudabi_sys_sock_listen( \
cloudabi_fd_t sock, \
diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt
index ee16343813b0..4e0d69e57467 100644
--- a/sys/contrib/dev/acpica/changes.txt
+++ b/sys/contrib/dev/acpica/changes.txt
@@ -1,4 +1,39 @@
----------------------------------------
+19 January 2017. Summary of changes for version 20170119:
+
+This release is available at https://acpica.org/downloads
+
+1) General ACPICA software:
+
+Entire source code base: Added the 2017 copyright to all source code
+legal/licensing module headers and utility/tool signons. This includes
+the standard Linux dual-license header. This affects virtually every file
+in the ACPICA core subsystem, iASL compiler, all ACPICA utilities, and
+the ACPICA test suite.
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Removed/fixed an inadvertent remark when a method argument
+containing a reference is used as a target operand within the method (and
+never used as a simple argument), as in the example below. Jeffrey Hugo.
+
+ dsdt.asl 1507: Store(0x1, Arg0)
+ Remark 2146 - ^ Method Argument is never used (Arg0)
+
+All tools: Removed the bit width of the compiler that generated the tool
+from the common signon for all user space tools. This proved to be
+confusing and unnecessary. This includes similar removal of HARDWARE_NAME
+from the generic makefiles (Thomas Petazzoni). Example below.
+
+ Old:
+ ASL+ Optimizing Compiler version 20170119-32
+ ASL+ Optimizing Compiler version 20170119-64
+
+ New:
+ ASL+ Optimizing Compiler version 20170119
+
+----------------------------------------
22 December 2016. Summary of changes for version 20161222:
diff --git a/sys/contrib/dev/acpica/common/acfileio.c b/sys/contrib/dev/acpica/common/acfileio.c
index b58945328e75..431eeef6bdd1 100644
--- a/sys/contrib/dev/acpica/common/acfileio.c
+++ b/sys/contrib/dev/acpica/common/acfileio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/acgetline.c b/sys/contrib/dev/acpica/common/acgetline.c
index 98b3679e2e96..a5ea1494965b 100644
--- a/sys/contrib/dev/acpica/common/acgetline.c
+++ b/sys/contrib/dev/acpica/common/acgetline.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/adfile.c b/sys/contrib/dev/acpica/common/adfile.c
index 8cd353f8f72d..e48345682d1b 100644
--- a/sys/contrib/dev/acpica/common/adfile.c
+++ b/sys/contrib/dev/acpica/common/adfile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/adisasm.c b/sys/contrib/dev/acpica/common/adisasm.c
index fcc3923fe57e..38551e5aa0bf 100644
--- a/sys/contrib/dev/acpica/common/adisasm.c
+++ b/sys/contrib/dev/acpica/common/adisasm.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/adwalk.c b/sys/contrib/dev/acpica/common/adwalk.c
index dcf39897fca3..90460a8fe65a 100644
--- a/sys/contrib/dev/acpica/common/adwalk.c
+++ b/sys/contrib/dev/acpica/common/adwalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/ahids.c b/sys/contrib/dev/acpica/common/ahids.c
index aa12bc83513c..d5c98b555ece 100644
--- a/sys/contrib/dev/acpica/common/ahids.c
+++ b/sys/contrib/dev/acpica/common/ahids.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/ahpredef.c b/sys/contrib/dev/acpica/common/ahpredef.c
index 96bcbc8436c7..7790ace33feb 100644
--- a/sys/contrib/dev/acpica/common/ahpredef.c
+++ b/sys/contrib/dev/acpica/common/ahpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/ahtable.c b/sys/contrib/dev/acpica/common/ahtable.c
index 050ee6b4d3a2..bbdc6b50921b 100644
--- a/sys/contrib/dev/acpica/common/ahtable.c
+++ b/sys/contrib/dev/acpica/common/ahtable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c
index e18e9b9beb18..18f5e0dd7485 100644
--- a/sys/contrib/dev/acpica/common/ahuuids.c
+++ b/sys/contrib/dev/acpica/common/ahuuids.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/cmfsize.c b/sys/contrib/dev/acpica/common/cmfsize.c
index f4e8ac7966ec..700000195d29 100644
--- a/sys/contrib/dev/acpica/common/cmfsize.c
+++ b/sys/contrib/dev/acpica/common/cmfsize.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/dmextern.c b/sys/contrib/dev/acpica/common/dmextern.c
index 0b1805871ce5..493b9ab57a58 100644
--- a/sys/contrib/dev/acpica/common/dmextern.c
+++ b/sys/contrib/dev/acpica/common/dmextern.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/dmrestag.c b/sys/contrib/dev/acpica/common/dmrestag.c
index 337456e3de43..2c8f980a046f 100644
--- a/sys/contrib/dev/acpica/common/dmrestag.c
+++ b/sys/contrib/dev/acpica/common/dmrestag.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c
index 4ec52db71e41..ad08db0dc8e1 100644
--- a/sys/contrib/dev/acpica/common/dmtable.c
+++ b/sys/contrib/dev/acpica/common/dmtable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/dmtables.c b/sys/contrib/dev/acpica/common/dmtables.c
index 258182311b1d..c1a0ac143106 100644
--- a/sys/contrib/dev/acpica/common/dmtables.c
+++ b/sys/contrib/dev/acpica/common/dmtables.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c
index d79658fc1568..983d74791cd9 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo.c b/sys/contrib/dev/acpica/common/dmtbinfo.c
index c1145bdca84c..9135a3a6e152 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/common/getopt.c b/sys/contrib/dev/acpica/common/getopt.c
index f59269a021e8..ee9e0b094ee0 100644
--- a/sys/contrib/dev/acpica/common/getopt.c
+++ b/sys/contrib/dev/acpica/common/getopt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c
index 882378359b43..b5024156345d 100644
--- a/sys/contrib/dev/acpica/compiler/aslanalyze.c
+++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslascii.c b/sys/contrib/dev/acpica/compiler/aslascii.c
index e2166d84a331..1f8bc1bde517 100644
--- a/sys/contrib/dev/acpica/compiler/aslascii.c
+++ b/sys/contrib/dev/acpica/compiler/aslascii.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslbtypes.c b/sys/contrib/dev/acpica/compiler/aslbtypes.c
index cd40f20bfae2..5c2a8758985e 100644
--- a/sys/contrib/dev/acpica/compiler/aslbtypes.c
+++ b/sys/contrib/dev/acpica/compiler/aslbtypes.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c
index cf1f170de7f5..65b9ac2b3b5b 100644
--- a/sys/contrib/dev/acpica/compiler/aslcodegen.c
+++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c
index 3dbd0f62ef7e..cffebe2bef77 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompile.c
+++ b/sys/contrib/dev/acpica/compiler/aslcompile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.h b/sys/contrib/dev/acpica/compiler/aslcompiler.h
index 200cc0236032..7d21c8b8bfd9 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l
index cd259d76869c..8f2c1fbc65ee 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.l
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslcstyle.y b/sys/contrib/dev/acpica/compiler/aslcstyle.y
index d4034a5f2e43..3cba5f56399f 100644
--- a/sys/contrib/dev/acpica/compiler/aslcstyle.y
+++ b/sys/contrib/dev/acpica/compiler/aslcstyle.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asldebug.c b/sys/contrib/dev/acpica/compiler/asldebug.c
index 0fa8c0a8d1fa..e01e5705e05e 100644
--- a/sys/contrib/dev/acpica/compiler/asldebug.c
+++ b/sys/contrib/dev/acpica/compiler/asldebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asldefine.h b/sys/contrib/dev/acpica/compiler/asldefine.h
index f615cb219536..94ee7c88f819 100644
--- a/sys/contrib/dev/acpica/compiler/asldefine.h
+++ b/sys/contrib/dev/acpica/compiler/asldefine.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,7 @@
/*
* Compiler versions and names
*/
-#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler"
+#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler/Disassembler"
#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
#define ASL_INVOCATION_NAME "iasl"
#define ASL_CREATOR_ID "INTL"
diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c
index f71d56acca63..fd6bb25a0813 100644
--- a/sys/contrib/dev/acpica/compiler/aslerror.c
+++ b/sys/contrib/dev/acpica/compiler/aslerror.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslexternal.c b/sys/contrib/dev/acpica/compiler/aslexternal.c
index 81e217134c61..bed9079971c1 100644
--- a/sys/contrib/dev/acpica/compiler/aslexternal.c
+++ b/sys/contrib/dev/acpica/compiler/aslexternal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslfileio.c b/sys/contrib/dev/acpica/compiler/aslfileio.c
index f1c664fcba57..e79975ebb8d2 100644
--- a/sys/contrib/dev/acpica/compiler/aslfileio.c
+++ b/sys/contrib/dev/acpica/compiler/aslfileio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslfiles.c b/sys/contrib/dev/acpica/compiler/aslfiles.c
index fc2eaaac7468..81cd93d94379 100644
--- a/sys/contrib/dev/acpica/compiler/aslfiles.c
+++ b/sys/contrib/dev/acpica/compiler/aslfiles.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslfold.c b/sys/contrib/dev/acpica/compiler/aslfold.c
index 78a1a60fe6a9..1a79698d7ca9 100644
--- a/sys/contrib/dev/acpica/compiler/aslfold.c
+++ b/sys/contrib/dev/acpica/compiler/aslfold.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslglobal.h b/sys/contrib/dev/acpica/compiler/aslglobal.h
index 6f35c248ec43..c2f4d61bc798 100644
--- a/sys/contrib/dev/acpica/compiler/aslglobal.h
+++ b/sys/contrib/dev/acpica/compiler/aslglobal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslhelp.c b/sys/contrib/dev/acpica/compiler/aslhelp.c
index fb2059c19910..88060445c630 100644
--- a/sys/contrib/dev/acpica/compiler/aslhelp.c
+++ b/sys/contrib/dev/acpica/compiler/aslhelp.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslhelpers.y b/sys/contrib/dev/acpica/compiler/aslhelpers.y
index f3a94de9c4cd..e0f3e89ef5dd 100644
--- a/sys/contrib/dev/acpica/compiler/aslhelpers.y
+++ b/sys/contrib/dev/acpica/compiler/aslhelpers.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslhex.c b/sys/contrib/dev/acpica/compiler/aslhex.c
index fd809254d00d..2483ec8ae210 100644
--- a/sys/contrib/dev/acpica/compiler/aslhex.c
+++ b/sys/contrib/dev/acpica/compiler/aslhex.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslkeywords.y b/sys/contrib/dev/acpica/compiler/aslkeywords.y
index c908ae401c52..57e6d4ec1aba 100644
--- a/sys/contrib/dev/acpica/compiler/aslkeywords.y
+++ b/sys/contrib/dev/acpica/compiler/aslkeywords.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asllength.c b/sys/contrib/dev/acpica/compiler/asllength.c
index 2c57794d5ee5..6470867646e7 100644
--- a/sys/contrib/dev/acpica/compiler/asllength.c
+++ b/sys/contrib/dev/acpica/compiler/asllength.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asllisting.c b/sys/contrib/dev/acpica/compiler/asllisting.c
index 45ab1e22bdb3..378788347820 100644
--- a/sys/contrib/dev/acpica/compiler/asllisting.c
+++ b/sys/contrib/dev/acpica/compiler/asllisting.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asllistsup.c b/sys/contrib/dev/acpica/compiler/asllistsup.c
index 754f8c997aea..4b6d07251541 100644
--- a/sys/contrib/dev/acpica/compiler/asllistsup.c
+++ b/sys/contrib/dev/acpica/compiler/asllistsup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslload.c b/sys/contrib/dev/acpica/compiler/aslload.c
index f14e01d77ba0..6f812a281f89 100644
--- a/sys/contrib/dev/acpica/compiler/aslload.c
+++ b/sys/contrib/dev/acpica/compiler/aslload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asllookup.c b/sys/contrib/dev/acpica/compiler/asllookup.c
index 3e216cc95149..90921741d0be 100644
--- a/sys/contrib/dev/acpica/compiler/asllookup.c
+++ b/sys/contrib/dev/acpica/compiler/asllookup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmain.c b/sys/contrib/dev/acpica/compiler/aslmain.c
index 0e8cda9ef479..2823aab07630 100644
--- a/sys/contrib/dev/acpica/compiler/aslmain.c
+++ b/sys/contrib/dev/acpica/compiler/aslmain.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmap.c b/sys/contrib/dev/acpica/compiler/aslmap.c
index e2133363a41c..20c887d10718 100644
--- a/sys/contrib/dev/acpica/compiler/aslmap.c
+++ b/sys/contrib/dev/acpica/compiler/aslmap.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmapenter.c b/sys/contrib/dev/acpica/compiler/aslmapenter.c
index 8aa66b7881e6..8590e558a866 100644
--- a/sys/contrib/dev/acpica/compiler/aslmapenter.c
+++ b/sys/contrib/dev/acpica/compiler/aslmapenter.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmapoutput.c b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
index c8cd54530e31..a44ec93a9c8b 100644
--- a/sys/contrib/dev/acpica/compiler/aslmapoutput.c
+++ b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmaputils.c b/sys/contrib/dev/acpica/compiler/aslmaputils.c
index 01185e6af1f2..c0c029c8a805 100644
--- a/sys/contrib/dev/acpica/compiler/aslmaputils.c
+++ b/sys/contrib/dev/acpica/compiler/aslmaputils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.c b/sys/contrib/dev/acpica/compiler/aslmessages.c
index 1545abad62ff..c2dbc89984d5 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.c
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.h b/sys/contrib/dev/acpica/compiler/aslmessages.h
index 0ee063fa5961..8d3978345cdd 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.h
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c
index b16982a5e5da..983e611741eb 100644
--- a/sys/contrib/dev/acpica/compiler/aslmethod.c
+++ b/sys/contrib/dev/acpica/compiler/aslmethod.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslnamesp.c b/sys/contrib/dev/acpica/compiler/aslnamesp.c
index f8149c51ee5e..ee8218a71edd 100644
--- a/sys/contrib/dev/acpica/compiler/aslnamesp.c
+++ b/sys/contrib/dev/acpica/compiler/aslnamesp.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asloffset.c b/sys/contrib/dev/acpica/compiler/asloffset.c
index bb57d35b3b85..1c12e7ba7141 100644
--- a/sys/contrib/dev/acpica/compiler/asloffset.c
+++ b/sys/contrib/dev/acpica/compiler/asloffset.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslopcodes.c b/sys/contrib/dev/acpica/compiler/aslopcodes.c
index 0d790a8d4988..063fe055da61 100644
--- a/sys/contrib/dev/acpica/compiler/aslopcodes.c
+++ b/sys/contrib/dev/acpica/compiler/aslopcodes.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asloperands.c b/sys/contrib/dev/acpica/compiler/asloperands.c
index 36a324f1ac21..f1685c3b73b0 100644
--- a/sys/contrib/dev/acpica/compiler/asloperands.c
+++ b/sys/contrib/dev/acpica/compiler/asloperands.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslopt.c b/sys/contrib/dev/acpica/compiler/aslopt.c
index 680e3fceee52..b6cbb29b986a 100644
--- a/sys/contrib/dev/acpica/compiler/aslopt.c
+++ b/sys/contrib/dev/acpica/compiler/aslopt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asloptions.c b/sys/contrib/dev/acpica/compiler/asloptions.c
index 5f86a149b4f6..f7499f505f67 100644
--- a/sys/contrib/dev/acpica/compiler/asloptions.c
+++ b/sys/contrib/dev/acpica/compiler/asloptions.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslparser.y b/sys/contrib/dev/acpica/compiler/aslparser.y
index 4c750fcda31b..abe26351be7c 100644
--- a/sys/contrib/dev/acpica/compiler/aslparser.y
+++ b/sys/contrib/dev/acpica/compiler/aslparser.y
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslpld.c b/sys/contrib/dev/acpica/compiler/aslpld.c
index 39f51e115a56..407d25eaf6b0 100644
--- a/sys/contrib/dev/acpica/compiler/aslpld.c
+++ b/sys/contrib/dev/acpica/compiler/aslpld.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c
index 673a4ba85e7b..64520a05b20f 100644
--- a/sys/contrib/dev/acpica/compiler/aslpredef.c
+++ b/sys/contrib/dev/acpica/compiler/aslpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslprepkg.c b/sys/contrib/dev/acpica/compiler/aslprepkg.c
index c70144a7600c..ebe71148bf57 100644
--- a/sys/contrib/dev/acpica/compiler/aslprepkg.c
+++ b/sys/contrib/dev/acpica/compiler/aslprepkg.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslprimaries.y b/sys/contrib/dev/acpica/compiler/aslprimaries.y
index b52bbcdc6718..eca3dfd71be0 100644
--- a/sys/contrib/dev/acpica/compiler/aslprimaries.y
+++ b/sys/contrib/dev/acpica/compiler/aslprimaries.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslprintf.c b/sys/contrib/dev/acpica/compiler/aslprintf.c
index 7ec3e10dabe6..39bd97826cd1 100644
--- a/sys/contrib/dev/acpica/compiler/aslprintf.c
+++ b/sys/contrib/dev/acpica/compiler/aslprintf.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslprune.c b/sys/contrib/dev/acpica/compiler/aslprune.c
index b3926216e601..ece9ad488004 100644
--- a/sys/contrib/dev/acpica/compiler/aslprune.c
+++ b/sys/contrib/dev/acpica/compiler/aslprune.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslresource.c b/sys/contrib/dev/acpica/compiler/aslresource.c
index cdeb1db249df..01c6b5f39bc2 100644
--- a/sys/contrib/dev/acpica/compiler/aslresource.c
+++ b/sys/contrib/dev/acpica/compiler/aslresource.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslresources.y b/sys/contrib/dev/acpica/compiler/aslresources.y
index 34ce47574bc8..3425bc0cb617 100644
--- a/sys/contrib/dev/acpica/compiler/aslresources.y
+++ b/sys/contrib/dev/acpica/compiler/aslresources.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1.c b/sys/contrib/dev/acpica/compiler/aslrestype1.c
index dbe88a814efe..0adf189b1117 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1i.c b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
index 7d9d6917544e..74a3c86ebf78 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1i.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2.c b/sys/contrib/dev/acpica/compiler/aslrestype2.c
index fd08cc16597e..00e2c7dc4af2 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2d.c b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
index a23e01e638fa..231983ecd777 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2d.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2e.c b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
index fc8563553556..7717bad9a8b9 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2e.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2q.c b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
index 65d225750098..eec822b72f6b 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2q.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2s.c b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
index 3b72f9011a50..54ff66eeaf9a 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2s.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2w.c b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
index f3b7757aa10a..59f0404d214b 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2w.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslrules.y b/sys/contrib/dev/acpica/compiler/aslrules.y
index 112f041878b0..6ef61e2673ee 100644
--- a/sys/contrib/dev/acpica/compiler/aslrules.y
+++ b/sys/contrib/dev/acpica/compiler/aslrules.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c
index cd3bb9489f50..72e9ff396b84 100644
--- a/sys/contrib/dev/acpica/compiler/aslstartup.c
+++ b/sys/contrib/dev/acpica/compiler/aslstartup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslstubs.c b/sys/contrib/dev/acpica/compiler/aslstubs.c
index cc9f27fc3bab..5b271bccd6ad 100644
--- a/sys/contrib/dev/acpica/compiler/aslstubs.c
+++ b/sys/contrib/dev/acpica/compiler/aslstubs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.l b/sys/contrib/dev/acpica/compiler/aslsupport.l
index deb9e9a31028..01b3e0c0b87d 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.l
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.y b/sys/contrib/dev/acpica/compiler/aslsupport.y
index cd2605b8367a..a6b167467c69 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.y
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asltokens.y b/sys/contrib/dev/acpica/compiler/asltokens.y
index 61213db0b66b..6a6771588de0 100644
--- a/sys/contrib/dev/acpica/compiler/asltokens.y
+++ b/sys/contrib/dev/acpica/compiler/asltokens.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asltransform.c b/sys/contrib/dev/acpica/compiler/asltransform.c
index cc87390ad626..3388faf22e93 100644
--- a/sys/contrib/dev/acpica/compiler/asltransform.c
+++ b/sys/contrib/dev/acpica/compiler/asltransform.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asltree.c b/sys/contrib/dev/acpica/compiler/asltree.c
index d2f128e2ff29..af13a0f229a1 100644
--- a/sys/contrib/dev/acpica/compiler/asltree.c
+++ b/sys/contrib/dev/acpica/compiler/asltree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.h b/sys/contrib/dev/acpica/compiler/asltypes.h
index 411faede483f..bd8376760ca0 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.h
+++ b/sys/contrib/dev/acpica/compiler/asltypes.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.y b/sys/contrib/dev/acpica/compiler/asltypes.y
index d463997bf6b4..36fec68c9e31 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.y
+++ b/sys/contrib/dev/acpica/compiler/asltypes.y
@@ -6,7 +6,7 @@ NoEcho('
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslutils.c b/sys/contrib/dev/acpica/compiler/aslutils.c
index 8941f8219e75..d93eef565132 100644
--- a/sys/contrib/dev/acpica/compiler/aslutils.c
+++ b/sys/contrib/dev/acpica/compiler/aslutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -381,8 +381,8 @@ UtDisplaySummary (
{
/* Compiler name and version number */
- FlPrintFile (FileId, "%s version %X%s\n\n",
- ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, ACPI_WIDTH);
+ FlPrintFile (FileId, "%s version %X\n\n",
+ ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION);
}
/* Summary of main input and output files */
diff --git a/sys/contrib/dev/acpica/compiler/asluuid.c b/sys/contrib/dev/acpica/compiler/asluuid.c
index a26fdfaa1d3e..9ed8872afda2 100644
--- a/sys/contrib/dev/acpica/compiler/asluuid.c
+++ b/sys/contrib/dev/acpica/compiler/asluuid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslwalks.c b/sys/contrib/dev/acpica/compiler/aslwalks.c
index be88bb21b93a..1c12304316dd 100644
--- a/sys/contrib/dev/acpica/compiler/aslwalks.c
+++ b/sys/contrib/dev/acpica/compiler/aslwalks.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslxref.c b/sys/contrib/dev/acpica/compiler/aslxref.c
index 6c0f0aec21b1..70482ff159b4 100644
--- a/sys/contrib/dev/acpica/compiler/aslxref.c
+++ b/sys/contrib/dev/acpica/compiler/aslxref.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -490,21 +490,18 @@ XfNamespaceLocateBegin (
RegisterNumber = Op->Asl.AmlOpcode - AML_ARG0; /* 0x68 through 0x6F */
MethodArgs = Node->MethodArgs;
+ /* Mark this Arg as referenced */
+
+ MethodArgs[RegisterNumber].Flags |= ASL_ARG_REFERENCED;
+ MethodArgs[RegisterNumber].Op = Op;
+
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
/* Arg is being initialized */
MethodArgs[RegisterNumber].Flags |= ASL_ARG_INITIALIZED;
- MethodArgs[RegisterNumber].Op = Op;
-
- return_ACPI_STATUS (AE_OK);
}
- /* Mark this Arg as referenced */
-
- MethodArgs[RegisterNumber].Flags |= ASL_ARG_REFERENCED;
- MethodArgs[RegisterNumber].Op = Op;
-
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslxrefout.c b/sys/contrib/dev/acpica/compiler/aslxrefout.c
index 7408ffead743..8f0d1e01e575 100644
--- a/sys/contrib/dev/acpica/compiler/aslxrefout.c
+++ b/sys/contrib/dev/acpica/compiler/aslxrefout.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtcompile.c b/sys/contrib/dev/acpica/compiler/dtcompile.c
index 56da8d389d14..3d21d45f5e98 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompile.c
+++ b/sys/contrib/dev/acpica/compiler/dtcompile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h
index 120c03d1e721..01bbad176ce8 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtexpress.c b/sys/contrib/dev/acpica/compiler/dtexpress.c
index b9da6700a705..08ccabe144b4 100644
--- a/sys/contrib/dev/acpica/compiler/dtexpress.c
+++ b/sys/contrib/dev/acpica/compiler/dtexpress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtfield.c b/sys/contrib/dev/acpica/compiler/dtfield.c
index 399e1d8aacc9..e2cecd12acb7 100644
--- a/sys/contrib/dev/acpica/compiler/dtfield.c
+++ b/sys/contrib/dev/acpica/compiler/dtfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c
index d43b57e435b4..493fe67551df 100644
--- a/sys/contrib/dev/acpica/compiler/dtio.c
+++ b/sys/contrib/dev/acpica/compiler/dtio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.l b/sys/contrib/dev/acpica/compiler/dtparser.l
index 9f62bed47cdb..d3116858a577 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.l
+++ b/sys/contrib/dev/acpica/compiler/dtparser.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.y b/sys/contrib/dev/acpica/compiler/dtparser.y
index d4a6c13b476f..ed3afdc2089e 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.y
+++ b/sys/contrib/dev/acpica/compiler/dtparser.y
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtsubtable.c b/sys/contrib/dev/acpica/compiler/dtsubtable.c
index 49ae8d5ad54a..deb6a9a4b0ce 100644
--- a/sys/contrib/dev/acpica/compiler/dtsubtable.c
+++ b/sys/contrib/dev/acpica/compiler/dtsubtable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dttable.c b/sys/contrib/dev/acpica/compiler/dttable.c
index dc554495c498..9e2b0402a639 100644
--- a/sys/contrib/dev/acpica/compiler/dttable.c
+++ b/sys/contrib/dev/acpica/compiler/dttable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dttable1.c b/sys/contrib/dev/acpica/compiler/dttable1.c
index 673f2561dad3..d08dac98f758 100644
--- a/sys/contrib/dev/acpica/compiler/dttable1.c
+++ b/sys/contrib/dev/acpica/compiler/dttable1.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dttable2.c b/sys/contrib/dev/acpica/compiler/dttable2.c
index 8297ba32031c..687b15221036 100644
--- a/sys/contrib/dev/acpica/compiler/dttable2.c
+++ b/sys/contrib/dev/acpica/compiler/dttable2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.c b/sys/contrib/dev/acpica/compiler/dttemplate.c
index 319ee29f0796..4dc6b2e89d41 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.c
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h
index b18ac31bc7b6..8b05713f5060 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.h
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c
index 1099b8498afa..e3b4602761af 100644
--- a/sys/contrib/dev/acpica/compiler/dtutils.c
+++ b/sys/contrib/dev/acpica/compiler/dtutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/preprocess.h b/sys/contrib/dev/acpica/compiler/preprocess.h
index 50759b54629f..2399f92cca85 100644
--- a/sys/contrib/dev/acpica/compiler/preprocess.h
+++ b/sys/contrib/dev/acpica/compiler/preprocess.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prexpress.c b/sys/contrib/dev/acpica/compiler/prexpress.c
index 32e2b6227fc3..799fdf2e2040 100644
--- a/sys/contrib/dev/acpica/compiler/prexpress.c
+++ b/sys/contrib/dev/acpica/compiler/prexpress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prmacros.c b/sys/contrib/dev/acpica/compiler/prmacros.c
index 0849903f5d8d..f2a916d7c495 100644
--- a/sys/contrib/dev/acpica/compiler/prmacros.c
+++ b/sys/contrib/dev/acpica/compiler/prmacros.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prparser.l b/sys/contrib/dev/acpica/compiler/prparser.l
index 18d78f7fede0..77189c57f394 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.l
+++ b/sys/contrib/dev/acpica/compiler/prparser.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prparser.y b/sys/contrib/dev/acpica/compiler/prparser.y
index 32bb407a5fe7..225036fec61a 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.y
+++ b/sys/contrib/dev/acpica/compiler/prparser.y
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prscan.c b/sys/contrib/dev/acpica/compiler/prscan.c
index c02280dc6f24..4e07b2ae58c5 100644
--- a/sys/contrib/dev/acpica/compiler/prscan.c
+++ b/sys/contrib/dev/acpica/compiler/prscan.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prutils.c b/sys/contrib/dev/acpica/compiler/prutils.c
index c4c9dd63f21a..4517cdeac38e 100644
--- a/sys/contrib/dev/acpica/compiler/prutils.c
+++ b/sys/contrib/dev/acpica/compiler/prutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbcmds.c b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
index 191b1b410bd5..17e7bd6095ad 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbcmds.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbconvert.c b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
index d25d2a9afd40..c44de2a58c06 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbconvert.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbdisply.c b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
index 8db59bc1f77a..93ff92294209 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbdisply.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbexec.c b/sys/contrib/dev/acpica/components/debugger/dbexec.c
index 93fa103064a5..1791f36da62e 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbexec.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbexec.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbfileio.c b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
index 0b3d5a4fa29e..6860e842aa4d 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbfileio.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbhistry.c b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
index b55f108761d6..ef88a5ed3d3b 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbhistry.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbinput.c b/sys/contrib/dev/acpica/components/debugger/dbinput.c
index 55829bf0e91b..92a0f4c8884b 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbinput.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbinput.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbmethod.c b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
index 5925a5bf6160..dbc66613cb8b 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbmethod.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbnames.c b/sys/contrib/dev/acpica/components/debugger/dbnames.c
index f91bf97bb9dc..a225ce87477f 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbnames.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbobject.c b/sys/contrib/dev/acpica/components/debugger/dbobject.c
index 062ad2532064..076318dccd00 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbobject.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbobject.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbstats.c b/sys/contrib/dev/acpica/components/debugger/dbstats.c
index 7b48ba0e5684..7b3e88e4bb04 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbstats.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbstats.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbtest.c b/sys/contrib/dev/acpica/components/debugger/dbtest.c
index 6be75f231c05..6e274e779a4b 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbtest.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbtest.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbutils.c b/sys/contrib/dev/acpica/components/debugger/dbutils.c
index 8e56c209763c..73b8d928d899 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbutils.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/debugger/dbxface.c b/sys/contrib/dev/acpica/components/debugger/dbxface.c
index d6f4bd536e63..2d39f1ad15bb 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbxface.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
index 365e3015744a..7a1ac3bd62ef 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c b/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
index 3b03e3472ab1..1f72f73c6d5d 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
index 5900614507ec..846ff7fd0bf7 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmnames.c b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
index d75db19bd78e..169a9da86b1f 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmnames.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
index 8e14ba79ea9a..b73dfdc92565 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
index 5a3628855d34..56947ff3a24d 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
index f7d53083af90..39c6d56504d8 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
index 318c1616c3a6..73216010bc49 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
index 2840f806a335..bd301d46407a 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmutils.c b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
index 32cc4b6afb89..b09038888597 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmutils.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
index 1d2568b7be4b..39d66ebdfd74 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
index b669b56f247d..b27305ce70c6 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
index e3c68b7a4e8d..c830f3b3b405 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
index 9db1b7be044c..51e1081587b5 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
index 4e3c29a532b9..1311692004f4 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
index 92a604d1434b..749af80bf167 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
index 020df913db3e..5350b9a65b44 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
index 6e0fc7e5e589..8c14aa2f5fb3 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
index da9512f68454..db6c530cffc9 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
index 19bdd5518564..91cd18f89d0f 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
index 1ffd0cbf8023..2ed5e99922f3 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
index c43889d754b4..b8aaa2893a04 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
index ff14300003c0..3318035ce73d 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
index e060b7c73648..08bb7dfdb85e 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
index ba99d1ef6547..afedcd770de1 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
index b19d6a9792e7..914e108ec5e0 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evevent.c b/sys/contrib/dev/acpica/components/events/evevent.c
index a4aa037e51c6..a4d319a37c70 100644
--- a/sys/contrib/dev/acpica/components/events/evevent.c
+++ b/sys/contrib/dev/acpica/components/events/evevent.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evglock.c b/sys/contrib/dev/acpica/components/events/evglock.c
index b8bd0cf0a853..17cab651f4b8 100644
--- a/sys/contrib/dev/acpica/components/events/evglock.c
+++ b/sys/contrib/dev/acpica/components/events/evglock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evgpe.c b/sys/contrib/dev/acpica/components/events/evgpe.c
index a6439eb4b048..21c80ffd9492 100644
--- a/sys/contrib/dev/acpica/components/events/evgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evgpeblk.c b/sys/contrib/dev/acpica/components/events/evgpeblk.c
index e5d3616db4f3..2863791271d7 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeblk.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeblk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evgpeinit.c b/sys/contrib/dev/acpica/components/events/evgpeinit.c
index f4254f8e8f98..336906912138 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeinit.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evgpeutil.c b/sys/contrib/dev/acpica/components/events/evgpeutil.c
index 99cbc286d1ac..94a8f6c9fba2 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeutil.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeutil.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evhandler.c b/sys/contrib/dev/acpica/components/events/evhandler.c
index 88496d0113b3..850173682a31 100644
--- a/sys/contrib/dev/acpica/components/events/evhandler.c
+++ b/sys/contrib/dev/acpica/components/events/evhandler.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evmisc.c b/sys/contrib/dev/acpica/components/events/evmisc.c
index 4bc478611baf..e6139204f0e5 100644
--- a/sys/contrib/dev/acpica/components/events/evmisc.c
+++ b/sys/contrib/dev/acpica/components/events/evmisc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evregion.c b/sys/contrib/dev/acpica/components/events/evregion.c
index fae3900c198b..b4c87b010f3f 100644
--- a/sys/contrib/dev/acpica/components/events/evregion.c
+++ b/sys/contrib/dev/acpica/components/events/evregion.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evrgnini.c b/sys/contrib/dev/acpica/components/events/evrgnini.c
index da759c63e711..6c1ac91f6c8e 100644
--- a/sys/contrib/dev/acpica/components/events/evrgnini.c
+++ b/sys/contrib/dev/acpica/components/events/evrgnini.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evsci.c b/sys/contrib/dev/acpica/components/events/evsci.c
index a4d71dbe97b7..6d71c399ccd1 100644
--- a/sys/contrib/dev/acpica/components/events/evsci.c
+++ b/sys/contrib/dev/acpica/components/events/evsci.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evxface.c b/sys/contrib/dev/acpica/components/events/evxface.c
index 6306a5783874..442b84724f7b 100644
--- a/sys/contrib/dev/acpica/components/events/evxface.c
+++ b/sys/contrib/dev/acpica/components/events/evxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evxfevnt.c b/sys/contrib/dev/acpica/components/events/evxfevnt.c
index 81d315cb1dd3..c3287678ee9d 100644
--- a/sys/contrib/dev/acpica/components/events/evxfevnt.c
+++ b/sys/contrib/dev/acpica/components/events/evxfevnt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evxfgpe.c b/sys/contrib/dev/acpica/components/events/evxfgpe.c
index 47ad6de96358..bdb547e6e99c 100644
--- a/sys/contrib/dev/acpica/components/events/evxfgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evxfgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evxfregn.c b/sys/contrib/dev/acpica/components/events/evxfregn.c
index c8a6eddfee2a..987ab810d481 100644
--- a/sys/contrib/dev/acpica/components/events/evxfregn.c
+++ b/sys/contrib/dev/acpica/components/events/evxfregn.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exconcat.c b/sys/contrib/dev/acpica/components/executer/exconcat.c
index 8bfbcd48b6b5..543715b9a201 100644
--- a/sys/contrib/dev/acpica/components/executer/exconcat.c
+++ b/sys/contrib/dev/acpica/components/executer/exconcat.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exconfig.c b/sys/contrib/dev/acpica/components/executer/exconfig.c
index bd486c493ff1..1f16b17bbd6b 100644
--- a/sys/contrib/dev/acpica/components/executer/exconfig.c
+++ b/sys/contrib/dev/acpica/components/executer/exconfig.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exconvrt.c b/sys/contrib/dev/acpica/components/executer/exconvrt.c
index 497788a9f638..4e5cf6e1845b 100644
--- a/sys/contrib/dev/acpica/components/executer/exconvrt.c
+++ b/sys/contrib/dev/acpica/components/executer/exconvrt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/excreate.c b/sys/contrib/dev/acpica/components/executer/excreate.c
index 5c38a44188a1..4cc3b9d3e374 100644
--- a/sys/contrib/dev/acpica/components/executer/excreate.c
+++ b/sys/contrib/dev/acpica/components/executer/excreate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exdebug.c b/sys/contrib/dev/acpica/components/executer/exdebug.c
index 24273f81c7bc..558f369caaf8 100644
--- a/sys/contrib/dev/acpica/components/executer/exdebug.c
+++ b/sys/contrib/dev/acpica/components/executer/exdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exdump.c b/sys/contrib/dev/acpica/components/executer/exdump.c
index 3e6c089a4426..41ccb7f599c2 100644
--- a/sys/contrib/dev/acpica/components/executer/exdump.c
+++ b/sys/contrib/dev/acpica/components/executer/exdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exfield.c b/sys/contrib/dev/acpica/components/executer/exfield.c
index aa71d6ec1297..9b2f1290547b 100644
--- a/sys/contrib/dev/acpica/components/executer/exfield.c
+++ b/sys/contrib/dev/acpica/components/executer/exfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exfldio.c b/sys/contrib/dev/acpica/components/executer/exfldio.c
index affc9c66f5e9..9369b36525d7 100644
--- a/sys/contrib/dev/acpica/components/executer/exfldio.c
+++ b/sys/contrib/dev/acpica/components/executer/exfldio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exmisc.c b/sys/contrib/dev/acpica/components/executer/exmisc.c
index 598bf782be17..73f1bfbfa0b0 100644
--- a/sys/contrib/dev/acpica/components/executer/exmisc.c
+++ b/sys/contrib/dev/acpica/components/executer/exmisc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exmutex.c b/sys/contrib/dev/acpica/components/executer/exmutex.c
index 989cb29fc20d..4448e370e2bb 100644
--- a/sys/contrib/dev/acpica/components/executer/exmutex.c
+++ b/sys/contrib/dev/acpica/components/executer/exmutex.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exnames.c b/sys/contrib/dev/acpica/components/executer/exnames.c
index 13fe83f370b4..dbc4b453298e 100644
--- a/sys/contrib/dev/acpica/components/executer/exnames.c
+++ b/sys/contrib/dev/acpica/components/executer/exnames.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg1.c b/sys/contrib/dev/acpica/components/executer/exoparg1.c
index eae2168c9c72..619de87dd2a0 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg1.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg1.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg2.c b/sys/contrib/dev/acpica/components/executer/exoparg2.c
index f223c8dbca53..dcb660bcd1b2 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg2.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg3.c b/sys/contrib/dev/acpica/components/executer/exoparg3.c
index 8be4d594b255..b3351f46de60 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg3.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg3.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg6.c b/sys/contrib/dev/acpica/components/executer/exoparg6.c
index 09f03360b299..a3dce458cb2f 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg6.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg6.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exprep.c b/sys/contrib/dev/acpica/components/executer/exprep.c
index 9f59df3f0c64..80e2dd18f10a 100644
--- a/sys/contrib/dev/acpica/components/executer/exprep.c
+++ b/sys/contrib/dev/acpica/components/executer/exprep.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exregion.c b/sys/contrib/dev/acpica/components/executer/exregion.c
index 6f4491596d34..2252ff0adaf3 100644
--- a/sys/contrib/dev/acpica/components/executer/exregion.c
+++ b/sys/contrib/dev/acpica/components/executer/exregion.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exresnte.c b/sys/contrib/dev/acpica/components/executer/exresnte.c
index 3e878f66f895..36aab0001c6f 100644
--- a/sys/contrib/dev/acpica/components/executer/exresnte.c
+++ b/sys/contrib/dev/acpica/components/executer/exresnte.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exresolv.c b/sys/contrib/dev/acpica/components/executer/exresolv.c
index 75c65d6aeb83..cfde40840375 100644
--- a/sys/contrib/dev/acpica/components/executer/exresolv.c
+++ b/sys/contrib/dev/acpica/components/executer/exresolv.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exresop.c b/sys/contrib/dev/acpica/components/executer/exresop.c
index de909989e42d..5abcec9308e4 100644
--- a/sys/contrib/dev/acpica/components/executer/exresop.c
+++ b/sys/contrib/dev/acpica/components/executer/exresop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exstore.c b/sys/contrib/dev/acpica/components/executer/exstore.c
index eb474a9d1933..345b9917c657 100644
--- a/sys/contrib/dev/acpica/components/executer/exstore.c
+++ b/sys/contrib/dev/acpica/components/executer/exstore.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exstoren.c b/sys/contrib/dev/acpica/components/executer/exstoren.c
index 25a499b86b09..1d67105314ea 100644
--- a/sys/contrib/dev/acpica/components/executer/exstoren.c
+++ b/sys/contrib/dev/acpica/components/executer/exstoren.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exstorob.c b/sys/contrib/dev/acpica/components/executer/exstorob.c
index 981e261483f3..2cf3777e1c74 100644
--- a/sys/contrib/dev/acpica/components/executer/exstorob.c
+++ b/sys/contrib/dev/acpica/components/executer/exstorob.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exsystem.c b/sys/contrib/dev/acpica/components/executer/exsystem.c
index 6c1dcd3d135e..1365118a0555 100644
--- a/sys/contrib/dev/acpica/components/executer/exsystem.c
+++ b/sys/contrib/dev/acpica/components/executer/exsystem.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/extrace.c b/sys/contrib/dev/acpica/components/executer/extrace.c
index bc366ed7592d..4fb7f5b6d5c9 100644
--- a/sys/contrib/dev/acpica/components/executer/extrace.c
+++ b/sys/contrib/dev/acpica/components/executer/extrace.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/executer/exutils.c b/sys/contrib/dev/acpica/components/executer/exutils.c
index 2c7dc8aa0e1e..a8d627f49036 100644
--- a/sys/contrib/dev/acpica/components/executer/exutils.c
+++ b/sys/contrib/dev/acpica/components/executer/exutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwacpi.c b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
index 54b441620e59..1010b96c090e 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwacpi.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwesleep.c b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
index 7b8a5e2be6bf..de792252169b 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwesleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwgpe.c b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
index 27bb46815e07..735e1c1eecff 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwgpe.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwpci.c b/sys/contrib/dev/acpica/components/hardware/hwpci.c
index 3abb424bf7d2..2d0e1a6b61b7 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwpci.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwpci.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwregs.c b/sys/contrib/dev/acpica/components/hardware/hwregs.c
index 59aa0aaa7142..f50cd788a46d 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwregs.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwregs.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwsleep.c b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
index 25538c5ccf8c..24993c7dc709 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwtimer.c b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
index 2c53dc92a65d..670ca1c93437 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwtimer.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwvalid.c b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
index c8237f88e7f3..0670840bc84a 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwvalid.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxface.c b/sys/contrib/dev/acpica/components/hardware/hwxface.c
index 734dfc254e04..5e7c3f804f6a 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxface.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
index c75bec470826..2a0a9a60be8d 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsaccess.c b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
index bf3226917dbd..046825fbfd8c 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsaccess.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsalloc.c b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
index c85593d023ba..f405ad86d320 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsalloc.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsarguments.c b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
index 46d6eb91b99a..b241055e48cb 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsarguments.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsconvert.c b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
index 71df3a0977ed..64bbc16a86c6 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsconvert.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdump.c b/sys/contrib/dev/acpica/components/namespace/nsdump.c
index d34ff110e86f..472a312a237c 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdump.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
index 8adb76a471d6..7e92b210fa72 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nseval.c b/sys/contrib/dev/acpica/components/namespace/nseval.c
index ea1cceb3917f..e11ac6073f13 100644
--- a/sys/contrib/dev/acpica/components/namespace/nseval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nseval.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsinit.c b/sys/contrib/dev/acpica/components/namespace/nsinit.c
index a20846928fb9..e9379e133a29 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsinit.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsload.c b/sys/contrib/dev/acpica/components/namespace/nsload.c
index 42d9f0db58d9..ad5a16a488b7 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsload.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsnames.c b/sys/contrib/dev/acpica/components/namespace/nsnames.c
index 5ddc0d41f44e..6bf46a18b6d3 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsnames.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsobject.c b/sys/contrib/dev/acpica/components/namespace/nsobject.c
index 1e555d990734..ee832d41c8e2 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsobject.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsobject.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsparse.c b/sys/contrib/dev/acpica/components/namespace/nsparse.c
index 7bb45de946a1..fae362d49d2b 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsparse.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nspredef.c b/sys/contrib/dev/acpica/components/namespace/nspredef.c
index 606b23d5b54a..5438f44e5ae2 100644
--- a/sys/contrib/dev/acpica/components/namespace/nspredef.c
+++ b/sys/contrib/dev/acpica/components/namespace/nspredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
index e4ea0772c96d..5603d2d27a53 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair.c b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
index a0d4935e049b..0754f7e88c91 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
index 4873c7fc42ad..0d651f8c5f77 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nssearch.c b/sys/contrib/dev/acpica/components/namespace/nssearch.c
index 85514aadbf9b..99eccb2b8558 100644
--- a/sys/contrib/dev/acpica/components/namespace/nssearch.c
+++ b/sys/contrib/dev/acpica/components/namespace/nssearch.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsutils.c b/sys/contrib/dev/acpica/components/namespace/nsutils.c
index f561f851c93c..fa9e83270813 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsutils.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsutils.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nswalk.c b/sys/contrib/dev/acpica/components/namespace/nswalk.c
index bdbfa76ee5da..8c0f723ab545 100644
--- a/sys/contrib/dev/acpica/components/namespace/nswalk.c
+++ b/sys/contrib/dev/acpica/components/namespace/nswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
index 6467d7e2f54f..363970476d7a 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfname.c b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
index 7a5c1c32385a..ef8ff6d5d746 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfname.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
index 81a4756a4d71..9d5e9a228513 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psargs.c b/sys/contrib/dev/acpica/components/parser/psargs.c
index 880abab2a0e7..9d16b3ab6e05 100644
--- a/sys/contrib/dev/acpica/components/parser/psargs.c
+++ b/sys/contrib/dev/acpica/components/parser/psargs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c
index 8565421071f3..0d7a477c0eda 100644
--- a/sys/contrib/dev/acpica/components/parser/psloop.c
+++ b/sys/contrib/dev/acpica/components/parser/psloop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psobject.c b/sys/contrib/dev/acpica/components/parser/psobject.c
index 31050f15239d..50ac0ea59c63 100644
--- a/sys/contrib/dev/acpica/components/parser/psobject.c
+++ b/sys/contrib/dev/acpica/components/parser/psobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psopcode.c b/sys/contrib/dev/acpica/components/parser/psopcode.c
index 9f53d1e42a09..ba9ce9f5c57f 100644
--- a/sys/contrib/dev/acpica/components/parser/psopcode.c
+++ b/sys/contrib/dev/acpica/components/parser/psopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psopinfo.c b/sys/contrib/dev/acpica/components/parser/psopinfo.c
index 6ffd7d2d350c..2b0832ecc7c2 100644
--- a/sys/contrib/dev/acpica/components/parser/psopinfo.c
+++ b/sys/contrib/dev/acpica/components/parser/psopinfo.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c
index 700441ee31a7..e9bdfbb856b3 100644
--- a/sys/contrib/dev/acpica/components/parser/psparse.c
+++ b/sys/contrib/dev/acpica/components/parser/psparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psscope.c b/sys/contrib/dev/acpica/components/parser/psscope.c
index 9ad7a58a2a08..63b925fefaf9 100644
--- a/sys/contrib/dev/acpica/components/parser/psscope.c
+++ b/sys/contrib/dev/acpica/components/parser/psscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/pstree.c b/sys/contrib/dev/acpica/components/parser/pstree.c
index cf71601f5703..6e6ae2fb60d1 100644
--- a/sys/contrib/dev/acpica/components/parser/pstree.c
+++ b/sys/contrib/dev/acpica/components/parser/pstree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psutils.c b/sys/contrib/dev/acpica/components/parser/psutils.c
index ca3830ed5147..c8f49428cdd2 100644
--- a/sys/contrib/dev/acpica/components/parser/psutils.c
+++ b/sys/contrib/dev/acpica/components/parser/psutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/pswalk.c b/sys/contrib/dev/acpica/components/parser/pswalk.c
index 1a9e55e3640d..ddcd5c9061fe 100644
--- a/sys/contrib/dev/acpica/components/parser/pswalk.c
+++ b/sys/contrib/dev/acpica/components/parser/pswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/parser/psxface.c b/sys/contrib/dev/acpica/components/parser/psxface.c
index 69b00d2c2f4d..24dbe631c9a3 100644
--- a/sys/contrib/dev/acpica/components/parser/psxface.c
+++ b/sys/contrib/dev/acpica/components/parser/psxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsaddr.c b/sys/contrib/dev/acpica/components/resources/rsaddr.c
index ca9e290f2e07..6b95e8407501 100644
--- a/sys/contrib/dev/acpica/components/resources/rsaddr.c
+++ b/sys/contrib/dev/acpica/components/resources/rsaddr.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rscalc.c b/sys/contrib/dev/acpica/components/resources/rscalc.c
index 9cc963859eab..8d54aa44eb91 100644
--- a/sys/contrib/dev/acpica/components/resources/rscalc.c
+++ b/sys/contrib/dev/acpica/components/resources/rscalc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rscreate.c b/sys/contrib/dev/acpica/components/resources/rscreate.c
index c9b4b12b7e82..179a5b3d62a4 100644
--- a/sys/contrib/dev/acpica/components/resources/rscreate.c
+++ b/sys/contrib/dev/acpica/components/resources/rscreate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsdump.c b/sys/contrib/dev/acpica/components/resources/rsdump.c
index 8699730a10d9..fd97ca786217 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdump.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdump.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
index 2173fe3b199d..60fbfbb06b91 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsinfo.c b/sys/contrib/dev/acpica/components/resources/rsinfo.c
index 6268b732a43e..46789fa6307b 100644
--- a/sys/contrib/dev/acpica/components/resources/rsinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsinfo.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsio.c b/sys/contrib/dev/acpica/components/resources/rsio.c
index 5cf5f34889d9..d110a1f1f98c 100644
--- a/sys/contrib/dev/acpica/components/resources/rsio.c
+++ b/sys/contrib/dev/acpica/components/resources/rsio.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsirq.c b/sys/contrib/dev/acpica/components/resources/rsirq.c
index fa591ea2bb0e..1035ec6d2b92 100644
--- a/sys/contrib/dev/acpica/components/resources/rsirq.c
+++ b/sys/contrib/dev/acpica/components/resources/rsirq.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rslist.c b/sys/contrib/dev/acpica/components/resources/rslist.c
index 216d40ba2d48..5c393c542d1c 100644
--- a/sys/contrib/dev/acpica/components/resources/rslist.c
+++ b/sys/contrib/dev/acpica/components/resources/rslist.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsmemory.c b/sys/contrib/dev/acpica/components/resources/rsmemory.c
index bb4bae30fb49..1f35742abdc0 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmemory.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmemory.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsmisc.c b/sys/contrib/dev/acpica/components/resources/rsmisc.c
index 57e85dd86813..de9a463f3146 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmisc.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsserial.c b/sys/contrib/dev/acpica/components/resources/rsserial.c
index 27b3c9e5545f..0df5b9755072 100644
--- a/sys/contrib/dev/acpica/components/resources/rsserial.c
+++ b/sys/contrib/dev/acpica/components/resources/rsserial.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsutils.c b/sys/contrib/dev/acpica/components/resources/rsutils.c
index a3a7ed3fa3b5..31fd7a89ee7f 100644
--- a/sys/contrib/dev/acpica/components/resources/rsutils.c
+++ b/sys/contrib/dev/acpica/components/resources/rsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/resources/rsxface.c b/sys/contrib/dev/acpica/components/resources/rsxface.c
index c362a1af96d5..f277bda285b6 100644
--- a/sys/contrib/dev/acpica/components/resources/rsxface.c
+++ b/sys/contrib/dev/acpica/components/resources/rsxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbdata.c b/sys/contrib/dev/acpica/components/tables/tbdata.c
index e1eccd8a2828..2d2ee3cf972b 100644
--- a/sys/contrib/dev/acpica/components/tables/tbdata.c
+++ b/sys/contrib/dev/acpica/components/tables/tbdata.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbfadt.c b/sys/contrib/dev/acpica/components/tables/tbfadt.c
index ee8a815a8226..7ef3ad270300 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfadt.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfadt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbfind.c b/sys/contrib/dev/acpica/components/tables/tbfind.c
index eadfd6fc10cb..3ff307d36925 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfind.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfind.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbinstal.c b/sys/contrib/dev/acpica/components/tables/tbinstal.c
index 81a13d2a8ff2..7374a45e198f 100644
--- a/sys/contrib/dev/acpica/components/tables/tbinstal.c
+++ b/sys/contrib/dev/acpica/components/tables/tbinstal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbprint.c b/sys/contrib/dev/acpica/components/tables/tbprint.c
index cbdd562390f0..59b58080b433 100644
--- a/sys/contrib/dev/acpica/components/tables/tbprint.c
+++ b/sys/contrib/dev/acpica/components/tables/tbprint.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbutils.c b/sys/contrib/dev/acpica/components/tables/tbutils.c
index 08ab87f8e1f7..3d6b0bcaf54e 100644
--- a/sys/contrib/dev/acpica/components/tables/tbutils.c
+++ b/sys/contrib/dev/acpica/components/tables/tbutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbxface.c b/sys/contrib/dev/acpica/components/tables/tbxface.c
index 6e231cd8fceb..3b3314f6fdde 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxface.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfload.c b/sys/contrib/dev/acpica/components/tables/tbxfload.c
index 871797583bfc..d66a932ae95d 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfload.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfroot.c b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
index c5a6af296609..06884593018f 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfroot.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utaddress.c b/sys/contrib/dev/acpica/components/utilities/utaddress.c
index 870826d012fd..50c589c5dcc3 100644
--- a/sys/contrib/dev/acpica/components/utilities/utaddress.c
+++ b/sys/contrib/dev/acpica/components/utilities/utaddress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utalloc.c b/sys/contrib/dev/acpica/components/utilities/utalloc.c
index b768f5846a2e..a4aec9c088d8 100644
--- a/sys/contrib/dev/acpica/components/utilities/utalloc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utalloc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utascii.c b/sys/contrib/dev/acpica/components/utilities/utascii.c
index 9081c55babe6..d4b6cfc5924a 100644
--- a/sys/contrib/dev/acpica/components/utilities/utascii.c
+++ b/sys/contrib/dev/acpica/components/utilities/utascii.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utbuffer.c b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
index 8b3f75d34c63..4652d5b7db21 100644
--- a/sys/contrib/dev/acpica/components/utilities/utbuffer.c
+++ b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utcache.c b/sys/contrib/dev/acpica/components/utilities/utcache.c
index af6df9214a00..1641879e3b4e 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcache.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcache.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utcopy.c b/sys/contrib/dev/acpica/components/utilities/utcopy.c
index c1be4cce2e19..57bb41b87a6c 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcopy.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcopy.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utdebug.c b/sys/contrib/dev/acpica/components/utilities/utdebug.c
index 2f60e8780080..404680c8e996 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdebug.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utdecode.c b/sys/contrib/dev/acpica/components/utilities/utdecode.c
index e2a66e20746d..006f12119faa 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdecode.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdecode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utdelete.c b/sys/contrib/dev/acpica/components/utilities/utdelete.c
index d96f1e91d86a..a748fcbd5d5d 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdelete.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/uterror.c b/sys/contrib/dev/acpica/components/utilities/uterror.c
index bc4193fe5ce8..69a9bcfff688 100644
--- a/sys/contrib/dev/acpica/components/utilities/uterror.c
+++ b/sys/contrib/dev/acpica/components/utilities/uterror.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/uteval.c b/sys/contrib/dev/acpica/components/utilities/uteval.c
index 8fb69296e478..5cf19451d12e 100644
--- a/sys/contrib/dev/acpica/components/utilities/uteval.c
+++ b/sys/contrib/dev/acpica/components/utilities/uteval.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utexcep.c b/sys/contrib/dev/acpica/components/utilities/utexcep.c
index d2ee5bbf1ba1..0b960ffca3c9 100644
--- a/sys/contrib/dev/acpica/components/utilities/utexcep.c
+++ b/sys/contrib/dev/acpica/components/utilities/utexcep.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utglobal.c b/sys/contrib/dev/acpica/components/utilities/utglobal.c
index 759780a96dc1..dd004f6d6ed0 100644
--- a/sys/contrib/dev/acpica/components/utilities/utglobal.c
+++ b/sys/contrib/dev/acpica/components/utilities/utglobal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/uthex.c b/sys/contrib/dev/acpica/components/utilities/uthex.c
index d4571a258890..f30ea363977c 100644
--- a/sys/contrib/dev/acpica/components/utilities/uthex.c
+++ b/sys/contrib/dev/acpica/components/utilities/uthex.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utids.c b/sys/contrib/dev/acpica/components/utilities/utids.c
index 4c8a8bef233e..cfbd5024c517 100644
--- a/sys/contrib/dev/acpica/components/utilities/utids.c
+++ b/sys/contrib/dev/acpica/components/utilities/utids.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utinit.c b/sys/contrib/dev/acpica/components/utilities/utinit.c
index 87fb9f65be2f..f62667c54060 100644
--- a/sys/contrib/dev/acpica/components/utilities/utinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utlock.c b/sys/contrib/dev/acpica/components/utilities/utlock.c
index 39d1808bee11..94d5e75b7b10 100644
--- a/sys/contrib/dev/acpica/components/utilities/utlock.c
+++ b/sys/contrib/dev/acpica/components/utilities/utlock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utmath.c b/sys/contrib/dev/acpica/components/utilities/utmath.c
index 788e33067d75..4452267a0b68 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmath.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmath.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utmisc.c b/sys/contrib/dev/acpica/components/utilities/utmisc.c
index 13d920f040ec..886a07e2c7e5 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmisc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utmutex.c b/sys/contrib/dev/acpica/components/utilities/utmutex.c
index ef99ee07807e..50bd431edaad 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmutex.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utnonansi.c b/sys/contrib/dev/acpica/components/utilities/utnonansi.c
index 720436e4063c..41e7e2eb3d74 100644
--- a/sys/contrib/dev/acpica/components/utilities/utnonansi.c
+++ b/sys/contrib/dev/acpica/components/utilities/utnonansi.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utobject.c b/sys/contrib/dev/acpica/components/utilities/utobject.c
index 656568a5136e..5dc19c3f3f50 100644
--- a/sys/contrib/dev/acpica/components/utilities/utobject.c
+++ b/sys/contrib/dev/acpica/components/utilities/utobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utosi.c b/sys/contrib/dev/acpica/components/utilities/utosi.c
index ec3dade0ef71..a4276033cddf 100644
--- a/sys/contrib/dev/acpica/components/utilities/utosi.c
+++ b/sys/contrib/dev/acpica/components/utilities/utosi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utownerid.c b/sys/contrib/dev/acpica/components/utilities/utownerid.c
index 0c57dba03eb5..eff0dda96819 100644
--- a/sys/contrib/dev/acpica/components/utilities/utownerid.c
+++ b/sys/contrib/dev/acpica/components/utilities/utownerid.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utpredef.c b/sys/contrib/dev/acpica/components/utilities/utpredef.c
index 015d11b6ff64..8eb6810ae881 100644
--- a/sys/contrib/dev/acpica/components/utilities/utpredef.c
+++ b/sys/contrib/dev/acpica/components/utilities/utpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utresrc.c b/sys/contrib/dev/acpica/components/utilities/utresrc.c
index e498c760b8ea..0f03a7472a18 100644
--- a/sys/contrib/dev/acpica/components/utilities/utresrc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utstate.c b/sys/contrib/dev/acpica/components/utilities/utstate.c
index 55778e0fc1fb..74a844afb19d 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstate.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utstring.c b/sys/contrib/dev/acpica/components/utilities/utstring.c
index 3d02b6c6efe1..dcf55669c7af 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstring.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstring.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c b/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
index 5a7294a24d68..80090f2b041f 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/uttrack.c b/sys/contrib/dev/acpica/components/utilities/uttrack.c
index 6cc0cde7fdf1..f92e139676f9 100644
--- a/sys/contrib/dev/acpica/components/utilities/uttrack.c
+++ b/sys/contrib/dev/acpica/components/utilities/uttrack.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utuuid.c b/sys/contrib/dev/acpica/components/utilities/utuuid.c
index 281305a1a05e..dd8fad4c1179 100644
--- a/sys/contrib/dev/acpica/components/utilities/utuuid.c
+++ b/sys/contrib/dev/acpica/components/utilities/utuuid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utxface.c b/sys/contrib/dev/acpica/components/utilities/utxface.c
index df74a51cdb11..ba0e03043ca5 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxface.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utxferror.c b/sys/contrib/dev/acpica/components/utilities/utxferror.c
index 802da6ddce1c..ef911ecdbddf 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxferror.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxferror.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfinit.c b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
index 0a6fc10243a1..1c295a908b94 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
index ef5a7bc619ed..f1e3ceaabc5a 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acapps.h b/sys/contrib/dev/acpica/include/acapps.h
index d14bce1ff03f..ebc1cfbcd7e4 100644
--- a/sys/contrib/dev/acpica/include/acapps.h
+++ b/sys/contrib/dev/acpica/include/acapps.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,26 +51,26 @@
/* Common info for tool signons */
#define ACPICA_NAME "Intel ACPI Component Architecture"
-#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2016 Intel Corporation"
+#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2017 Intel Corporation"
#if ACPI_MACHINE_WIDTH == 64
-#define ACPI_WIDTH "-64"
+#define ACPI_WIDTH " (64-bit version)"
#elif ACPI_MACHINE_WIDTH == 32
-#define ACPI_WIDTH "-32"
+#define ACPI_WIDTH " (32-bit version)"
#else
#error unknown ACPI_MACHINE_WIDTH
-#define ACPI_WIDTH "-??"
+#define ACPI_WIDTH " (unknown bit width, not 32 or 64)"
#endif
/* Macros for signons and file headers */
#define ACPI_COMMON_SIGNON(UtilityName) \
- "\n%s\n%s version %8.8X%s\n%s\n\n", \
+ "\n%s\n%s version %8.8X\n%s\n\n", \
ACPICA_NAME, \
- UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
+ UtilityName, ((UINT32) ACPI_CA_VERSION), \
ACPICA_COPYRIGHT
#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
diff --git a/sys/contrib/dev/acpica/include/acbuffer.h b/sys/contrib/dev/acpica/include/acbuffer.h
index 78f6db4a9ecd..73f41ddbedd6 100644
--- a/sys/contrib/dev/acpica/include/acbuffer.h
+++ b/sys/contrib/dev/acpica/include/acbuffer.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acclib.h b/sys/contrib/dev/acpica/include/acclib.h
index ab1c3d7676bc..6f2226e08def 100644
--- a/sys/contrib/dev/acpica/include/acclib.h
+++ b/sys/contrib/dev/acpica/include/acclib.h
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/accommon.h b/sys/contrib/dev/acpica/include/accommon.h
index 7851c54e0bc4..f4afae43253d 100644
--- a/sys/contrib/dev/acpica/include/accommon.h
+++ b/sys/contrib/dev/acpica/include/accommon.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acconfig.h b/sys/contrib/dev/acpica/include/acconfig.h
index d6324911e8a7..5e1912ea5fb9 100644
--- a/sys/contrib/dev/acpica/include/acconfig.h
+++ b/sys/contrib/dev/acpica/include/acconfig.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acdebug.h b/sys/contrib/dev/acpica/include/acdebug.h
index c5b8eb4bdad3..22225c3d5cf0 100644
--- a/sys/contrib/dev/acpica/include/acdebug.h
+++ b/sys/contrib/dev/acpica/include/acdebug.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acdisasm.h b/sys/contrib/dev/acpica/include/acdisasm.h
index 3ba84ea6e904..9b43dcd8be4d 100644
--- a/sys/contrib/dev/acpica/include/acdisasm.h
+++ b/sys/contrib/dev/acpica/include/acdisasm.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acdispat.h b/sys/contrib/dev/acpica/include/acdispat.h
index 1a6f39e2aa8e..f66003c715c5 100644
--- a/sys/contrib/dev/acpica/include/acdispat.h
+++ b/sys/contrib/dev/acpica/include/acdispat.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acevents.h b/sys/contrib/dev/acpica/include/acevents.h
index a2ea52042e4d..2bb6bf619c9f 100644
--- a/sys/contrib/dev/acpica/include/acevents.h
+++ b/sys/contrib/dev/acpica/include/acevents.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acexcep.h b/sys/contrib/dev/acpica/include/acexcep.h
index 2fe81dccce33..6bc741cb08db 100644
--- a/sys/contrib/dev/acpica/include/acexcep.h
+++ b/sys/contrib/dev/acpica/include/acexcep.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h
index 60a2ffddfbf6..d83825f0fabb 100644
--- a/sys/contrib/dev/acpica/include/acglobal.h
+++ b/sys/contrib/dev/acpica/include/acglobal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/achware.h b/sys/contrib/dev/acpica/include/achware.h
index b7a5f20fec2f..a97ec5707e9d 100644
--- a/sys/contrib/dev/acpica/include/achware.h
+++ b/sys/contrib/dev/acpica/include/achware.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acinterp.h b/sys/contrib/dev/acpica/include/acinterp.h
index 148e8d0cafe3..78eaa1afa206 100644
--- a/sys/contrib/dev/acpica/include/acinterp.h
+++ b/sys/contrib/dev/acpica/include/acinterp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h
index 734cae17a3b7..3b5f779edc2f 100644
--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acmacros.h b/sys/contrib/dev/acpica/include/acmacros.h
index 5a5e79318a77..0e6dee66ff71 100644
--- a/sys/contrib/dev/acpica/include/acmacros.h
+++ b/sys/contrib/dev/acpica/include/acmacros.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acnames.h b/sys/contrib/dev/acpica/include/acnames.h
index 4710323e0c30..9ef39736220e 100644
--- a/sys/contrib/dev/acpica/include/acnames.h
+++ b/sys/contrib/dev/acpica/include/acnames.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acnamesp.h b/sys/contrib/dev/acpica/include/acnamesp.h
index 09b319cc87c8..651b0d021e3b 100644
--- a/sys/contrib/dev/acpica/include/acnamesp.h
+++ b/sys/contrib/dev/acpica/include/acnamesp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acobject.h b/sys/contrib/dev/acpica/include/acobject.h
index 83f29ec3c983..a40256952fa7 100644
--- a/sys/contrib/dev/acpica/include/acobject.h
+++ b/sys/contrib/dev/acpica/include/acobject.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acopcode.h b/sys/contrib/dev/acpica/include/acopcode.h
index e5c35255ca55..ce4e420bfa6a 100644
--- a/sys/contrib/dev/acpica/include/acopcode.h
+++ b/sys/contrib/dev/acpica/include/acopcode.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acoutput.h b/sys/contrib/dev/acpica/include/acoutput.h
index 4fb718208c6e..0bee1bebcb30 100644
--- a/sys/contrib/dev/acpica/include/acoutput.h
+++ b/sys/contrib/dev/acpica/include/acoutput.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acparser.h b/sys/contrib/dev/acpica/include/acparser.h
index 4137981024f7..f92efd8bdca9 100644
--- a/sys/contrib/dev/acpica/include/acparser.h
+++ b/sys/contrib/dev/acpica/include/acparser.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acpi.h b/sys/contrib/dev/acpica/include/acpi.h
index 6c422de801ed..b17c6909e4f3 100644
--- a/sys/contrib/dev/acpica/include/acpi.h
+++ b/sys/contrib/dev/acpica/include/acpi.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acpiosxf.h b/sys/contrib/dev/acpica/include/acpiosxf.h
index f99074fb7826..83cdf4372ead 100644
--- a/sys/contrib/dev/acpica/include/acpiosxf.h
+++ b/sys/contrib/dev/acpica/include/acpiosxf.h
@@ -7,7 +7,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h
index 7234ae8e331d..ae946711c948 100644
--- a/sys/contrib/dev/acpica/include/acpixf.h
+++ b/sys/contrib/dev/acpica/include/acpixf.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20161222
+#define ACPI_CA_VERSION 0x20170119
#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 ab61c53d7bf5..bc89d7289c8e 100644
--- a/sys/contrib/dev/acpica/include/acpredef.h
+++ b/sys/contrib/dev/acpica/include/acpredef.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acresrc.h b/sys/contrib/dev/acpica/include/acresrc.h
index 001e6d22af51..08ad0964312d 100644
--- a/sys/contrib/dev/acpica/include/acresrc.h
+++ b/sys/contrib/dev/acpica/include/acresrc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acrestyp.h b/sys/contrib/dev/acpica/include/acrestyp.h
index 72f0d1631087..1c8f70ce691a 100644
--- a/sys/contrib/dev/acpica/include/acrestyp.h
+++ b/sys/contrib/dev/acpica/include/acrestyp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acstruct.h b/sys/contrib/dev/acpica/include/acstruct.h
index f7538aded9b2..c675b830ebf8 100644
--- a/sys/contrib/dev/acpica/include/acstruct.h
+++ b/sys/contrib/dev/acpica/include/acstruct.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/actables.h b/sys/contrib/dev/acpica/include/actables.h
index 3269728a7fd0..88e959dc1091 100644
--- a/sys/contrib/dev/acpica/include/actables.h
+++ b/sys/contrib/dev/acpica/include/actables.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/actbl.h b/sys/contrib/dev/acpica/include/actbl.h
index a1d5d8f06c76..39b01c2d238f 100644
--- a/sys/contrib/dev/acpica/include/actbl.h
+++ b/sys/contrib/dev/acpica/include/actbl.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/actbl1.h b/sys/contrib/dev/acpica/include/actbl1.h
index 0fe925a84bf5..c27f49966938 100644
--- a/sys/contrib/dev/acpica/include/actbl1.h
+++ b/sys/contrib/dev/acpica/include/actbl1.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/actbl2.h b/sys/contrib/dev/acpica/include/actbl2.h
index 625d33fab9ce..86d3a43f96ba 100644
--- a/sys/contrib/dev/acpica/include/actbl2.h
+++ b/sys/contrib/dev/acpica/include/actbl2.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/actbl3.h b/sys/contrib/dev/acpica/include/actbl3.h
index ef40f19fc0a3..65711de1c631 100644
--- a/sys/contrib/dev/acpica/include/actbl3.h
+++ b/sys/contrib/dev/acpica/include/actbl3.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h
index 0d2ab4cc8ad4..ca96eb6796a9 100644
--- a/sys/contrib/dev/acpica/include/actypes.h
+++ b/sys/contrib/dev/acpica/include/actypes.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h
index 1cc760fb6724..21bc9e4fecf1 100644
--- a/sys/contrib/dev/acpica/include/acutils.h
+++ b/sys/contrib/dev/acpica/include/acutils.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acuuid.h b/sys/contrib/dev/acpica/include/acuuid.h
index 5c42990ab934..5c2e31376ea7 100644
--- a/sys/contrib/dev/acpica/include/acuuid.h
+++ b/sys/contrib/dev/acpica/include/acuuid.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/amlcode.h b/sys/contrib/dev/acpica/include/amlcode.h
index 640029b44280..401dfc3fb4de 100644
--- a/sys/contrib/dev/acpica/include/amlcode.h
+++ b/sys/contrib/dev/acpica/include/amlcode.h
@@ -7,7 +7,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/amlresrc.h b/sys/contrib/dev/acpica/include/amlresrc.h
index 960da1b31076..79aa5ba40c91 100644
--- a/sys/contrib/dev/acpica/include/amlresrc.h
+++ b/sys/contrib/dev/acpica/include/amlresrc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/platform/acenv.h b/sys/contrib/dev/acpica/include/platform/acenv.h
index 06438700e681..58d5351c25a9 100644
--- a/sys/contrib/dev/acpica/include/platform/acenv.h
+++ b/sys/contrib/dev/acpica/include/platform/acenv.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/platform/acenvex.h b/sys/contrib/dev/acpica/include/platform/acenvex.h
index d7da594b926e..0261b0ce9e36 100644
--- a/sys/contrib/dev/acpica/include/platform/acenvex.h
+++ b/sys/contrib/dev/acpica/include/platform/acenvex.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/platform/acfreebsd.h b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
index 928aaa64bd54..211b379361c4 100644
--- a/sys/contrib/dev/acpica/include/platform/acfreebsd.h
+++ b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/platform/acgcc.h b/sys/contrib/dev/acpica/include/platform/acgcc.h
index 732de2aabffb..c053aa934948 100644
--- a/sys/contrib/dev/acpica/include/platform/acgcc.h
+++ b/sys/contrib/dev/acpica/include/platform/acgcc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/platform/acgccex.h b/sys/contrib/dev/acpica/include/platform/acgccex.h
index 3c02ad50649f..c17d93fb786e 100644
--- a/sys/contrib/dev/acpica/include/platform/acgccex.h
+++ b/sys/contrib/dev/acpica/include/platform/acgccex.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
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 0e9bfa65ec0c..64ac4fc19a61 100644
--- a/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
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 1b05ef079101..571cce5b6b5d 100644
--- a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2016, Intel Corp.
+ * Copyright (C) 2000 - 2017, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -370,7 +370,7 @@ AcpiOsPhysicalTableOverride (
* RETURN: Status
*
* DESCRIPTION: A hook before writing sleep registers to enter the sleep
- * state. Return AE_CTRL_SKIP to skip further sleep register
+ * state. Return AE_CTRL_TERMINATE to skip further sleep register
* writes.
*
*****************************************************************************/
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index fe165c3daf84..0dcf1a24d13c 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -1178,7 +1178,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
sc->sc_has_ldpc = 1;
device_printf(sc->sc_dev,
"[HT] LDPC transmit/receive enabled\n");
- ic->ic_htcaps |= IEEE80211_HTCAP_LDPC;
+ ic->ic_htcaps |= IEEE80211_HTCAP_LDPC |
+ IEEE80211_HTC_TXLDPC;
}
@@ -1638,6 +1639,7 @@ ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
* However, for now that's enforced by the TX path.
*/
vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K;
+ vap->iv_ampdu_limit = IEEE80211_HTCAP_MAXRXAMPDU_64K;
avp->av_bslot = -1;
if (needbeacon) {
diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c
index 5226d4d52ad6..ff79b78817dd 100644
--- a/sys/dev/ath/if_ath_tx_ht.c
+++ b/sys/dev/ath/if_ath_tx_ht.c
@@ -239,7 +239,7 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf)
* it if any of the rate entries aren't 11n.
*/
do_ldpc = 0;
- if ((ni->ni_vap->iv_htcaps & IEEE80211_HTCAP_LDPC) &&
+ if ((ni->ni_vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX) &&
(ni->ni_htcap & IEEE80211_HTCAP_LDPC))
do_ldpc = 1;
@@ -402,7 +402,7 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf)
*/
static int
ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf,
- uint16_t pktlen)
+ uint16_t pktlen, int is_first)
{
#define MS(_v, _f) (((_v) & _f) >> _f##_S)
const HAL_RATE_TABLE *rt = sc->sc_currates;
@@ -458,11 +458,12 @@ ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf,
* For AR9380, there's a minimum number of delimeters
* required when doing RTS.
*
- * XXX TODO: this is only needed if (a) RTS/CTS is enabled, and
- * XXX (b) this is the first sub-frame in the aggregate.
+ * XXX TODO: this is only needed if (a) RTS/CTS is enabled for
+ * this exchange, and (b) (done) this is the first sub-frame
+ * in the aggregate.
*/
if (sc->sc_use_ent && (sc->sc_ent_cfg & AH_ENT_RTSCTS_DELIM_WAR)
- && ndelim < AH_FIRST_DESC_NDELIMS)
+ && ndelim < AH_FIRST_DESC_NDELIMS && is_first)
ndelim = AH_FIRST_DESC_NDELIMS;
/*
@@ -589,8 +590,14 @@ ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni,
amin = MIN(amin, bf->bf_state.bfs_rc[i].max4msframelen);
}
- DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: max frame len= %d\n",
- __func__, amin);
+ DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
+ "%s: aggr_limit=%d, iv_ampdu_limit=%d, "
+ "peer maxrxampdu=%d, max frame len=%d\n",
+ __func__,
+ sc->sc_aggr_limit,
+ vap->iv_ampdu_limit,
+ MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU),
+ amin);
return amin;
#undef MS
@@ -969,7 +976,7 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an,
*/
bf->bf_state.bfs_ndelim =
ath_compute_num_delims(sc, bf_first,
- bf->bf_state.bfs_pktlen);
+ bf->bf_state.bfs_pktlen, (bf_first == bf));
/*
* Calculate the padding needed from this set of delimiters,
diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c
index 836c9cb6fcf4..0368cef10d8f 100644
--- a/sys/dev/cxgbe/tom/t4_listen.c
+++ b/sys/dev/cxgbe/tom/t4_listen.c
@@ -1418,6 +1418,7 @@ found:
if (!(synqe->flags & TPF_SYNQE_EXPANDED))
send_reset_synqe(tod, synqe);
INP_WUNLOCK(inp);
+ CURVNET_RESTORE();
release_synqe(synqe); /* extra hold */
return (__LINE__);
diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c
index 24538cadca2a..5d68e8b9718c 100644
--- a/sys/dev/e1000/e1000_82575.c
+++ b/sys/dev/e1000/e1000_82575.c
@@ -101,7 +101,6 @@ static s32 e1000_validate_nvm_checksum_with_offset(struct e1000_hw *hw,
u16 offset);
static s32 e1000_validate_nvm_checksum_i350(struct e1000_hw *hw);
static s32 e1000_update_nvm_checksum_i350(struct e1000_hw *hw);
-static void e1000_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value);
static void e1000_clear_vfta_i350(struct e1000_hw *hw);
static void e1000_i2c_start(struct e1000_hw *hw);
diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h
index 45fe132e4a40..f81795605c01 100644
--- a/sys/dev/e1000/e1000_82575.h
+++ b/sys/dev/e1000/e1000_82575.h
@@ -493,6 +493,7 @@ enum e1000_promisc_type {
void e1000_vfta_set_vf(struct e1000_hw *, u16, bool);
void e1000_rlpml_set_vf(struct e1000_hw *, u16);
s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type);
+void e1000_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value);
u16 e1000_rxpbs_adjust_82580(u32 data);
s32 e1000_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data);
s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M);
diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h
index e33fe0fb7982..4c2b09038551 100644
--- a/sys/dev/e1000/e1000_defines.h
+++ b/sys/dev/e1000/e1000_defines.h
@@ -469,6 +469,8 @@
#define ETHERNET_FCS_SIZE 4
#define MAX_JUMBO_FRAME_SIZE 0x3F00
+/* The datasheet maximum supported RX size is 9.5KB (9728 bytes) */
+#define MAX_RX_JUMBO_FRAME_SIZE 0x2600
#define E1000_TX_PTR_GAP 0x1F
/* Extended Configuration Control and Size */
diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c
index 4c50ce296385..0d8485ff3fa0 100644
--- a/sys/dev/e1000/e1000_ich8lan.c
+++ b/sys/dev/e1000/e1000_ich8lan.c
@@ -243,8 +243,7 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw)
if (ret_val)
return FALSE;
out:
- if ((hw->mac.type == e1000_pch_lpt) ||
- (hw->mac.type == e1000_pch_spt)) {
+ if (hw->mac.type >= e1000_pch_lpt) {
/* Only unforce SMBus if ME is not active */
if (!(E1000_READ_REG(hw, E1000_FWSM) &
E1000_ICH_FWSM_FW_VALID)) {
@@ -641,7 +640,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
nvm->type = e1000_nvm_flash_sw;
- if (hw->mac.type == e1000_pch_spt) {
+ if (hw->mac.type >= e1000_pch_spt) {
/* in SPT, gfpreg doesn't exist. NVM size is taken from the
* STRAP register. This is because in SPT the GbE Flash region
* is no longer accessed through the flash registers. Instead,
@@ -701,7 +700,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
/* Function Pointers */
nvm->ops.acquire = e1000_acquire_nvm_ich8lan;
nvm->ops.release = e1000_release_nvm_ich8lan;
- if (hw->mac.type == e1000_pch_spt) {
+ if (hw->mac.type >= e1000_pch_spt) {
nvm->ops.read = e1000_read_nvm_spt;
nvm->ops.update = e1000_update_nvm_checksum_spt;
} else {
@@ -815,8 +814,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
break;
}
- if ((mac->type == e1000_pch_lpt) ||
- (mac->type == e1000_pch_spt)) {
+ if (mac->type >= e1000_pch_lpt) {
mac->rar_entry_count = E1000_PCH_LPT_RAR_ENTRIES;
mac->ops.rar_set = e1000_rar_set_pch_lpt;
mac->ops.setup_physical_interface = e1000_setup_copper_link_pch_lpt;
@@ -1576,9 +1574,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
* aggressive resulting in many collisions. To avoid this, increase
* the IPG and reduce Rx latency in the PHY.
*/
- if (((hw->mac.type == e1000_pch2lan) ||
- (hw->mac.type == e1000_pch_lpt) ||
- (hw->mac.type == e1000_pch_spt)) && link) {
+ if ((hw->mac.type >= e1000_pch2lan) && link) {
u16 speed, duplex;
e1000_get_speed_and_duplex_copper_generic(hw, &speed, &duplex);
@@ -1589,7 +1585,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
tipg_reg |= 0xFF;
/* Reduce Rx latency in analog PHY */
emi_val = 0;
- } else if (hw->mac.type == e1000_pch_spt &&
+ } else if (hw->mac.type >= e1000_pch_spt &&
duplex == FULL_DUPLEX && speed != SPEED_1000) {
tipg_reg |= 0xC;
emi_val = 1;
@@ -1611,8 +1607,8 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
emi_addr = I217_RX_CONFIG;
ret_val = e1000_write_emi_reg_locked(hw, emi_addr, emi_val);
- if (hw->mac.type == e1000_pch_lpt ||
- hw->mac.type == e1000_pch_spt) {
+
+ if (hw->mac.type >= e1000_pch_lpt) {
u16 phy_reg;
hw->phy.ops.read_reg_locked(hw, I217_PLL_CLOCK_GATE_REG,
@@ -1641,7 +1637,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
if (ret_val)
return ret_val;
- if (hw->mac.type == e1000_pch_spt) {
+ if (hw->mac.type >= e1000_pch_spt) {
u16 data;
u16 ptr_gap;
@@ -1690,8 +1686,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
* on power up.
* Set the Beacon Duration for I217 to 8 usec
*/
- if ((hw->mac.type == e1000_pch_lpt) ||
- (hw->mac.type == e1000_pch_spt)) {
+ if (hw->mac.type >= e1000_pch_lpt) {
u32 mac_reg;
mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM4);
@@ -1709,8 +1704,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
if (ret_val)
return ret_val;
}
- if ((hw->mac.type == e1000_pch_lpt) ||
- (hw->mac.type == e1000_pch_spt)) {
+ if (hw->mac.type >= e1000_pch_lpt) {
/* Set platform power management values for
* Latency Tolerance Reporting (LTR)
* Optimized Buffer Flush/Fill (OBFF)
@@ -1723,15 +1717,20 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
/* Clear link partner's EEE ability */
hw->dev_spec.ich8lan.eee_lp_ability = 0;
- /* FEXTNVM6 K1-off workaround */
- if (hw->mac.type == e1000_pch_spt) {
- u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG);
+ if (hw->mac.type >= e1000_pch_lpt) {
u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6);
- if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) &&
- (hw->dev_spec.ich8lan.disable_k1_off == FALSE))
- fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE;
- else
+ if (hw->mac.type == e1000_pch_spt) {
+ /* FEXTNVM6 K1-off workaround - for SPT only */
+ u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG);
+
+ if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE)
+ fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE;
+ else
+ fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE;
+ }
+
+ if (hw->dev_spec.ich8lan.disable_k1_off == TRUE)
fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE;
E1000_WRITE_REG(hw, E1000_FEXTNVM6, fextnvm6);
@@ -3671,7 +3670,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
/* Clear FCERR and DAEL in hw status by writing 1 */
hsfsts.hsf_status.flcerr = 1;
hsfsts.hsf_status.dael = 1;
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS,
hsfsts.regval & 0xFFFF);
else
@@ -3691,7 +3690,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
* Begin by setting Flash Cycle Done.
*/
hsfsts.hsf_status.flcdone = 1;
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS,
hsfsts.regval & 0xFFFF);
else
@@ -3718,7 +3717,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
* now set the Flash Cycle Done.
*/
hsfsts.hsf_status.flcdone = 1;
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS,
hsfsts.regval & 0xFFFF);
else
@@ -3748,13 +3747,13 @@ static s32 e1000_flash_cycle_ich8lan(struct e1000_hw *hw, u32 timeout)
DEBUGFUNC("e1000_flash_cycle_ich8lan");
/* Start a cycle by writing 1 in Flash Cycle Go in Hw Flash Control */
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
hsflctl.regval = E1000_READ_FLASH_REG(hw, ICH_FLASH_HSFSTS)>>16;
else
hsflctl.regval = E1000_READ_FLASH_REG16(hw, ICH_FLASH_HSFCTL);
hsflctl.hsf_ctrl.flcgo = 1;
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS,
hsflctl.regval << 16);
else
@@ -3837,7 +3836,7 @@ static s32 e1000_read_flash_byte_ich8lan(struct e1000_hw *hw, u32 offset,
/* In SPT, only 32 bits access is supported,
* so this function should not be called.
*/
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
return -E1000_ERR_NVM;
else
ret_val = e1000_read_flash_data_ich8lan(hw, offset, 1, &word);
@@ -3946,7 +3945,7 @@ static s32 e1000_read_flash_data32_ich8lan(struct e1000_hw *hw, u32 offset,
DEBUGFUNC("e1000_read_flash_data_ich8lan");
if (offset > ICH_FLASH_LINEAR_ADDR_MASK ||
- hw->mac.type != e1000_pch_spt)
+ hw->mac.type < e1000_pch_spt)
return -E1000_ERR_NVM;
flash_linear_addr = ((ICH_FLASH_LINEAR_ADDR_MASK & offset) +
hw->nvm.flash_base_addr);
@@ -4434,7 +4433,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
DEBUGFUNC("e1000_write_ich8_data");
- if (hw->mac.type == e1000_pch_spt) {
+ if (hw->mac.type >= e1000_pch_spt) {
if (size != 4 || offset > ICH_FLASH_LINEAR_ADDR_MASK)
return -E1000_ERR_NVM;
} else {
@@ -4454,7 +4453,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
/* In SPT, This register is in Lan memory space, not
* flash. Therefore, only 32 bit access is supported
*/
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
hsflctl.regval =
E1000_READ_FLASH_REG(hw, ICH_FLASH_HSFSTS)>>16;
else
@@ -4468,7 +4467,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
* not flash. Therefore, only 32 bit access is
* supported
*/
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS,
hsflctl.regval << 16);
else
@@ -4530,7 +4529,7 @@ static s32 e1000_write_flash_data32_ich8lan(struct e1000_hw *hw, u32 offset,
DEBUGFUNC("e1000_write_flash_data32_ich8lan");
- if (hw->mac.type == e1000_pch_spt) {
+ if (hw->mac.type >= e1000_pch_spt) {
if (offset > ICH_FLASH_LINEAR_ADDR_MASK)
return -E1000_ERR_NVM;
}
@@ -4546,7 +4545,7 @@ static s32 e1000_write_flash_data32_ich8lan(struct e1000_hw *hw, u32 offset,
/* In SPT, This register is in Lan memory space, not
* flash. Therefore, only 32 bit access is supported
*/
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
hsflctl.regval = E1000_READ_FLASH_REG(hw,
ICH_FLASH_HSFSTS)
>> 16;
@@ -4561,7 +4560,7 @@ static s32 e1000_write_flash_data32_ich8lan(struct e1000_hw *hw, u32 offset,
* not flash. Therefore, only 32 bit access is
* supported
*/
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS,
hsflctl.regval << 16);
else
@@ -4763,7 +4762,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
/* Write a value 11 (block Erase) in Flash
* Cycle field in hw flash control
*/
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
hsflctl.regval =
E1000_READ_FLASH_REG(hw,
ICH_FLASH_HSFSTS)>>16;
@@ -4773,7 +4772,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
ICH_FLASH_HSFCTL);
hsflctl.hsf_ctrl.flcycle = ICH_CYCLE_ERASE;
- if (hw->mac.type == e1000_pch_spt)
+ if (hw->mac.type >= e1000_pch_spt)
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS,
hsflctl.regval << 16);
else
@@ -5211,8 +5210,7 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
E1000_WRITE_REG(hw, E1000_RFCTL, reg);
/* Enable ECC on Lynxpoint */
- if ((hw->mac.type == e1000_pch_lpt) ||
- (hw->mac.type == e1000_pch_spt)) {
+ if (hw->mac.type >= e1000_pch_lpt) {
reg = E1000_READ_REG(hw, E1000_PBECCSTS);
reg |= E1000_PBECCSTS_ECC_ENABLE;
E1000_WRITE_REG(hw, E1000_PBECCSTS, reg);
@@ -5645,7 +5643,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
(device_id == E1000_DEV_ID_PCH_LPTLP_I218_V) ||
(device_id == E1000_DEV_ID_PCH_I218_LM3) ||
(device_id == E1000_DEV_ID_PCH_I218_V3) ||
- (hw->mac.type == e1000_pch_spt)) {
+ (hw->mac.type >= e1000_pch_spt)) {
u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6);
E1000_WRITE_REG(hw, E1000_FEXTNVM6,
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index e874fc31474a..9ddf08bb2249 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -159,6 +159,10 @@ static pci_vendor_info_t em_vendor_info_array[] =
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) PRO/1000 Network Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) PRO/1000 Network Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) PRO/1000 Network Connection"),
+ PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) PRO/1000 Network Connection"),
+ PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"),
+ PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"),
+ PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"),
/* required last entry */
PVID_END
};
diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h
index d7290fd72455..cf9d13cbf3e0 100644
--- a/sys/dev/e1000/if_em.h
+++ b/sys/dev/e1000/if_em.h
@@ -436,7 +436,7 @@ struct adapter {
#define intr_type shared->isc_intr
/* FreeBSD operating-system-specific structures. */
struct e1000_osdep osdep;
- struct device *dev;
+ device_t dev;
struct cdev *led_dev;
struct em_tx_queue *tx_queues;
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index cf2231dc8fc8..f54dbf7f573f 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -3878,6 +3878,7 @@ ixgbe_handle_msf(void *context, int pending)
/* Adjust media types shown in ifconfig */
ifmedia_removeall(&adapter->media);
ixgbe_add_media_types(adapter);
+ ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO);
IXGBE_CORE_UNLOCK(adapter);
return;
}
diff --git a/sys/dev/mlx5/cq.h b/sys/dev/mlx5/cq.h
index 85e48466806d..60819f70f306 100644
--- a/sys/dev/mlx5/cq.h
+++ b/sys/dev/mlx5/cq.h
@@ -88,6 +88,7 @@ enum {
MLX5_CQ_MODIFY_PERIOD = 1 << 0,
MLX5_CQ_MODIFY_COUNT = 1 << 1,
MLX5_CQ_MODIFY_OVERRUN = 1 << 2,
+ MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4,
};
enum {
@@ -165,6 +166,11 @@ int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev,
struct mlx5_core_cq *cq, u16 cq_period,
u16 cq_max_count);
+int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev,
+ struct mlx5_core_cq *cq,
+ u16 cq_period,
+ u16 cq_max_count,
+ u8 cq_mode);
int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cq.c b/sys/dev/mlx5/mlx5_core/mlx5_cq.c
index bab3f2942677..5a7b39d7e323 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_cq.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_cq.c
@@ -266,6 +266,28 @@ int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev,
return mlx5_core_modify_cq(dev, cq, &in, sizeof(in));
}
+int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev,
+ struct mlx5_core_cq *cq,
+ u16 cq_period,
+ u16 cq_max_count,
+ u8 cq_mode)
+{
+ struct mlx5_modify_cq_mbox_in in;
+
+ memset(&in, 0, sizeof(in));
+
+ in.cqn = cpu_to_be32(cq->cqn);
+ in.ctx.cq_period = cpu_to_be16(cq_period);
+ in.ctx.cq_max_count = cpu_to_be16(cq_max_count);
+ in.ctx.cqe_sz_flags = (cq_mode & 2) >> 1;
+ in.ctx.st = (cq_mode & 1) << 7;
+ in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD |
+ MLX5_CQ_MODIFY_COUNT |
+ MLX5_CQ_MODIFY_PERIOD_MODE);
+
+ return mlx5_core_modify_cq(dev, cq, &in, sizeof(in));
+}
+
int mlx5_init_cq_table(struct mlx5_core_dev *dev)
{
struct mlx5_cq_table *table = &dev->priv.cq_table;
diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h
index bbb71cae0444..b05d13baff7c 100644
--- a/sys/dev/mlx5/mlx5_en/en.h
+++ b/sys/dev/mlx5/mlx5_en/en.h
@@ -402,6 +402,7 @@ struct mlx5e_params {
m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \
m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \
m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \
+ m(+1, u64 tx_bufring_disable, "tx_bufring_disable", "0: Enable bufring 1: Disable bufring") \
m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \
m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \
m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \
@@ -507,10 +508,11 @@ struct mlx5e_sq {
u16 bf_offset;
u16 cev_counter; /* completion event counter */
u16 cev_factor; /* completion event factor */
- u32 cev_next_state; /* next completion event state */
+ u16 cev_next_state; /* next completion event state */
#define MLX5E_CEV_STATE_INITIAL 0 /* timer not started */
#define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */
#define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */
+ u16 stopped; /* set if SQ is stopped */
struct callout cev_callout;
union {
u32 d32[2];
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
index 45500d786a9a..fef3be71f2b8 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
@@ -92,6 +92,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS)
{
struct mlx5e_priv *priv = arg1;
uint64_t value;
+ int mode_modify;
int was_opened;
int error;
@@ -114,6 +115,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS)
goto done;
}
was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state);
+ mode_modify = MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify);
switch (MLX5_PARAM_OFFSET(arg[arg2])) {
case MLX5_PARAM_OFFSET(rx_coalesce_usecs):
@@ -266,7 +268,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS)
case MLX5_PARAM_OFFSET(rx_coalesce_mode):
/* network interface must be down */
- if (was_opened)
+ if (was_opened != 0 && mode_modify == 0)
mlx5e_close_locked(priv->ifp);
/* import RX coalesce mode */
@@ -276,13 +278,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS)
priv->params_ethtool.rx_coalesce_mode;
/* restart network interface, if any */
- if (was_opened)
- mlx5e_open_locked(priv->ifp);
+ if (was_opened != 0) {
+ if (mode_modify == 0)
+ mlx5e_open_locked(priv->ifp);
+ else
+ error = mlx5e_refresh_channel_params(priv);
+ }
break;
case MLX5_PARAM_OFFSET(tx_coalesce_mode):
/* network interface must be down */
- if (was_opened)
+ if (was_opened != 0 && mode_modify == 0)
mlx5e_close_locked(priv->ifp);
/* import TX coalesce mode */
@@ -292,8 +298,12 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS)
priv->params_ethtool.tx_coalesce_mode;
/* restart network interface, if any */
- if (was_opened)
- mlx5e_open_locked(priv->ifp);
+ if (was_opened != 0) {
+ if (mode_modify == 0)
+ mlx5e_open_locked(priv->ifp);
+ else
+ error = mlx5e_refresh_channel_params(priv);
+ }
break;
case MLX5_PARAM_OFFSET(hw_lro):
@@ -342,6 +352,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS)
mlx5e_open_locked(priv->ifp);
break;
+ case MLX5_PARAM_OFFSET(tx_bufring_disable):
+ /* rangecheck input value */
+ priv->params_ethtool.tx_bufring_disable =
+ priv->params_ethtool.tx_bufring_disable ? 1 : 0;
+
+ /* reconfigure the sendqueues, if any */
+ if (was_opened) {
+ mlx5e_close_locked(priv->ifp);
+ mlx5e_open_locked(priv->ifp);
+ }
+ break;
+
case MLX5_PARAM_OFFSET(tx_completion_fact):
/* network interface must be down */
if (was_opened)
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index d61ada0bc233..fc73c8c3b4ec 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -439,7 +439,8 @@ mlx5e_update_stats_work(struct work_struct *work)
tso_packets += sq_stats->tso_packets;
tso_bytes += sq_stats->tso_bytes;
tx_queue_dropped += sq_stats->dropped;
- tx_queue_dropped += sq_br->br_drops;
+ if (sq_br != NULL)
+ tx_queue_dropped += sq_br->br_drops;
tx_defragged += sq_stats->defragged;
tx_offload_none += sq_stats->csum_offload_none;
}
@@ -987,34 +988,37 @@ mlx5e_create_sq(struct mlx5e_channel *c,
sq->priv = priv;
sq->tc = tc;
- sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN,
- M_WAITOK, &sq->lock);
- if (sq->br == NULL) {
- if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n",
- __func__);
- err = -ENOMEM;
- goto err_free_sq_db;
- }
+ /* check if we should allocate a second packet buffer */
+ if (priv->params_ethtool.tx_bufring_disable == 0) {
+ sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN,
+ M_WAITOK, &sq->lock);
+ if (sq->br == NULL) {
+ if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n",
+ __func__);
+ err = -ENOMEM;
+ goto err_free_sq_db;
+ }
- sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK,
- taskqueue_thread_enqueue, &sq->sq_tq);
- if (sq->sq_tq == NULL) {
- if_printf(c->ifp, "%s: Failed allocating taskqueue\n",
- __func__);
- err = -ENOMEM;
- goto err_free_drbr;
- }
+ sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK,
+ taskqueue_thread_enqueue, &sq->sq_tq);
+ if (sq->sq_tq == NULL) {
+ if_printf(c->ifp, "%s: Failed allocating taskqueue\n",
+ __func__);
+ err = -ENOMEM;
+ goto err_free_drbr;
+ }
- TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq);
+ TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq);
#ifdef RSS
- cpu_id = rss_getcpu(c->ix % rss_getnumbuckets());
- CPU_SETOF(cpu_id, &cpu_mask);
- taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask,
- "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id);
+ cpu_id = rss_getcpu(c->ix % rss_getnumbuckets());
+ CPU_SETOF(cpu_id, &cpu_mask);
+ taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask,
+ "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id);
#else
- taskqueue_start_threads(&sq->sq_tq, 1, PI_NET,
- "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc);
+ taskqueue_start_threads(&sq->sq_tq, 1, PI_NET,
+ "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc);
#endif
+ }
snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc);
mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet),
buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM,
@@ -1047,9 +1051,12 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq)
mlx5e_free_sq_db(sq);
mlx5_wq_destroy(&sq->wq_ctrl);
mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar);
- taskqueue_drain(sq->sq_tq, &sq->sq_task);
- taskqueue_free(sq->sq_tq);
- buf_ring_free(sq->br, M_MLX5EN);
+ if (sq->sq_tq != NULL) {
+ taskqueue_drain(sq->sq_tq, &sq->sq_task);
+ taskqueue_free(sq->sq_tq);
+ }
+ if (sq->br != NULL)
+ buf_ring_free(sq->br, M_MLX5EN);
}
int
@@ -1184,7 +1191,6 @@ done:
mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0);
sq->doorbell.d64 = 0;
}
- return;
}
void
@@ -1219,8 +1225,25 @@ mlx5e_sq_cev_timeout(void *arg)
void
mlx5e_drain_sq(struct mlx5e_sq *sq)
{
+ int error;
+
+ /*
+ * Check if already stopped.
+ *
+ * NOTE: The "stopped" variable is only written when both the
+ * priv's configuration lock and the SQ's lock is locked. It
+ * can therefore safely be read when only one of the two locks
+ * is locked. This function is always called when the priv's
+ * configuration lock is locked.
+ */
+ if (sq->stopped != 0)
+ return;
mtx_lock(&sq->lock);
+
+ /* don't put more packets into the SQ */
+ sq->stopped = 1;
+
/* teardown event factor timer, if any */
sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS;
callout_stop(&sq->cev_callout);
@@ -1232,14 +1255,29 @@ mlx5e_drain_sq(struct mlx5e_sq *sq)
/* make sure it is safe to free the callout */
callout_drain(&sq->cev_callout);
+ /* wait till SQ is empty or link is down */
+ mtx_lock(&sq->lock);
+ while (sq->cc != sq->pc &&
+ (sq->priv->media_status_last & IFM_ACTIVE) != 0) {
+ mtx_unlock(&sq->lock);
+ msleep(1);
+ sq->cq.mcq.comp(&sq->cq.mcq);
+ mtx_lock(&sq->lock);
+ }
+ mtx_unlock(&sq->lock);
+
/* error out remaining requests */
- mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR);
+ error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR);
+ if (error != 0) {
+ if_printf(sq->ifp,
+ "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error);
+ }
/* wait till SQ is empty */
mtx_lock(&sq->lock);
while (sq->cc != sq->pc) {
mtx_unlock(&sq->lock);
- msleep(4);
+ msleep(1);
sq->cq.mcq.comp(&sq->cq.mcq);
mtx_lock(&sq->lock);
}
@@ -1465,9 +1503,10 @@ mlx5e_chan_mtx_init(struct mlx5e_channel *c)
for (tc = 0; tc < c->num_tc; tc++) {
struct mlx5e_sq *sq = c->sq + tc;
- mtx_init(&sq->lock, "mlx5tx", MTX_NETWORK_LOCK, MTX_DEF);
- mtx_init(&sq->comp_lock, "mlx5comp", MTX_NETWORK_LOCK,
- MTX_DEF);
+ mtx_init(&sq->lock, "mlx5tx",
+ MTX_NETWORK_LOCK " TX", MTX_DEF);
+ mtx_init(&sq->comp_lock, "mlx5comp",
+ MTX_NETWORK_LOCK " TX", MTX_DEF);
callout_init_mtx(&sq->cev_callout, &sq->lock, 0);
@@ -1766,6 +1805,25 @@ mlx5e_close_channels(struct mlx5e_priv *priv)
static int
mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq)
{
+
+ if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) {
+ uint8_t cq_mode;
+
+ switch (priv->params.tx_cq_moderation_mode) {
+ case 0:
+ cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE;
+ break;
+ default:
+ cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE;
+ break;
+ }
+
+ return (mlx5_core_modify_cq_moderation_mode(priv->mdev, &sq->cq.mcq,
+ priv->params.tx_cq_moderation_usec,
+ priv->params.tx_cq_moderation_pkts,
+ cq_mode));
+ }
+
return (mlx5_core_modify_cq_moderation(priv->mdev, &sq->cq.mcq,
priv->params.tx_cq_moderation_usec,
priv->params.tx_cq_moderation_pkts));
@@ -1774,6 +1832,28 @@ mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq)
static int
mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struct mlx5e_rq *rq)
{
+
+ if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) {
+ uint8_t cq_mode;
+ int retval;
+
+ switch (priv->params.rx_cq_moderation_mode) {
+ case 0:
+ cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE;
+ break;
+ default:
+ cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE;
+ break;
+ }
+
+ retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq,
+ priv->params.rx_cq_moderation_usec,
+ priv->params.rx_cq_moderation_pkts,
+ cq_mode);
+
+ return (retval);
+ }
+
return (mlx5_core_modify_cq_moderation(priv->mdev, &rq->cq.mcq,
priv->params.rx_cq_moderation_usec,
priv->params.rx_cq_moderation_pkts));
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
index eae3d728dff2..fe0eb20ab071 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
@@ -81,11 +81,15 @@ static struct mlx5e_sq *
mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb)
{
struct mlx5e_priv *priv = ifp->if_softc;
+ struct mlx5e_channel * volatile *ppch;
+ struct mlx5e_channel *pch;
u32 ch;
u32 tc;
+ ppch = priv->channel;
+
/* check if channels are successfully opened */
- if (unlikely(priv->channel == NULL))
+ if (unlikely(ppch == NULL))
return (NULL);
/* obtain VLAN information if present */
@@ -123,11 +127,11 @@ mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb)
#endif
}
- /* check if channel is allocated */
- if (unlikely(priv->channel[ch] == NULL))
- return (NULL);
-
- return (&priv->channel[ch]->sq[tc]);
+ /* check if channel is allocated and not stopped */
+ pch = ppch[ch];
+ if (likely(pch != NULL && pch->sq[tc].stopped == 0))
+ return (&pch->sq[tc]);
+ return (NULL);
}
static inline u16
@@ -435,7 +439,8 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget)
sq->cc = sqcc;
- if (atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY))
+ if (sq->sq_tq != NULL &&
+ atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY))
taskqueue_enqueue(sq->sq_tq, &sq->sq_task);
}
@@ -445,18 +450,21 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb)
struct mbuf *next;
int err = 0;
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
- if (mb)
- err = drbr_enqueue(ifp, sq->br, mb);
- return (err);
- }
-
- if (mb != NULL)
+ if (likely(mb != NULL)) {
/*
* If we can't insert mbuf into drbr, try to xmit anyway.
* We keep the error we got so we could return that after xmit.
*/
err = drbr_enqueue(ifp, sq->br, mb);
+ }
+
+ /*
+ * Check if the network interface is closed or if the SQ is
+ * being stopped:
+ */
+ if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
+ sq->stopped != 0))
+ return (err);
/* Process the queue */
while ((next = drbr_peek(ifp, sq->br)) != NULL) {
@@ -470,8 +478,6 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb)
break;
}
drbr_advance(ifp, sq->br);
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
- break;
}
/* Check if we need to write the doorbell */
if (likely(sq->doorbell.d64 != 0)) {
@@ -493,6 +499,45 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb)
return (err);
}
+static int
+mlx5e_xmit_locked_no_br(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb)
+{
+ int err = 0;
+
+ if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
+ sq->stopped != 0)) {
+ m_freem(mb);
+ return (ENETDOWN);
+ }
+
+ /* Do transmit */
+ if (mlx5e_sq_xmit(sq, &mb) != 0) {
+ /* NOTE: m_freem() is NULL safe */
+ m_freem(mb);
+ err = ENOBUFS;
+ }
+
+ /* Check if we need to write the doorbell */
+ if (likely(sq->doorbell.d64 != 0)) {
+ mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0);
+ sq->doorbell.d64 = 0;
+ }
+
+ /*
+ * Check if we need to start the event timer which flushes the
+ * transmit ring on timeout:
+ */
+ if (unlikely(sq->cev_next_state == MLX5E_CEV_STATE_INITIAL &&
+ sq->cev_factor != 1)) {
+ /* start the timer */
+ mlx5e_sq_cev_timeout(sq);
+ } else {
+ /* don't send NOPs yet */
+ sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS;
+ }
+ return (err);
+}
+
int
mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb)
{
@@ -505,7 +550,13 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb)
m_freem(mb);
return (ENXIO);
}
- if (mtx_trylock(&sq->lock)) {
+
+ if (unlikely(sq->br == NULL)) {
+ /* rate limited traffic */
+ mtx_lock(&sq->lock);
+ ret = mlx5e_xmit_locked_no_br(ifp, sq, mb);
+ mtx_unlock(&sq->lock);
+ } else if (mtx_trylock(&sq->lock)) {
ret = mlx5e_xmit_locked(ifp, sq, mb);
mtx_unlock(&sq->lock);
} else {
diff --git a/sys/dev/mlx5/mlx5_ifc.h b/sys/dev/mlx5/mlx5_ifc.h
index cde74d8e0a91..425c86ccafec 100644
--- a/sys/dev/mlx5/mlx5_ifc.h
+++ b/sys/dev/mlx5/mlx5_ifc.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved.
+ * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,13 +23,8 @@
* SUCH DAMAGE.
*
* $FreeBSD$
+ */
- Autogenerated file.
- Date: 2015-04-13 14:59
- Source Document Name: Mellanox <Doc Name>
- Source Document Version: 0.28
- Generated by adb_to_c.py (EAT.ME Version: 1.0.70)
-*/
#ifndef MLX5_IFC_H
#define MLX5_IFC_H
@@ -56,6 +51,8 @@ enum {
MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17,
MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19,
MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e,
+ MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25,
+ MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT = 0x22,
MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a,
MLX5_EVENT_TYPE_STALL_EVENT = 0x1b,
MLX5_EVENT_TYPE_DROPPED_PACKET_LOGGED_EVENT = 0x1f,
@@ -89,6 +86,8 @@ enum {
MLX5_CMD_OP_QUERY_ISSI = 0x10a,
MLX5_CMD_OP_SET_ISSI = 0x10b,
MLX5_CMD_OP_SET_DRIVER_VERSION = 0x10d,
+ MLX5_CMD_OP_QUERY_OTHER_HCA_CAP = 0x10e,
+ MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP = 0x10f,
MLX5_CMD_OP_CREATE_MKEY = 0x200,
MLX5_CMD_OP_QUERY_MKEY = 0x201,
MLX5_CMD_OP_DESTROY_MKEY = 0x202,
@@ -190,6 +189,12 @@ enum {
MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b,
MLX5_CMD_OP_SET_WOL_ROL = 0x830,
MLX5_CMD_OP_QUERY_WOL_ROL = 0x831,
+ MLX5_CMD_OP_CREATE_LAG = 0x840,
+ MLX5_CMD_OP_MODIFY_LAG = 0x841,
+ MLX5_CMD_OP_QUERY_LAG = 0x842,
+ MLX5_CMD_OP_DESTROY_LAG = 0x843,
+ MLX5_CMD_OP_CREATE_VPORT_LAG = 0x844,
+ MLX5_CMD_OP_DESTROY_VPORT_LAG = 0x845,
MLX5_CMD_OP_CREATE_TIR = 0x900,
MLX5_CMD_OP_MODIFY_TIR = 0x901,
MLX5_CMD_OP_DESTROY_TIR = 0x902,
@@ -206,6 +211,8 @@ enum {
MLX5_CMD_OP_MODIFY_RMP = 0x90d,
MLX5_CMD_OP_DESTROY_RMP = 0x90e,
MLX5_CMD_OP_QUERY_RMP = 0x90f,
+ MLX5_CMD_OP_SET_DELAY_DROP_PARAMS = 0x910,
+ MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS = 0x911,
MLX5_CMD_OP_CREATE_TIS = 0x912,
MLX5_CMD_OP_MODIFY_TIS = 0x913,
MLX5_CMD_OP_DESTROY_TIS = 0x914,
@@ -226,7 +233,10 @@ enum {
MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938,
MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939,
MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a,
- MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b
+ MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b,
+ MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c,
+ MLX5_CMD_OP_ALLOC_ENCAP_HEADER = 0x93d,
+ MLX5_CMD_OP_DEALLOC_ENCAP_HEADER = 0x93e,
};
enum {
@@ -271,7 +281,11 @@ struct mlx5_ifc_flow_table_fields_supported_bits {
u8 outer_gre_protocol[0x1];
u8 outer_gre_key[0x1];
u8 outer_vxlan_vni[0x1];
- u8 reserved_2[0x5];
+ u8 outer_geneve_vni[0x1];
+ u8 outer_geneve_oam[0x1];
+ u8 outer_geneve_protocol_type[0x1];
+ u8 outer_geneve_opt_len[0x1];
+ u8 reserved_2[0x1];
u8 source_eswitch_port[0x1];
u8 inner_dmac[0x1];
@@ -299,10 +313,12 @@ struct mlx5_ifc_flow_table_fields_supported_bits {
u8 inner_tcp_flags[0x1];
u8 reserved_5[0x9];
- u8 reserved_6[0x1f];
+ u8 reserved_6[0x1a];
+ u8 bth_dst_qp[0x1];
+ u8 reserved_7[0x4];
u8 source_sqn[0x1];
- u8 reserved_7[0x20];
+ u8 reserved_8[0x20];
};
struct mlx5_ifc_eth_discard_cntrs_grp_bits {
@@ -356,7 +372,11 @@ struct mlx5_ifc_eth_discard_cntrs_grp_bits {
u8 egress_stp_filter_low[0x20];
- u8 reserved_at_340[0x480];
+ u8 egress_hoq_stall_high[0x20];
+
+ u8 egress_hoq_stall_low[0x20];
+
+ u8 reserved_at_340[0x440];
};
struct mlx5_ifc_flow_table_prop_layout_bits {
u8 ft_support[0x1];
@@ -411,6 +431,7 @@ enum {
MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0x0,
MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE = 0x1,
MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 0x2,
+ MLX5_FLOW_CONTEXT_DEST_TYPE_QP = 0x3,
};
struct mlx5_ifc_dest_format_struct_bits {
@@ -490,9 +511,14 @@ struct mlx5_ifc_fte_match_set_misc_bits {
u8 reserved_6[0xc];
u8 inner_ipv6_flow_label[0x14];
- u8 reserved7[0x10];
+ u8 reserved_7[0xa];
+ u8 geneve_opt_len[0x6];
u8 geneve_protocol_type[0x10];
- u8 reserved8[0xc0];
+
+ u8 reserved_8[0x8];
+ u8 bth_dst_qp[0x18];
+
+ u8 reserved_9[0xa0];
};
struct mlx5_ifc_cmd_pas_bits {
@@ -698,7 +724,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
u8 lro_psh_flag[0x1];
u8 lro_time_stamp[0x1];
u8 lro_max_msg_sz_mode[0x2];
- u8 reserved_0[0x2];
+ u8 wqe_vlan_insert[0x1];
+ u8 self_lb_en_modifiable[0x1];
u8 self_lb_mc[0x1];
u8 self_lb_uc[0x1];
u8 max_lso_cap[0x5];
@@ -715,7 +742,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
u8 swp[0x1];
u8 swp_csum[0x1];
u8 swp_lso[0x1];
- u8 reserved_2[0x1c];
+ u8 reserved_2[0x1b];
+ u8 max_geneve_opt_len[0x1];
u8 tunnel_stateless_geneve_rx[0x1];
u8 reserved_3[0x10];
@@ -910,7 +938,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 vport_counters[0x1];
u8 retransmission_q_counters[0x1];
u8 debug[0x1];
- u8 reserved_16[0x2];
+ u8 modify_rq_counters_set_id[0x1];
+ u8 rq_delay_drop[0x1];
u8 max_qp_cnt[0xa];
u8 pkey_table_size[0x10];
@@ -980,7 +1009,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 cq_oi[0x1];
u8 cq_resize[0x1];
u8 cq_moderation[0x1];
- u8 reserved_31[0x3];
+ u8 cq_period_mode_modify[0x1];
+ u8 cq_invalidate[0x1];
+ u8 reserved_at_225[0x1];
u8 cq_eq_remap[0x1];
u8 pg[0x1];
u8 block_lb_mc[0x1];
@@ -1068,7 +1099,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 log_max_wq_sz[0x5];
u8 nic_vport_change_event[0x1];
- u8 reserved_59[0xa];
+ u8 disable_local_lb[0x1];
+ u8 reserved_59[0x9];
u8 log_max_vlan_list[0x5];
u8 reserved_60[0x3];
u8 log_max_current_mc_list[0x5];
@@ -1312,6 +1344,8 @@ enum {
MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_MAX_COUNT = 0x2,
MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_OI = 0x4,
MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_C_EQN = 0x8,
+ MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_PERIOD_MODE = 0x10,
+ MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_STATUS = 0x20,
};
struct mlx5_ifc_modify_field_select_bits {
@@ -2239,9 +2273,15 @@ enum {
MLX5_RQC_STATE_ERR = 0x3,
};
+enum {
+ MLX5_RQC_DROPLESS_MODE_DISABLE = 0x0,
+ MLX5_RQC_DROPLESS_MODE_ENABLE = 0x1,
+};
+
struct mlx5_ifc_rqc_bits {
- u8 rlky[0x1];
- u8 reserved_0[0x2];
+ u8 rlkey[0x1];
+ u8 delay_drop_en[0x1];
+ u8 scatter_fcs[0x1];
u8 vlan_strip_disable[0x1];
u8 mem_rq_type[0x4];
u8 state[0x4];
@@ -2293,7 +2333,9 @@ enum {
struct mlx5_ifc_nic_vport_context_bits {
u8 reserved_0[0x5];
u8 min_wqe_inline_mode[0x3];
- u8 reserved_1[0x17];
+ u8 reserved_1[0x15];
+ u8 disable_mc_local_lb[0x1];
+ u8 disable_uc_local_lb[0x1];
u8 roce_en[0x1];
u8 arm_change_event[0x1];
@@ -3075,6 +3117,50 @@ struct mlx5_ifc_teardown_hca_in_bits {
u8 reserved_3[0x20];
};
+struct mlx5_ifc_set_delay_drop_params_out_bits {
+ u8 status[0x8];
+ u8 reserved_at_8[0x18];
+
+ u8 syndrome[0x20];
+
+ u8 reserved_at_40[0x40];
+};
+
+struct mlx5_ifc_set_delay_drop_params_in_bits {
+ u8 opcode[0x10];
+ u8 reserved_at_10[0x10];
+
+ u8 reserved_at_20[0x10];
+ u8 op_mod[0x10];
+
+ u8 reserved_at_40[0x20];
+
+ u8 reserved_at_60[0x10];
+ u8 delay_drop_timeout[0x10];
+};
+
+struct mlx5_ifc_query_delay_drop_params_out_bits {
+ u8 status[0x8];
+ u8 reserved_at_8[0x18];
+
+ u8 syndrome[0x20];
+
+ u8 reserved_at_40[0x20];
+
+ u8 reserved_at_60[0x10];
+ u8 delay_drop_timeout[0x10];
+};
+
+struct mlx5_ifc_query_delay_drop_params_in_bits {
+ u8 opcode[0x10];
+ u8 reserved_at_10[0x10];
+
+ u8 reserved_at_20[0x10];
+ u8 op_mod[0x10];
+
+ u8 reserved_at_40[0x40];
+};
+
struct mlx5_ifc_suspend_qp_out_bits {
u8 status[0x8];
u8 reserved_0[0x18];
@@ -4076,31 +4162,39 @@ struct mlx5_ifc_query_q_counter_out_bits {
u8 out_of_buffer[0x20];
- u8 reserved_7[0x20];
+ u8 reserved_7[0x20];
u8 out_of_sequence[0x20];
- u8 reserved_8[0x20];
+ u8 reserved_8[0x20];
- u8 duplicate_request[0x20];
+ u8 duplicate_request[0x20];
- u8 reserved_9[0x20];
+ u8 reserved_9[0x20];
- u8 rnr_nak_retry_err[0x20];
+ u8 rnr_nak_retry_err[0x20];
- u8 reserved_10[0x20];
+ u8 reserved_10[0x20];
- u8 packet_seq_err[0x20];
+ u8 packet_seq_err[0x20];
- u8 reserved_11[0x20];
+ u8 reserved_11[0x20];
- u8 implied_nak_seq_err[0x20];
+ u8 implied_nak_seq_err[0x20];
- u8 reserved_12[0x20];
+ u8 reserved_12[0x20];
+
+ u8 local_ack_timeout_err[0x20];
+
+ u8 reserved_13[0x20];
+
+ u8 resp_rnr_nak[0x20];
+
+ u8 reserved_14[0x20];
- u8 local_ack_timeout_err[0x20];
+ u8 req_rnr_retries_exceeded[0x20];
- u8 reserved_13[0x4e0];
+ u8 reserved_15[0x460];
};
struct mlx5_ifc_query_q_counter_in_bits {
@@ -5204,7 +5298,9 @@ struct mlx5_ifc_modify_nic_vport_context_out_bits {
};
struct mlx5_ifc_modify_nic_vport_field_select_bits {
- u8 reserved_0[0x16];
+ u8 reserved_0[0x14];
+ u8 disable_uc_local_lb[0x1];
+ u8 disable_mc_local_lb[0x1];
u8 node_guid[0x1];
u8 port_guid[0x1];
u8 min_wqe_inline_mode[0x1];
@@ -7958,6 +8054,42 @@ struct mlx5_ifc_phys_layer_cntrs_bits {
u8 reserved_0[0x180];
};
+struct mlx5_ifc_phys_layer_statistical_cntrs_bits {
+ u8 time_since_last_clear_high[0x20];
+
+ u8 time_since_last_clear_low[0x20];
+
+ u8 phy_received_bits_high[0x20];
+
+ u8 phy_received_bits_low[0x20];
+
+ u8 phy_symbol_errors_high[0x20];
+
+ u8 phy_symbol_errors_low[0x20];
+
+ u8 phy_corrected_bits_high[0x20];
+
+ u8 phy_corrected_bits_low[0x20];
+
+ u8 phy_corrected_bits_lane0_high[0x20];
+
+ u8 phy_corrected_bits_lane0_low[0x20];
+
+ u8 phy_corrected_bits_lane1_high[0x20];
+
+ u8 phy_corrected_bits_lane1_low[0x20];
+
+ u8 phy_corrected_bits_lane2_high[0x20];
+
+ u8 phy_corrected_bits_lane2_low[0x20];
+
+ u8 phy_corrected_bits_lane3_high[0x20];
+
+ u8 phy_corrected_bits_lane3_low[0x20];
+
+ u8 reserved_at_200[0x5c0];
+};
+
struct mlx5_ifc_infiniband_port_cntrs_bits {
u8 symbol_error_counter[0x10];
u8 link_error_recovery_counter[0x8];
@@ -9187,6 +9319,7 @@ union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits {
struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp;
struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout;
struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs;
+ struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs;
struct mlx5_ifc_infiniband_port_cntrs_bits infiniband_port_cntrs;
u8 reserved_0[0x7c0];
};
diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c
index 72219ee1b8aa..09971faa6b03 100644
--- a/sys/dev/mpr/mpr_sas.c
+++ b/sys/dev/mpr/mpr_sas.c
@@ -349,7 +349,7 @@ mprsas_log_command(struct mpr_command *cm, u_int level, const char *fmt, ...)
sbuf_printf(&sb, "SMID %u ", cm->cm_desc.Default.SMID);
sbuf_vprintf(&sb, fmt, ap);
sbuf_finish(&sb);
- mpr_dprint_field(cm->cm_sc, level, "%s", sbuf_data(&sb));
+ mpr_print_field(cm->cm_sc, "%s", sbuf_data(&sb));
va_end(ap);
}
diff --git a/sys/dev/mpr/mpr_table.c b/sys/dev/mpr/mpr_table.c
index de715259de79..d7920034ac64 100644
--- a/sys/dev/mpr/mpr_table.c
+++ b/sys/dev/mpr/mpr_table.c
@@ -197,27 +197,26 @@ mpr_describe_devinfo(uint32_t devinfo, char *string, int len)
}
void
-mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
+_mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
{
-
MPR_PRINTFIELD_START(sc, "IOCFacts");
MPR_PRINTFIELD(sc, facts, MsgVersion, 0x%x);
MPR_PRINTFIELD(sc, facts, HeaderVersion, 0x%x);
MPR_PRINTFIELD(sc, facts, IOCNumber, %d);
MPR_PRINTFIELD(sc, facts, IOCExceptions, 0x%x);
MPR_PRINTFIELD(sc, facts, MaxChainDepth, %d);
- mpr_dprint_field(sc, MPR_XINFO, "WhoInit: %s\n",
+ mpr_print_field(sc, "WhoInit: %s\n",
mpr_describe_table(mpr_whoinit_names, facts->WhoInit));
MPR_PRINTFIELD(sc, facts, NumberOfPorts, %d);
MPR_PRINTFIELD(sc, facts, MaxMSIxVectors, %d);
MPR_PRINTFIELD(sc, facts, RequestCredit, %d);
MPR_PRINTFIELD(sc, facts, ProductID, 0x%x);
- mpr_dprint_field(sc, MPR_XINFO, "IOCCapabilities: %b\n",
+ mpr_print_field(sc, "IOCCapabilities: %b\n",
facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace"
"\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast"
"\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel"
"\20MSIXIndex" "\21HostDisc");
- mpr_dprint_field(sc, MPR_XINFO, "FWVersion= %d-%d-%d-%d\n",
+ mpr_print_field(sc, "FWVersion= %d-%d-%d-%d\n",
facts->FWVersion.Struct.Major,
facts->FWVersion.Struct.Minor,
facts->FWVersion.Struct.Unit,
@@ -227,7 +226,7 @@ mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
MPR_PRINTFIELD(sc, facts, MaxTargets, %d);
MPR_PRINTFIELD(sc, facts, MaxSasExpanders, %d);
MPR_PRINTFIELD(sc, facts, MaxEnclosures, %d);
- mpr_dprint_field(sc, MPR_XINFO, "ProtocolFlags: %b\n",
+ mpr_print_field(sc, "ProtocolFlags: %b\n",
facts->ProtocolFlags, "\20" "\1ScsiTarg" "\2ScsiInit");
MPR_PRINTFIELD(sc, facts, HighPriorityCredit, %d);
MPR_PRINTFIELD(sc, facts, MaxReplyDescriptorPostQueueDepth, %d);
@@ -238,7 +237,7 @@ mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
}
void
-mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
+_mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
{
MPR_PRINTFIELD_START(sc, "PortFacts");
@@ -248,24 +247,24 @@ mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
}
void
-mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+_mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
{
- MPR_EVENTFIELD_START(sc, "EventReply");
- MPR_EVENTFIELD(sc, event, EventDataLength, %d);
- MPR_EVENTFIELD(sc, event, AckRequired, %d);
- mpr_dprint_field(sc, MPR_EVENT, "Event: %s (0x%x)\n",
+ MPR_PRINTFIELD_START(sc, "EventReply");
+ MPR_PRINTFIELD(sc, event, EventDataLength, %d);
+ MPR_PRINTFIELD(sc, event, AckRequired, %d);
+ mpr_print_field(sc, "Event: %s (0x%x)\n",
mpr_describe_table(mpr_event_names, event->Event), event->Event);
- MPR_EVENTFIELD(sc, event, EventContext, 0x%x);
+ MPR_PRINTFIELD(sc, event, EventContext, 0x%x);
}
void
-mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
+_mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
{
MPR_PRINTFIELD_START(sc, "SAS Device Page 0");
MPR_PRINTFIELD(sc, buf, Slot, %d);
MPR_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x);
- mpr_dprint_field(sc, MPR_XINFO, "SASAddress: 0x%jx\n",
+ mpr_print_field(sc, "SASAddress: 0x%jx\n",
mpr_to_u64(&buf->SASAddress));
MPR_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x);
MPR_PRINTFIELD(sc, buf, PhyNum, %d);
@@ -273,7 +272,7 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
MPR_PRINTFIELD(sc, buf, DevHandle, 0x%x);
MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x);
MPR_PRINTFIELD(sc, buf, ZoneGroup, %d);
- mpr_dprint_field(sc, MPR_XINFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
+ mpr_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
"\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit"
"\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct"
"\15LsiDev" "\16AtapiDev" "\17SepDev",
@@ -281,7 +280,7 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
MPR_PRINTFIELD(sc, buf, Flags, 0x%x);
MPR_PRINTFIELD(sc, buf, PhysicalPort, %d);
MPR_PRINTFIELD(sc, buf, MaxPortConnections, %d);
- mpr_dprint_field(sc, MPR_XINFO, "DeviceName: 0x%jx\n",
+ mpr_print_field(sc, "DeviceName: 0x%jx\n",
mpr_to_u64(&buf->DeviceName));
MPR_PRINTFIELD(sc, buf, PortGroups, %d);
MPR_PRINTFIELD(sc, buf, DmaGroup, %d);
@@ -289,10 +288,10 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
}
void
-mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+_mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
{
- mpr_print_event(sc, event);
+ _mpr_print_event(sc, event);
switch(event->Event) {
case MPI2_EVENT_SAS_DISCOVERY:
@@ -300,12 +299,12 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
MPI2_EVENT_DATA_SAS_DISCOVERY *data;
data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)&event->EventData;
- mpr_dprint_field(sc, MPR_EVENT, "Flags: %b\n", data->Flags,
+ mpr_print_field(sc, "Flags: %b\n", data->Flags,
"\20" "\1InProgress" "\2DeviceChange");
- mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n",
+ mpr_print_field(sc, "ReasonCode: %s\n",
mpr_describe_table(mpr_sasdisc_reason, data->ReasonCode));
- MPR_EVENTFIELD(sc, data, PhysicalPort, %d);
- mpr_dprint_field(sc, MPR_EVENT, "DiscoveryStatus: %b\n",
+ MPR_PRINTFIELD(sc, data, PhysicalPort, %d);
+ mpr_print_field(sc, "DiscoveryStatus: %b\n",
data->DiscoveryStatus, "\20"
"\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout"
"\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed"
@@ -324,26 +323,26 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *)
&event->EventData;
- MPR_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
- MPR_EVENTFIELD(sc, data, ExpanderDevHandle, 0x%x);
- MPR_EVENTFIELD(sc, data, NumPhys, %d);
- MPR_EVENTFIELD(sc, data, NumEntries, %d);
- MPR_EVENTFIELD(sc, data, StartPhyNum, %d);
- mpr_dprint_field(sc, MPR_EVENT, "ExpStatus: %s (0x%x)\n",
+ MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
+ MPR_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x);
+ MPR_PRINTFIELD(sc, data, NumPhys, %d);
+ MPR_PRINTFIELD(sc, data, NumEntries, %d);
+ MPR_PRINTFIELD(sc, data, StartPhyNum, %d);
+ mpr_print_field(sc, "ExpStatus: %s (0x%x)\n",
mpr_describe_table(mpr_sastopo_exp, data->ExpStatus),
data->ExpStatus);
- MPR_EVENTFIELD(sc, data, PhysicalPort, %d);
+ MPR_PRINTFIELD(sc, data, PhysicalPort, %d);
for (i = 0; i < data->NumEntries; i++) {
phy = &data->PHY[i];
phynum = data->StartPhyNum + i;
- mpr_dprint_field(sc, MPR_EVENT,
+ mpr_print_field(sc,
"PHY[%d].AttachedDevHandle: 0x%04x\n", phynum,
phy->AttachedDevHandle);
- mpr_dprint_field(sc, MPR_EVENT,
+ mpr_print_field(sc,
"PHY[%d].LinkRate: %s (0x%x)\n", phynum,
mpr_describe_table(mpr_linkrate_names,
(phy->LinkRate >> 4) & 0xf), phy->LinkRate);
- mpr_dprint_field(sc,MPR_EVENT,"PHY[%d].PhyStatus: %s\n",
+ mpr_print_field(sc, "PHY[%d].PhyStatus: %s\n",
phynum, mpr_describe_table(mpr_phystatus_names,
phy->PhyStatus));
}
@@ -355,13 +354,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *)
&event->EventData;
- MPR_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
- mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n",
+ MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
+ mpr_print_field(sc, "ReasonCode: %s\n",
mpr_describe_table(mpr_sastopo_exp, data->ReasonCode));
- MPR_EVENTFIELD(sc, data, PhysicalPort, %d);
- MPR_EVENTFIELD(sc, data, NumSlots, %d);
- MPR_EVENTFIELD(sc, data, StartSlot, %d);
- MPR_EVENTFIELD(sc, data, PhyBits, 0x%x);
+ MPR_PRINTFIELD(sc, data, PhysicalPort, %d);
+ MPR_PRINTFIELD(sc, data, NumSlots, %d);
+ MPR_PRINTFIELD(sc, data, StartSlot, %d);
+ MPR_PRINTFIELD(sc, data, PhyBits, 0x%x);
break;
}
case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
@@ -370,13 +369,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)
&event->EventData;
- MPR_EVENTFIELD(sc, data, TaskTag, 0x%x);
- mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n",
+ MPR_PRINTFIELD(sc, data, TaskTag, 0x%x);
+ mpr_print_field(sc, "ReasonCode: %s\n",
mpr_describe_table(mpr_sasdev_reason, data->ReasonCode));
- MPR_EVENTFIELD(sc, data, ASC, 0x%x);
- MPR_EVENTFIELD(sc, data, ASCQ, 0x%x);
- MPR_EVENTFIELD(sc, data, DevHandle, 0x%x);
- mpr_dprint_field(sc, MPR_EVENT, "SASAddress: 0x%jx\n",
+ MPR_PRINTFIELD(sc, data, ASC, 0x%x);
+ MPR_PRINTFIELD(sc, data, ASCQ, 0x%x);
+ MPR_PRINTFIELD(sc, data, DevHandle, 0x%x);
+ mpr_print_field(sc, "SASAddress: 0x%jx\n",
mpr_to_u64(&data->SASAddress));
}
default:
@@ -385,24 +384,24 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
}
void
-mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
+_mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
{
MPR_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy);
MPR_PRINTFIELD(sc, buf, PhysicalPort, %d);
MPR_PRINTFIELD(sc, buf, NumPhys, %d);
MPR_PRINTFIELD(sc, buf, Phy, %d);
MPR_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d);
- mpr_dprint_field(sc, MPR_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
+ mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
mpr_describe_table(mpr_linkrate_names,
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
- mpr_dprint_field(sc, MPR_XINFO, "HwLinkRate: %s (0x%x)\n",
+ mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n",
mpr_describe_table(mpr_linkrate_names,
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
- mpr_dprint_field(sc, MPR_XINFO, "PhyInfo Reason: %s (0x%x)\n",
+ mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
mpr_describe_table(mpr_phyinfo_reason_names,
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
- mpr_dprint_field(sc, MPR_XINFO, "AttachedDeviceInfo: %b,%s\n",
+ mpr_print_field(sc, "AttachedDeviceInfo: %b,%s\n",
buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
"\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg"
"\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev",
@@ -410,14 +409,14 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
buf->AttachedDeviceInfo & 0x03));
MPR_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x);
MPR_PRINTFIELD(sc, buf, ChangeCount, %d);
- mpr_dprint_field(sc, MPR_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
+ mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
mpr_describe_table(mpr_linkrate_names,
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
MPR_PRINTFIELD(sc, buf, PhyIdentifier, %d);
MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
MPR_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x);
MPR_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x);
- mpr_dprint_field(sc, MPR_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
+ mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
mpr_describe_table(mpr_phyinfo_reason_names,
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
MPR_PRINTFIELD(sc, buf, ZoneGroup, %d);
@@ -425,27 +424,27 @@ mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
}
void
-mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
+_mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
{
MPR_PRINTFIELD_START(sc, "SAS PHY Page 0");
MPR_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x);
MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
- mpr_dprint_field(sc, MPR_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
+ mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
mpr_describe_table(mpr_phyinfo_reason_names,
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
- mpr_dprint_field(sc, MPR_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
+ mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
mpr_describe_table(mpr_linkrate_names,
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
- mpr_dprint_field(sc, MPR_XINFO, "HwLinkRate: %s (0x%x)\n",
+ mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n",
mpr_describe_table(mpr_linkrate_names,
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
MPR_PRINTFIELD(sc, buf, ChangeCount, %d);
MPR_PRINTFIELD(sc, buf, Flags, 0x%x);
- mpr_dprint_field(sc, MPR_XINFO, "PhyInfo Reason: %s (0x%x)\n",
+ mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
mpr_describe_table(mpr_phyinfo_reason_names,
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
- mpr_dprint_field(sc, MPR_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
+ mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
mpr_describe_table(mpr_linkrate_names,
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
}
diff --git a/sys/dev/mpr/mpr_table.h b/sys/dev/mpr/mpr_table.h
index 6539232138e3..45a8eed1837b 100644
--- a/sys/dev/mpr/mpr_table.h
+++ b/sys/dev/mpr/mpr_table.h
@@ -41,13 +41,63 @@ extern struct mpr_table_lookup mpr_event_names[];
extern struct mpr_table_lookup mpr_phystatus_names[];
extern struct mpr_table_lookup mpr_linkrate_names[];
-void mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *);
-void mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *);
-void mpr_print_event(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
-void mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
-void mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
-void mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
-void mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
+void _mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *);
+void _mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *);
+void _mpr_print_event(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
+void _mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
+void _mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
+void _mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
+void _mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
void mpr_print_sgl(struct mpr_softc *, struct mpr_command *, int);
void mpr_print_scsiio_cmd(struct mpr_softc *, struct mpr_command *);
+
+static __inline void
+mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
+{
+ if (sc->mpr_debug & MPR_XINFO)
+ _mpr_print_iocfacts(sc, facts);
+}
+
+static __inline void
+mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
+{
+ if (sc->mpr_debug & MPR_XINFO)
+ _mpr_print_portfacts(sc, facts);
+}
+
+static __inline void
+mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+{
+ if (sc->mpr_debug & MPR_EVENT)
+ _mpr_print_event(sc, event);
+}
+
+static __inline void
+mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+{
+ if (sc->mpr_debug & MPR_EVENT)
+ _mpr_print_evt_sas(sc, event);
+}
+
+static __inline void
+mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
+{
+ if (sc->mpr_debug & MPR_XINFO)
+ _mpr_print_sasdev0(sc, buf);
+}
+
+static __inline void
+mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
+{
+ if (sc->mpr_debug & MPR_XINFO)
+ _mpr_print_expander1(sc, buf);
+}
+
+static __inline void
+mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
+{
+ if (sc->mpr_debug & MPR_XINFO)
+ _mpr_print_sasphy0(sc, buf);
+}
+
#endif
diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h
index 0a9ccb61f378..4f0e9e70e099 100644
--- a/sys/dev/mpr/mprvar.h
+++ b/sys/dev/mpr/mprvar.h
@@ -584,6 +584,9 @@ mpr_unlock(struct mpr_softc *sc)
#define mpr_printf(sc, args...) \
device_printf((sc)->mpr_dev, ##args)
+#define mpr_print_field(sc, msg, args...) \
+ printf("\t" msg, ##args)
+
#define mpr_vprintf(sc, args...) \
do { \
if (bootverbose) \
@@ -596,25 +599,13 @@ do { \
device_printf((sc)->mpr_dev, msg, ##args); \
} while (0)
-#define mpr_dprint_field(sc, level, msg, args...) \
-do { \
- if ((sc)->mpr_debug & (level)) \
- printf("\t" msg, ##args); \
-} while (0)
-
#define MPR_PRINTFIELD_START(sc, tag...) \
- mpr_dprint((sc), MPR_INFO, ##tag); \
- mpr_dprint_field((sc), MPR_INFO, ":\n")
+ mpr_printf((sc), ##tag); \
+ mpr_print_field((sc), ":\n")
#define MPR_PRINTFIELD_END(sc, tag) \
- mpr_dprint((sc), MPR_INFO, tag "\n")
+ mpr_printf((sc), tag "\n")
#define MPR_PRINTFIELD(sc, facts, attr, fmt) \
- mpr_dprint_field((sc), MPR_INFO, #attr ": " #fmt "\n", (facts)->attr)
-
-#define MPR_EVENTFIELD_START(sc, tag...) \
- mpr_dprint((sc), MPR_EVENT, ##tag); \
- mpr_dprint_field((sc), MPR_EVENT, ":\n")
-#define MPR_EVENTFIELD(sc, facts, attr, fmt) \
- mpr_dprint_field((sc), MPR_EVENT, #attr ": " #fmt "\n", (facts)->attr)
+ mpr_print_field((sc), #attr ": " #fmt "\n", (facts)->attr)
static __inline void
mpr_from_u64(uint64_t data, U64 *mpr)
diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c
index bfae67bbaddf..ac7b5e2dc534 100644
--- a/sys/dev/mps/mps_sas.c
+++ b/sys/dev/mps/mps_sas.c
@@ -347,7 +347,7 @@ mpssas_log_command(struct mps_command *cm, u_int level, const char *fmt, ...)
sbuf_printf(&sb, "SMID %u ", cm->cm_desc.Default.SMID);
sbuf_vprintf(&sb, fmt, ap);
sbuf_finish(&sb);
- mps_dprint_field(cm->cm_sc, level, "%s", sbuf_data(&sb));
+ mps_print_field(cm->cm_sc, "%s", sbuf_data(&sb));
va_end(ap);
}
diff --git a/sys/dev/mps/mps_table.c b/sys/dev/mps/mps_table.c
index d85a71a2e55d..b6c96edf2f02 100644
--- a/sys/dev/mps/mps_table.c
+++ b/sys/dev/mps/mps_table.c
@@ -196,7 +196,7 @@ mps_describe_devinfo(uint32_t devinfo, char *string, int len)
}
void
-mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
+_mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
{
MPS_PRINTFIELD_START(sc, "IOCFacts");
@@ -205,18 +205,18 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
MPS_PRINTFIELD(sc, facts, IOCNumber, %d);
MPS_PRINTFIELD(sc, facts, IOCExceptions, 0x%x);
MPS_PRINTFIELD(sc, facts, MaxChainDepth, %d);
- mps_dprint_field(sc, MPS_XINFO, "WhoInit: %s\n",
+ mps_print_field(sc, "WhoInit: %s\n",
mps_describe_table(mps_whoinit_names, facts->WhoInit));
MPS_PRINTFIELD(sc, facts, NumberOfPorts, %d);
MPS_PRINTFIELD(sc, facts, MaxMSIxVectors, %d);
MPS_PRINTFIELD(sc, facts, RequestCredit, %d);
MPS_PRINTFIELD(sc, facts, ProductID, 0x%x);
- mps_dprint_field(sc, MPS_XINFO, "IOCCapabilities: %b\n",
+ mps_print_field(sc, "IOCCapabilities: %b\n",
facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace"
"\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast"
"\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel"
"\20MSIXIndex" "\21HostDisc");
- mps_dprint_field(sc, MPS_XINFO, "FWVersion= %d-%d-%d-%d\n",
+ mps_print_field(sc, "FWVersion= %d-%d-%d-%d\n",
facts->FWVersion.Struct.Major,
facts->FWVersion.Struct.Minor,
facts->FWVersion.Struct.Unit,
@@ -226,7 +226,7 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
MPS_PRINTFIELD(sc, facts, MaxTargets, %d);
MPS_PRINTFIELD(sc, facts, MaxSasExpanders, %d);
MPS_PRINTFIELD(sc, facts, MaxEnclosures, %d);
- mps_dprint_field(sc, MPS_XINFO, "ProtocolFlags: %b\n",
+ mps_print_field(sc, "ProtocolFlags: %b\n",
facts->ProtocolFlags, "\20" "\1ScsiTarg" "\2ScsiInit");
MPS_PRINTFIELD(sc, facts, HighPriorityCredit, %d);
MPS_PRINTFIELD(sc, facts, MaxReplyDescriptorPostQueueDepth, %d);
@@ -237,7 +237,7 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
}
void
-mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
+_mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
{
MPS_PRINTFIELD_START(sc, "PortFacts");
@@ -247,24 +247,24 @@ mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
}
void
-mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+_mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
{
- MPS_EVENTFIELD_START(sc, "EventReply");
- MPS_EVENTFIELD(sc, event, EventDataLength, %d);
- MPS_EVENTFIELD(sc, event, AckRequired, %d);
- mps_dprint_field(sc, MPS_EVENT, "Event: %s (0x%x)\n",
+ MPS_PRINTFIELD_START(sc, "EventReply");
+ MPS_PRINTFIELD(sc, event, EventDataLength, %d);
+ MPS_PRINTFIELD(sc, event, AckRequired, %d);
+ mps_print_field(sc, "Event: %s (0x%x)\n",
mps_describe_table(mps_event_names, event->Event), event->Event);
- MPS_EVENTFIELD(sc, event, EventContext, 0x%x);
+ MPS_PRINTFIELD(sc, event, EventContext, 0x%x);
}
void
-mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
+_mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
{
MPS_PRINTFIELD_START(sc, "SAS Device Page 0");
MPS_PRINTFIELD(sc, buf, Slot, %d);
MPS_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x);
- mps_dprint_field(sc, MPS_XINFO, "SASAddress: 0x%jx\n",
+ mps_print_field(sc, "SASAddress: 0x%jx\n",
mps_to_u64(&buf->SASAddress));
MPS_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x);
MPS_PRINTFIELD(sc, buf, PhyNum, %d);
@@ -272,7 +272,7 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
MPS_PRINTFIELD(sc, buf, DevHandle, 0x%x);
MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x);
MPS_PRINTFIELD(sc, buf, ZoneGroup, %d);
- mps_dprint_field(sc, MPS_XINFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
+ mps_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
"\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit"
"\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct"
"\15LsiDev" "\16AtapiDev" "\17SepDev",
@@ -280,7 +280,7 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
MPS_PRINTFIELD(sc, buf, Flags, 0x%x);
MPS_PRINTFIELD(sc, buf, PhysicalPort, %d);
MPS_PRINTFIELD(sc, buf, MaxPortConnections, %d);
- mps_dprint_field(sc, MPS_XINFO, "DeviceName: 0x%jx\n",
+ mps_print_field(sc, "DeviceName: 0x%jx\n",
mps_to_u64(&buf->DeviceName));
MPS_PRINTFIELD(sc, buf, PortGroups, %d);
MPS_PRINTFIELD(sc, buf, DmaGroup, %d);
@@ -288,10 +288,10 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
}
void
-mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+_mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
{
- mps_print_event(sc, event);
+ _mps_print_event(sc, event);
switch(event->Event) {
case MPI2_EVENT_SAS_DISCOVERY:
@@ -299,12 +299,12 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
MPI2_EVENT_DATA_SAS_DISCOVERY *data;
data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)&event->EventData;
- mps_dprint_field(sc, MPS_EVENT, "Flags: %b\n", data->Flags,
+ mps_print_field(sc, "Flags: %b\n", data->Flags,
"\20" "\1InProgress" "\2DeviceChange");
- mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n",
+ mps_print_field(sc, "ReasonCode: %s\n",
mps_describe_table(mps_sasdisc_reason, data->ReasonCode));
- MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
- mps_dprint_field(sc, MPS_EVENT, "DiscoveryStatus: %b\n",
+ MPS_PRINTFIELD(sc, data, PhysicalPort, %d);
+ mps_print_field(sc, "DiscoveryStatus: %b\n",
data->DiscoveryStatus, "\20"
"\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout"
"\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed"
@@ -323,26 +323,26 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *)
&event->EventData;
- MPS_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
- MPS_EVENTFIELD(sc, data, ExpanderDevHandle, 0x%x);
- MPS_EVENTFIELD(sc, data, NumPhys, %d);
- MPS_EVENTFIELD(sc, data, NumEntries, %d);
- MPS_EVENTFIELD(sc, data, StartPhyNum, %d);
- mps_dprint_field(sc, MPS_EVENT, "ExpStatus: %s (0x%x)\n",
+ MPS_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
+ MPS_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x);
+ MPS_PRINTFIELD(sc, data, NumPhys, %d);
+ MPS_PRINTFIELD(sc, data, NumEntries, %d);
+ MPS_PRINTFIELD(sc, data, StartPhyNum, %d);
+ mps_print_field(sc, "ExpStatus: %s (0x%x)\n",
mps_describe_table(mps_sastopo_exp, data->ExpStatus),
data->ExpStatus);
- MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
+ MPS_PRINTFIELD(sc, data, PhysicalPort, %d);
for (i = 0; i < data->NumEntries; i++) {
phy = &data->PHY[i];
phynum = data->StartPhyNum + i;
- mps_dprint_field(sc, MPS_EVENT,
+ mps_print_field(sc,
"PHY[%d].AttachedDevHandle: 0x%04x\n", phynum,
phy->AttachedDevHandle);
- mps_dprint_field(sc, MPS_EVENT,
+ mps_print_field(sc,
"PHY[%d].LinkRate: %s (0x%x)\n", phynum,
mps_describe_table(mps_linkrate_names,
(phy->LinkRate >> 4) & 0xf), phy->LinkRate);
- mps_dprint_field(sc,MPS_EVENT,"PHY[%d].PhyStatus: %s\n",
+ mps_print_field(sc, "PHY[%d].PhyStatus: %s\n",
phynum, mps_describe_table(mps_phystatus_names,
phy->PhyStatus));
}
@@ -354,13 +354,13 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *)
&event->EventData;
- MPS_EVENTFIELD(sc, data, EnclosureHandle, 0x%x);
- mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n",
+ MPS_PRINTFIELD(sc, data, EnclosureHandle, 0x%x);
+ mps_print_field(sc, "ReasonCode: %s\n",
mps_describe_table(mps_sastopo_exp, data->ReasonCode));
- MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
- MPS_EVENTFIELD(sc, data, NumSlots, %d);
- MPS_EVENTFIELD(sc, data, StartSlot, %d);
- MPS_EVENTFIELD(sc, data, PhyBits, 0x%x);
+ MPS_PRINTFIELD(sc, data, PhysicalPort, %d);
+ MPS_PRINTFIELD(sc, data, NumSlots, %d);
+ MPS_PRINTFIELD(sc, data, StartSlot, %d);
+ MPS_PRINTFIELD(sc, data, PhyBits, 0x%x);
break;
}
case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
@@ -369,13 +369,13 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *)
&event->EventData;
- MPS_EVENTFIELD(sc, data, TaskTag, 0x%x);
- mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n",
+ MPS_PRINTFIELD(sc, data, TaskTag, 0x%x);
+ mps_print_field(sc, "ReasonCode: %s\n",
mps_describe_table(mps_sasdev_reason, data->ReasonCode));
- MPS_EVENTFIELD(sc, data, ASC, 0x%x);
- MPS_EVENTFIELD(sc, data, ASCQ, 0x%x);
- MPS_EVENTFIELD(sc, data, DevHandle, 0x%x);
- mps_dprint_field(sc, MPS_EVENT, "SASAddress: 0x%jx\n",
+ MPS_PRINTFIELD(sc, data, ASC, 0x%x);
+ MPS_PRINTFIELD(sc, data, ASCQ, 0x%x);
+ MPS_PRINTFIELD(sc, data, DevHandle, 0x%x);
+ mps_print_field(sc, "SASAddress: 0x%jx\n",
mps_to_u64(&data->SASAddress));
}
default:
@@ -384,24 +384,24 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
}
void
-mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
+_mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
{
MPS_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy);
MPS_PRINTFIELD(sc, buf, PhysicalPort, %d);
MPS_PRINTFIELD(sc, buf, NumPhys, %d);
MPS_PRINTFIELD(sc, buf, Phy, %d);
MPS_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d);
- mps_dprint_field(sc, MPS_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
+ mps_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
mps_describe_table(mps_linkrate_names,
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
- mps_dprint_field(sc, MPS_XINFO, "HwLinkRate: %s (0x%x)\n",
+ mps_print_field(sc, "HwLinkRate: %s (0x%x)\n",
mps_describe_table(mps_linkrate_names,
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
MPS_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
- mps_dprint_field(sc, MPS_XINFO, "PhyInfo Reason: %s (0x%x)\n",
+ mps_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
mps_describe_table(mps_phyinfo_reason_names,
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
- mps_dprint_field(sc, MPS_XINFO, "AttachedDeviceInfo: %b,%s\n",
+ mps_print_field(sc, "AttachedDeviceInfo: %b,%s\n",
buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
"\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg"
"\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev",
@@ -409,14 +409,14 @@ mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
buf->AttachedDeviceInfo & 0x03));
MPS_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x);
MPS_PRINTFIELD(sc, buf, ChangeCount, %d);
- mps_dprint_field(sc, MPS_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
+ mps_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
mps_describe_table(mps_linkrate_names,
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
MPS_PRINTFIELD(sc, buf, PhyIdentifier, %d);
MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
MPS_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x);
MPS_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x);
- mps_dprint_field(sc, MPS_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
+ mps_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
mps_describe_table(mps_phyinfo_reason_names,
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
MPS_PRINTFIELD(sc, buf, ZoneGroup, %d);
@@ -424,27 +424,27 @@ mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
}
void
-mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
+_mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
{
MPS_PRINTFIELD_START(sc, "SAS PHY Page 0");
MPS_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x);
MPS_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x);
MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d);
- mps_dprint_field(sc, MPS_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n",
+ mps_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n",
mps_describe_table(mps_phyinfo_reason_names,
buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo);
- mps_dprint_field(sc, MPS_XINFO, "ProgrammedLinkRate: %s (0x%x)\n",
+ mps_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n",
mps_describe_table(mps_linkrate_names,
(buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate);
- mps_dprint_field(sc, MPS_XINFO, "HwLinkRate: %s (0x%x)\n",
+ mps_print_field(sc, "HwLinkRate: %s (0x%x)\n",
mps_describe_table(mps_linkrate_names,
(buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate);
MPS_PRINTFIELD(sc, buf, ChangeCount, %d);
MPS_PRINTFIELD(sc, buf, Flags, 0x%x);
- mps_dprint_field(sc, MPS_XINFO, "PhyInfo Reason: %s (0x%x)\n",
+ mps_print_field(sc, "PhyInfo Reason: %s (0x%x)\n",
mps_describe_table(mps_phyinfo_reason_names,
(buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
- mps_dprint_field(sc, MPS_XINFO, "NegotiatedLinkRate: %s (0x%x)\n",
+ mps_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n",
mps_describe_table(mps_linkrate_names,
buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate);
}
diff --git a/sys/dev/mps/mps_table.h b/sys/dev/mps/mps_table.h
index 88aa2c38546d..1fe6b1eedda4 100644
--- a/sys/dev/mps/mps_table.h
+++ b/sys/dev/mps/mps_table.h
@@ -41,13 +41,63 @@ extern struct mps_table_lookup mps_event_names[];
extern struct mps_table_lookup mps_phystatus_names[];
extern struct mps_table_lookup mps_linkrate_names[];
-void mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *);
-void mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *);
-void mps_print_event(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
-void mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
-void mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
-void mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
-void mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
+void _mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *);
+void _mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *);
+void _mps_print_event(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
+void _mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *);
+void _mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *);
+void _mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *);
+void _mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *);
void mps_print_sgl(struct mps_softc *, struct mps_command *, int);
void mps_print_scsiio_cmd(struct mps_softc *, struct mps_command *);
+
+static __inline void
+mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
+{
+ if (sc->mps_debug & MPS_XINFO)
+ _mps_print_iocfacts(sc, facts);
+}
+
+static __inline void
+mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts)
+{
+ if (sc->mps_debug & MPS_XINFO)
+ _mps_print_portfacts(sc, facts);
+}
+
+static __inline void
+mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+{
+ if (sc->mps_debug & MPS_EVENT)
+ _mps_print_event(sc, event);
+}
+
+static __inline void
+mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
+{
+ if (sc->mps_debug & MPS_XINFO)
+ _mps_print_sasdev0(sc, buf);
+}
+
+static __inline void
+mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
+{
+ if (sc->mps_debug & MPS_EVENT)
+ _mps_print_evt_sas(sc, event);
+}
+
+static __inline void
+mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
+{
+ if (sc->mps_debug & MPS_XINFO)
+ _mps_print_expander1(sc, buf);
+}
+
+static __inline void
+mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf)
+{
+ if (sc->mps_debug & MPS_XINFO)
+ _mps_print_sasphy0(sc, buf);
+}
+
#endif
diff --git a/sys/dev/mps/mpsvar.h b/sys/dev/mps/mpsvar.h
index d8cda89dfc12..8c9fc8c8b340 100644
--- a/sys/dev/mps/mpsvar.h
+++ b/sys/dev/mps/mpsvar.h
@@ -609,6 +609,9 @@ mps_unlock(struct mps_softc *sc)
#define mps_printf(sc, args...) \
device_printf((sc)->mps_dev, ##args)
+#define mps_print_field(sc, msg, args...) \
+ printf("\t" msg, ##args)
+
#define mps_vprintf(sc, args...) \
do { \
if (bootverbose) \
@@ -621,25 +624,13 @@ do { \
device_printf((sc)->mps_dev, msg, ##args); \
} while (0)
-#define mps_dprint_field(sc, level, msg, args...) \
-do { \
- if ((sc)->mps_debug & (level)) \
- printf("\t" msg, ##args); \
-} while (0)
-
#define MPS_PRINTFIELD_START(sc, tag...) \
- mps_dprint((sc), MPS_XINFO, ##tag); \
- mps_dprint_field((sc), MPS_XINFO, ":\n")
+ mps_printf((sc), ##tag); \
+ mps_print_field((sc), ":\n")
#define MPS_PRINTFIELD_END(sc, tag) \
- mps_dprint((sc), MPS_XINFO, tag "\n")
+ mps_printf((sc), tag "\n")
#define MPS_PRINTFIELD(sc, facts, attr, fmt) \
- mps_dprint_field((sc), MPS_XINFO, #attr ": " #fmt "\n", (facts)->attr)
-
-#define MPS_EVENTFIELD_START(sc, tag...) \
- mps_dprint((sc), MPS_EVENT, ##tag); \
- mps_dprint_field((sc), MPS_EVENT, ":\n")
-#define MPS_EVENTFIELD(sc, facts, attr, fmt) \
- mps_dprint_field((sc), MPS_EVENT, #attr ": " #fmt "\n", (facts)->attr)
+ mps_print_field((sc), #attr ": " #fmt "\n", (facts)->attr)
#define MPS_FUNCTRACE(sc) \
mps_dprint((sc), MPS_TRACE, "%s\n", __func__)
diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c
index bb8fb6a9c0e2..c8bd19d24580 100644
--- a/sys/dev/rtwn/if_rtwn.c
+++ b/sys/dev/rtwn/if_rtwn.c
@@ -695,6 +695,7 @@ rtwn_ioctl_reset(struct ieee80211vap *vap, u_long cmd)
case IEEE80211_IOC_RTSTHRESHOLD:
case IEEE80211_IOC_PROTMODE:
case IEEE80211_IOC_HTPROTMODE:
+ case IEEE80211_IOC_LDPC:
error = 0;
break;
default:
@@ -1999,6 +2000,7 @@ rtwn_stop(struct rtwn_softc *sc)
sc->fwver = 0;
sc->thcal_temp = 0;
sc->cur_bcnq_id = RTWN_VAP_ID_INVALID;
+ bzero(&sc->last_physt, sizeof(sc->last_physt));
#ifdef D4054
ieee80211_tx_watchdog_stop(&sc->sc_ic);
diff --git a/sys/dev/rtwn/if_rtwn_rx.c b/sys/dev/rtwn/if_rtwn_rx.c
index 1dea7a6d607a..d6ccb159fc2f 100644
--- a/sys/dev/rtwn/if_rtwn_rx.c
+++ b/sys/dev/rtwn/if_rtwn_rx.c
@@ -117,18 +117,19 @@ rtwn_set_basicrates(struct rtwn_softc *sc, uint32_t rates)
}
static void
-rtwn_update_avgrssi(struct rtwn_softc *sc, struct rtwn_node *un, int rate)
+rtwn_update_avgrssi(struct rtwn_softc *sc, struct rtwn_node *un, int8_t rssi,
+ int is_cck)
{
int pwdb;
/* Convert antenna signal to percentage. */
- if (un->last_rssi <= -100 || un->last_rssi >= 20)
+ if (rssi <= -100 || rssi >= 20)
pwdb = 0;
- else if (un->last_rssi >= 0)
+ else if (rssi >= 0)
pwdb = 100;
else
- pwdb = 100 + un->last_rssi;
- if (RTWN_RATE_IS_CCK(rate)) {
+ pwdb = 100 + rssi;
+ if (is_cck) {
/* CCK gain is smaller than OFDM/MCS gain. */
pwdb += 6;
if (pwdb > 100)
@@ -155,11 +156,11 @@ rtwn_update_avgrssi(struct rtwn_softc *sc, struct rtwn_node *un, int rate)
}
static int8_t
-rtwn_get_rssi(struct rtwn_softc *sc, int rate, void *physt)
+rtwn_get_rssi(struct rtwn_softc *sc, void *physt, int is_cck)
{
int8_t rssi;
- if (RTWN_RATE_IS_CCK(rate))
+ if (is_cck)
rssi = rtwn_get_rssi_cck(sc, physt);
else /* OFDM/HT. */
rssi = rtwn_get_rssi_ofdm(sc, physt);
@@ -188,81 +189,133 @@ rtwn_get_tsf(struct rtwn_softc *sc, uint64_t *buf, int id)
*buf += rtwn_get_tsf_low(sc, id);
}
+static uint64_t
+rtwn_extend_rx_tsf(struct rtwn_softc *sc, const struct r92c_rx_stat *stat)
+{
+ uint64_t tsft;
+ uint32_t rxdw3, tsfl, tsfl_curr;
+ int id;
+
+ rxdw3 = le32toh(stat->rxdw3);
+ tsfl = le32toh(stat->tsf_low);
+ id = MS(rxdw3, R92C_RXDW3_BSSID_FIT);
+
+ switch (id) {
+ case 1:
+ case 2:
+ id >>= 1;
+ tsfl_curr = rtwn_get_tsf_low(sc, id);
+ break;
+ default:
+ {
+ uint32_t tsfl0, tsfl1;
+
+ tsfl0 = rtwn_get_tsf_low(sc, 0);
+ tsfl1 = rtwn_get_tsf_low(sc, 1);
+
+ if (abs(tsfl0 - tsfl) < abs(tsfl1 - tsfl)) {
+ id = 0;
+ tsfl_curr = tsfl0;
+ } else {
+ id = 1;
+ tsfl_curr = tsfl1;
+ }
+ break;
+ }
+ }
+
+ tsft = rtwn_get_tsf_high(sc, id);
+ if (tsfl > tsfl_curr && tsfl > 0xffff0000)
+ tsft--;
+ tsft <<= 32;
+ tsft += tsfl;
+
+ return (tsft);
+}
+
struct ieee80211_node *
-rtwn_rx_common(struct rtwn_softc *sc, struct mbuf *m, void *desc,
- int8_t *rssi)
+rtwn_rx_common(struct rtwn_softc *sc, struct mbuf *m, void *desc)
{
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_node *ni;
struct ieee80211_frame_min *wh;
+ struct ieee80211_rx_stats rxs;
struct rtwn_node *un;
struct r92c_rx_stat *stat;
- uint32_t rxdw0, rxdw3;
- int cipher, infosz, pktlen, rate, shift;
+ void *physt;
+ uint32_t rxdw0;
+ int8_t rssi;
+ int cipher, infosz, is_cck, pktlen, shift;
stat = desc;
rxdw0 = le32toh(stat->rxdw0);
- rxdw3 = le32toh(stat->rxdw3);
cipher = MS(rxdw0, R92C_RXDW0_CIPHER);
infosz = MS(rxdw0, R92C_RXDW0_INFOSZ) * 8;
pktlen = MS(rxdw0, R92C_RXDW0_PKTLEN);
shift = MS(rxdw0, R92C_RXDW0_SHIFT);
- rate = MS(rxdw3, R92C_RXDW3_RATE);
wh = (struct ieee80211_frame_min *)(mtodo(m, shift + infosz));
if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) &&
cipher != R92C_CAM_ALGO_NONE)
m->m_flags |= M_WEP;
- if (pktlen >= sizeof(*wh))
+ if (pktlen >= sizeof(*wh)) {
ni = ieee80211_find_rxnode(ic, wh);
- else
+ if (ni != NULL && (ni->ni_flags & IEEE80211_NODE_HT))
+ m->m_flags |= M_AMPDU;
+ } else
ni = NULL;
un = RTWN_NODE(ni);
- /* Get RSSI from PHY status descriptor if present. */
- if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) {
- *rssi = rtwn_get_rssi(sc, rate, mtod(m, void *));
- RTWN_DPRINTF(sc, RTWN_DEBUG_RSSI, "%s: rssi %d, ridx %d\n",
- __func__, *rssi, rate);
+ if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST))
+ physt = (void *)mtodo(m, shift);
+ else
+ physt = (un != NULL) ? &un->last_physt : &sc->last_physt;
- sc->last_rssi = *rssi;
- if (un != NULL) {
- un->last_rssi = *rssi;
+ bzero(&rxs, sizeof(rxs));
+ rtwn_get_rx_stats(sc, &rxs, desc, physt);
+ if (rxs.c_pktflags & IEEE80211_RX_F_AMPDU) {
+ /* Next MPDU will come without PHY info. */
+ memcpy(&sc->last_physt, physt, sizeof(sc->last_physt));
+ if (un != NULL)
+ memcpy(&un->last_physt, physt, sizeof(sc->last_physt));
+ }
- /* Update our average RSSI. */
- rtwn_update_avgrssi(sc, un, rate);
- }
- } else
- *rssi = (un != NULL) ? un->last_rssi : sc->last_rssi;
+ /* Add some common bits. */
+ /* NB: should not happen. */
+ if (rxdw0 & R92C_RXDW0_CRCERR)
+ rxs.c_pktflags |= IEEE80211_RX_F_FAIL_FCSCRC;
- if (ieee80211_radiotap_active(ic)) {
- struct rtwn_rx_radiotap_header *tap = &sc->sc_rxtap;
- int id = RTWN_VAP_ID_INVALID;
+ rxs.r_flags |= IEEE80211_R_TSF_START; /* XXX undocumented */
+ rxs.r_flags |= IEEE80211_R_TSF64;
+ rxs.c_rx_tsf = rtwn_extend_rx_tsf(sc, stat);
- if (ni != NULL)
- id = RTWN_VAP(ni->ni_vap)->id;
- if (id == RTWN_VAP_ID_INVALID)
- id = 0;
+ /* Get RSSI from PHY status descriptor. */
+ is_cck = (rxs.c_pktflags & IEEE80211_RX_F_CCK) != 0;
+ rssi = rtwn_get_rssi(sc, physt, is_cck);
- tap->wr_flags = rtwn_rx_radiotap_flags(sc, desc);
- tap->wr_tsft = rtwn_get_tsf_high(sc, id);
- if (le32toh(stat->tsf_low) > rtwn_get_tsf_low(sc, id))
- tap->wr_tsft--;
- tap->wr_tsft = (uint64_t)htole32(tap->wr_tsft) << 32;
- tap->wr_tsft += stat->tsf_low;
+ /* XXX TODO: we really need a rate-to-string method */
+ RTWN_DPRINTF(sc, RTWN_DEBUG_RSSI, "%s: rssi %d, rate %d\n",
+ __func__, rssi, rxs.c_rate);
+ if (un != NULL && infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) {
+ /* Update our average RSSI. */
+ rtwn_update_avgrssi(sc, un, rssi, is_cck);
+ }
- /* XXX 20/40? */
+ rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI;
+ rxs.c_nf = RTWN_NOISE_FLOOR;
+ rxs.c_rssi = rssi - rxs.c_nf;
+ (void) ieee80211_add_rx_params(m, &rxs);
- /* Map HW rate index to 802.11 rate. */
- if (rate < RTWN_RIDX_MCS(0))
- tap->wr_rate = ridx2rate[rate];
- else /* MCS0~15. */
- tap->wr_rate = IEEE80211_RATE_MCS | (rate - 12);
+ if (ieee80211_radiotap_active(ic)) {
+ struct rtwn_rx_radiotap_header *tap = &sc->sc_rxtap;
- tap->wr_dbm_antsignal = *rssi;
- tap->wr_dbm_antnoise = RTWN_NOISE_FLOOR;
+ tap->wr_flags = rtwn_rx_radiotap_flags(sc, desc);
+ tap->wr_tsft = htole64(rxs.c_rx_tsf);
+ tap->wr_rate = rxs.c_rate;
+ tap->wr_dbm_antsignal = rssi;
+ tap->wr_dbm_antnoise = rxs.c_nf;
}
/* Drop PHY descriptor. */
diff --git a/sys/dev/rtwn/if_rtwn_rx.h b/sys/dev/rtwn/if_rtwn_rx.h
index dfdcc4bfe107..49897eb956b9 100644
--- a/sys/dev/rtwn/if_rtwn_rx.h
+++ b/sys/dev/rtwn/if_rtwn_rx.h
@@ -26,7 +26,7 @@ void rtwn_get_rates(struct rtwn_softc *, const struct ieee80211_rateset *,
const struct ieee80211_htrateset *, uint32_t *, int *, int);
void rtwn_set_basicrates(struct rtwn_softc *, uint32_t);
struct ieee80211_node * rtwn_rx_common(struct rtwn_softc *, struct mbuf *,
- void *, int8_t *);
+ void *);
void rtwn_adhoc_recv_mgmt(struct ieee80211_node *, struct mbuf *, int,
const struct ieee80211_rx_stats *, int, int);
void rtwn_set_multi(struct rtwn_softc *);
diff --git a/sys/dev/rtwn/if_rtwnvar.h b/sys/dev/rtwn/if_rtwnvar.h
index 642cdbf2f899..e13cceea81a8 100644
--- a/sys/dev/rtwn/if_rtwnvar.h
+++ b/sys/dev/rtwn/if_rtwnvar.h
@@ -76,6 +76,12 @@ struct rtwn_tx_buf {
uint8_t txd[RTWN_TX_DESC_SIZE];
} __attribute__((aligned(4)));
+#define RTWN_PHY_STATUS_SIZE 32
+struct rtwn_tx_phystat {
+ uint32_t phydw[RTWN_PHY_STATUS_SIZE / sizeof(uint32_t)];
+};
+
+
struct rtwn_softc;
union sec_param {
@@ -95,7 +101,8 @@ struct rtwn_cmdq {
struct rtwn_node {
struct ieee80211_node ni; /* must be the first */
int id;
- int8_t last_rssi;
+
+ struct rtwn_tx_phystat last_physt;
int avg_pwdb;
};
#define RTWN_NODE(ni) ((struct rtwn_node *)(ni))
@@ -195,7 +202,7 @@ struct rtwn_softc {
const char *name;
int sc_ant;
- int8_t last_rssi;
+ struct rtwn_tx_phystat last_physt;
uint8_t thcal_temp;
int cur_bcnq_id;
@@ -336,6 +343,9 @@ struct rtwn_softc {
struct ieee80211vap *, int);
void (*sc_set_rssi)(struct rtwn_softc *);
#endif
+ void (*sc_get_rx_stats)(struct rtwn_softc *,
+ struct ieee80211_rx_stats *, const void *,
+ const void *);
int8_t (*sc_get_rssi_cck)(struct rtwn_softc *, void *);
int8_t (*sc_get_rssi_ofdm)(struct rtwn_softc *, void *);
int (*sc_classify_intr)(struct rtwn_softc *, void *, int);
@@ -478,6 +488,8 @@ void rtwn_suspend(struct rtwn_softc *);
(((_sc)->sc_parse_rom)((_sc), (_rom)))
#define rtwn_set_led(_sc, _led, _on) \
(((_sc)->sc_set_led)((_sc), (_led), (_on)))
+#define rtwn_get_rx_stats(_sc, _rxs, _desc, _physt) \
+ (((_sc)->sc_get_rx_stats((_sc), (_rxs), (_desc), (_physt))))
#define rtwn_get_rssi_cck(_sc, _physt) \
(((_sc)->sc_get_rssi_cck)((_sc), (_physt)))
#define rtwn_get_rssi_ofdm(_sc, _physt) \
diff --git a/sys/dev/rtwn/pci/rtwn_pci_rx.c b/sys/dev/rtwn/pci/rtwn_pci_rx.c
index 00f7409efeb7..e505a3cb554f 100644
--- a/sys/dev/rtwn/pci/rtwn_pci_rx.c
+++ b/sys/dev/rtwn/pci/rtwn_pci_rx.c
@@ -95,7 +95,6 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct r92ce_rx_stat *rx_desc,
struct ieee80211_node *ni;
uint32_t rxdw0;
struct mbuf *m, *m1;
- int8_t rssi = 0, nf;
int infosz, pktlen, shift, error;
/* Dump Rx descriptor. */
@@ -162,12 +161,11 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct r92ce_rx_stat *rx_desc,
rx_data->m = m1;
m->m_pkthdr.len = m->m_len = pktlen + infosz + shift;
- nf = RTWN_NOISE_FLOOR;
- ni = rtwn_rx_common(sc, m, rx_desc, &rssi);
+ ni = rtwn_rx_common(sc, m, rx_desc);
RTWN_DPRINTF(sc, RTWN_DEBUG_RECV,
- "%s: Rx frame len %d, infosz %d, shift %d, rssi %d\n",
- __func__, pktlen, infosz, shift, rssi);
+ "%s: Rx frame len %d, infosz %d, shift %d\n",
+ __func__, pktlen, infosz, shift);
/* Update RX descriptor. */
rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, MJUMPAGESIZE,
@@ -176,11 +174,11 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct r92ce_rx_stat *rx_desc,
/* Send the frame to the 802.11 layer. */
RTWN_UNLOCK(sc);
if (ni != NULL) {
- (void)ieee80211_input(ni, m, rssi - nf, nf);
+ (void)ieee80211_input_mimo(ni, m);
/* Node is no longer needed. */
ieee80211_free_node(ni);
} else
- (void)ieee80211_input_all(ic, m, rssi - nf, nf);
+ (void)ieee80211_input_mimo_all(ic, m);
RTWN_LOCK(sc);
diff --git a/sys/dev/rtwn/rtl8188e/r88e.h b/sys/dev/rtwn/rtl8188e/r88e.h
index 999ab4005756..1c03ddd31823 100644
--- a/sys/dev/rtwn/rtl8188e/r88e.h
+++ b/sys/dev/rtwn/rtl8188e/r88e.h
@@ -85,6 +85,8 @@ void r88e_ratectl_tx_complete(struct rtwn_softc *, uint8_t *, int);
void r88e_handle_c2h_report(struct rtwn_softc *, uint8_t *, int);
int8_t r88e_get_rssi_cck(struct rtwn_softc *, void *);
int8_t r88e_get_rssi_ofdm(struct rtwn_softc *, void *);
+void r88e_get_rx_stats(struct rtwn_softc *, struct ieee80211_rx_stats *,
+ const void *, const void *);
/* r88e_tx.c */
void r88e_tx_enable_ampdu(void *, int);
diff --git a/sys/dev/rtwn/rtl8188e/r88e_rx.c b/sys/dev/rtwn/rtl8188e/r88e_rx.c
index 3f31393deb74..da60046aa6a9 100644
--- a/sys/dev/rtwn/rtl8188e/r88e_rx.c
+++ b/sys/dev/rtwn/rtl8188e/r88e_rx.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <dev/rtwn/if_rtwn_debug.h>
#include <dev/rtwn/if_rtwn_ridx.h>
+#include <dev/rtwn/rtl8192c/r92c.h>
#include <dev/rtwn/rtl8188e/r88e.h>
#include <dev/rtwn/rtl8188e/r88e_rx_desc.h>
@@ -209,3 +210,19 @@ r88e_get_rssi_ofdm(struct rtwn_softc *sc, void *physt)
return (rssi);
}
+
+void
+r88e_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs,
+ const void *desc, const void *physt_ptr)
+{
+ const struct r88e_rx_phystat *physt = physt_ptr;
+
+ r92c_get_rx_stats(sc, rxs, desc, physt_ptr);
+
+ if (!sc->sc_ht40) { /* XXX center channel */
+ rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
+ rxs->c_ieee = le16toh(physt->chan);
+ rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee,
+ IEEE80211_CHAN_2GHZ);
+ }
+}
diff --git a/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c b/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c
index 33a5aaf93a03..bcdb3c5b5088 100644
--- a/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c
+++ b/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c
@@ -127,6 +127,7 @@ r88eu_attach(struct rtwn_usb_softc *uc)
sc->sc_dump_tx_desc = r92cu_dump_tx_desc;
sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags;
sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags;
+ sc->sc_get_rx_stats = r88e_get_rx_stats;
sc->sc_get_rssi_cck = r88e_get_rssi_cck;
sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm;
sc->sc_classify_intr = r88eu_classify_intr;
diff --git a/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c b/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c
index f38782fced6d..de5ef61888a4 100644
--- a/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c
+++ b/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c
@@ -172,6 +172,7 @@ r92ce_attach(struct rtwn_pci_softc *pc)
sc->sc_dump_tx_desc = r92ce_dump_tx_desc;
sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags;
sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags;
+ sc->sc_get_rx_stats = r92c_get_rx_stats;
sc->sc_get_rssi_cck = r92c_get_rssi_cck;
sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm;
sc->sc_classify_intr = r92ce_classify_intr;
diff --git a/sys/dev/rtwn/rtl8192c/r92c.h b/sys/dev/rtwn/rtl8192c/r92c.h
index 2b63179e79ac..b88b941dada0 100644
--- a/sys/dev/rtwn/rtl8192c/r92c.h
+++ b/sys/dev/rtwn/rtl8192c/r92c.h
@@ -99,6 +99,8 @@ void r92c_parse_rom(struct rtwn_softc *, uint8_t *);
int8_t r92c_get_rssi_cck(struct rtwn_softc *, void *);
int8_t r92c_get_rssi_ofdm(struct rtwn_softc *, void *);
uint8_t r92c_rx_radiotap_flags(const void *);
+void r92c_get_rx_stats(struct rtwn_softc *, struct ieee80211_rx_stats *,
+ const void *, const void *);
/* r92c_tx.c */
void r92c_tx_enable_ampdu(void *, int);
diff --git a/sys/dev/rtwn/rtl8192c/r92c_reg.h b/sys/dev/rtwn/rtl8192c/r92c_reg.h
index ff03d191b4e4..de39a0ff8f97 100644
--- a/sys/dev/rtwn/rtl8192c/r92c_reg.h
+++ b/sys/dev/rtwn/rtl8192c/r92c_reg.h
@@ -420,6 +420,7 @@
#define R92C_PBP_1024 4
/* Bits for R92C_TRXDMA_CTRL. */
+#define R92C_TRXDMA_CTRL_RX_SHIFT_EN 0x0002
#define R92C_TRXDMA_CTRL_RXDMA_AGG_EN 0x0004
#define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_M 0x0030
#define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_S 4
@@ -593,7 +594,8 @@
#define R92C_RCR_APPFCS 0x80000000
/* Bits for R92C_RX_DRVINFO_SZ. */
-#define R92C_RX_DRVINFO_SZ_DEF 4 /* XXX other values will not work */
+/* XXX other values will not work */
+#define R92C_RX_DRVINFO_SZ_DEF ((RTWN_PHY_STATUS_SIZE) / 8)
/* Bits for R92C_WMAC_TRXPTCL_CTL. */
#define R92C_WMAC_TRXPTCL_SHPRE 0x00020000
diff --git a/sys/dev/rtwn/rtl8192c/r92c_rx.c b/sys/dev/rtwn/rtl8192c/r92c_rx.c
index aa9da3ebc5a5..d1fdf5312393 100644
--- a/sys/dev/rtwn/rtl8192c/r92c_rx.c
+++ b/sys/dev/rtwn/rtl8192c/r92c_rx.c
@@ -100,3 +100,47 @@ r92c_rx_radiotap_flags(const void *buf)
flags = IEEE80211_RADIOTAP_F_SHORTGI;
return (flags);
}
+
+void
+r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs,
+ const void *desc, const void *physt_ptr)
+{
+ const struct r92c_rx_stat *stat = desc;
+ uint32_t rxdw1, rxdw3;
+ uint8_t rate;
+
+ rxdw1 = le32toh(stat->rxdw1);
+ rxdw3 = le32toh(stat->rxdw3);
+ rate = MS(rxdw3, R92C_RXDW3_RATE);
+
+ if (rxdw1 & R92C_RXDW1_AMPDU)
+ rxs->c_pktflags |= IEEE80211_RX_F_AMPDU;
+ else if (rxdw1 & R92C_RXDW1_AMPDU_MORE)
+ rxs->c_pktflags |= IEEE80211_RX_F_AMPDU_MORE;
+ if ((rxdw3 & R92C_RXDW3_SPLCP) && rate >= RTWN_RIDX_MCS(0))
+ rxs->c_pktflags |= IEEE80211_RX_F_SHORTGI;
+
+ if (rxdw3 & R92C_RXDW3_HT40)
+ rxs->c_width = IEEE80211_RX_FW_40MHZ;
+ else
+ rxs->c_width = IEEE80211_RX_FW_20MHZ;
+
+ if (RTWN_RATE_IS_CCK(rate))
+ rxs->c_phytype = IEEE80211_RX_FP_11B;
+ else if (rate < RTWN_RIDX_MCS(0))
+ rxs->c_phytype = IEEE80211_RX_FP_11G;
+ else
+ rxs->c_phytype = IEEE80211_RX_FP_11NG;
+
+ /* Map HW rate index to 802.11 rate. */
+ if (rate < RTWN_RIDX_MCS(0)) {
+ rxs->c_rate = ridx2rate[rate];
+ if (RTWN_RATE_IS_CCK(rate))
+ rxs->c_pktflags |= IEEE80211_RX_F_CCK;
+ else
+ rxs->c_pktflags |= IEEE80211_RX_F_OFDM;
+ } else { /* MCS0~15. */
+ rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12);
+ rxs->c_pktflags |= IEEE80211_RX_F_HT;
+ }
+}
diff --git a/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h b/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h
index 7fec70bec0c8..12dfd6656e43 100644
--- a/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h
+++ b/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h
@@ -45,6 +45,9 @@ struct r92c_rx_stat {
uint32_t rxdw1;
#define R92C_RXDW1_MACID_M 0x0000001f
#define R92C_RXDW1_MACID_S 0
+#define R92C_RXDW1_AMSDU 0x00002000
+#define R92C_RXDW1_AMPDU_MORE 0x00004000
+#define R92C_RXDW1_AMPDU 0x00008000
#define R92C_RXDW1_MC 0x40000000
#define R92C_RXDW1_BC 0x80000000
@@ -56,6 +59,8 @@ struct r92c_rx_stat {
#define R92C_RXDW3_SPLCP 0x00000100
#define R92C_RXDW3_HT40 0x00000200
#define R92C_RXDW3_HTC 0x00000400
+#define R92C_RXDW3_BSSID_FIT_M 0x00003000
+#define R92C_RXDW3_BSSID_FIT_S 12
uint32_t rxdw4;
uint32_t tsf_low;
diff --git a/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c b/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c
index c15d1e2a0340..88522f6a53b5 100644
--- a/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c
+++ b/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c
@@ -165,6 +165,7 @@ r92cu_attach(struct rtwn_usb_softc *uc)
sc->sc_dump_tx_desc = r92cu_dump_tx_desc;
sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags;
sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags;
+ sc->sc_get_rx_stats = r92c_get_rx_stats;
sc->sc_get_rssi_cck = r92c_get_rssi_cck;
sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm;
sc->sc_classify_intr = r92cu_classify_intr;
diff --git a/sys/dev/rtwn/rtl8812a/r12a.h b/sys/dev/rtwn/rtl8812a/r12a.h
index ec1d61e1e336..e8de45aa9da5 100644
--- a/sys/dev/rtwn/rtl8812a/r12a.h
+++ b/sys/dev/rtwn/rtl8812a/r12a.h
@@ -128,6 +128,8 @@ void r12a_ratectl_tx_complete(struct rtwn_softc *, uint8_t *, int);
void r12a_handle_c2h_report(struct rtwn_softc *, uint8_t *, int);
int r12a_check_frame_checksum(struct rtwn_softc *, struct mbuf *);
uint8_t r12a_rx_radiotap_flags(const void *);
+void r12a_get_rx_stats(struct rtwn_softc *, struct ieee80211_rx_stats *,
+ const void *, const void *);
/* r12a_tx.c */
void r12a_fill_tx_desc(struct rtwn_softc *, struct ieee80211_node *,
diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c
index 319fcd58fb8c..ba2ab9eca24b 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_rx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c
@@ -229,10 +229,99 @@ r12a_rx_radiotap_flags(const void *buf)
if (!(stat->rxdw4 & htole32(R12A_RXDW4_SPLCP)))
return (0);
- rate = MS(le32toh(stat->rxdw3), R92C_RXDW3_RATE);
+ rate = MS(le32toh(stat->rxdw3), R12A_RXDW3_RATE);
if (RTWN_RATE_IS_CCK(rate))
flags = IEEE80211_RADIOTAP_F_SHORTPRE;
else
flags = IEEE80211_RADIOTAP_F_SHORTGI;
return (flags);
}
+
+void
+r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs,
+ const void *desc, const void *physt_ptr)
+{
+ const struct r92c_rx_stat *stat = desc;
+ const struct r12a_rx_phystat *physt = physt_ptr;
+ uint32_t rxdw0, rxdw1, rxdw3, rxdw4;
+ uint8_t rate;
+
+ rxdw0 = le32toh(stat->rxdw0);
+ rxdw1 = le32toh(stat->rxdw1);
+ rxdw3 = le32toh(stat->rxdw3);
+ rxdw4 = le32toh(stat->rxdw4);
+ rate = MS(rxdw3, R12A_RXDW3_RATE);
+
+ /* TODO: STBC */
+ if (rxdw4 & R12A_RXDW4_LDPC)
+ rxs->c_pktflags |= IEEE80211_RX_F_LDPC;
+ if (rxdw1 & R12A_RXDW1_AMPDU) {
+ if (rxdw0 & R92C_RXDW0_PHYST)
+ rxs->c_pktflags |= IEEE80211_RX_F_AMPDU;
+ else
+ rxs->c_pktflags |= IEEE80211_RX_F_AMPDU_MORE;
+ }
+
+ if ((rxdw4 & R12A_RXDW4_SPLCP) && rate >= RTWN_RIDX_MCS(0))
+ rxs->c_pktflags |= IEEE80211_RX_F_SHORTGI;
+
+ switch (MS(rxdw4, R12A_RXDW4_BW)) {
+ case R12A_RXDW4_BW20:
+ rxs->c_width = IEEE80211_RX_FW_20MHZ;
+ break;
+ case R12A_RXDW4_BW40:
+ rxs->c_width = IEEE80211_RX_FW_40MHZ;
+ break;
+ case R12A_RXDW4_BW80:
+ rxs->c_width = IEEE80211_RX_FW_80MHZ;
+ break;
+ default:
+ break;
+ }
+
+ if (RTWN_RATE_IS_CCK(rate))
+ rxs->c_phytype = IEEE80211_RX_FP_11B;
+ else {
+ int is5ghz;
+
+ /* XXX magic */
+ /* XXX check with RTL8812AU */
+ is5ghz = (physt->cfosho[2] != 0x01);
+
+ if (rate < RTWN_RIDX_MCS(0)) {
+ if (is5ghz)
+ rxs->c_phytype = IEEE80211_RX_FP_11A;
+ else
+ rxs->c_phytype = IEEE80211_RX_FP_11G;
+ } else {
+ if (is5ghz)
+ rxs->c_phytype = IEEE80211_RX_FP_11NA;
+ else
+ rxs->c_phytype = IEEE80211_RX_FP_11NG;
+ }
+ }
+
+ /* Map HW rate index to 802.11 rate. */
+ if (rate < RTWN_RIDX_MCS(0)) {
+ rxs->c_rate = ridx2rate[rate];
+ if (RTWN_RATE_IS_CCK(rate))
+ rxs->c_pktflags |= IEEE80211_RX_F_CCK;
+ else
+ rxs->c_pktflags |= IEEE80211_RX_F_OFDM;
+ } else { /* MCS0~15. */
+ /* TODO: VHT rates */
+ rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12);
+ rxs->c_pktflags |= IEEE80211_RX_F_HT;
+ }
+
+ /*
+ * XXX always zero for RTL8821AU
+ * (vendor driver does not check this field)
+ */
+#if 0
+ rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
+ rxs->c_ieee = MS(le16toh(physt->phyw1), R12A_PHYW1_CHAN);
+ rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee,
+ (rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ);
+#endif
+}
diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h b/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h
index 8642ca85245f..c3d19527dfbf 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h
+++ b/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h
@@ -34,18 +34,26 @@
/* Rx MAC descriptor defines (chip-specific). */
/* Rx dword 1 */
#define R12A_RXDW1_AMSDU 0x00002000
+#define R12A_RXDW1_AMPDU 0x00008000
#define R12A_RXDW1_CKSUM_ERR 0x00100000
#define R12A_RXDW1_IPV6 0x00200000
#define R12A_RXDW1_UDP 0x00400000
#define R12A_RXDW1_CKSUM 0x00800000
/* Rx dword 2 */
#define R12A_RXDW2_RPT_C2H 0x10000000
+/* Rx dword 3 */
+#define R12A_RXDW3_RATE_M 0x0000007f
+#define R12A_RXDW3_RATE_S 0
/* Rx dword 4 */
#define R12A_RXDW4_SPLCP 0x00000001
#define R12A_RXDW4_LDPC 0x00000002
#define R12A_RXDW4_STBC 0x00000004
#define R12A_RXDW4_BW_M 0x00000030
#define R12A_RXDW4_BW_S 4
+#define R12A_RXDW4_BW20 0
+#define R12A_RXDW4_BW40 1
+#define R12A_RXDW4_BW80 2
+#define R12A_RXDW4_BW160 3
/* Rx PHY descriptor. */
struct r12a_rx_phystat {
diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c
index 3a286828a902..0f506241a192 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_tx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c
@@ -214,6 +214,17 @@ r12a_tx_set_sgi(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
}
+static void
+r12a_tx_set_ldpc(struct rtwn_softc *sc, struct r12a_tx_desc *txd,
+ struct ieee80211_node *ni)
+{
+ struct ieee80211vap *vap = ni->ni_vap;
+
+ if ((vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX) &&
+ (ni->ni_htcap & IEEE80211_HTCAP_LDPC))
+ txd->txdw5 |= htole32(R12A_TXDW5_DATA_LDPC);
+}
+
void
r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
struct mbuf *m, void *buf, uint8_t ridx, int maxretry)
@@ -284,6 +295,7 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
if (ridx >= RTWN_RIDX_MCS(0)) {
r12a_tx_set_ht40(sc, txd, ni);
r12a_tx_set_sgi(sc, txd, ni);
+ r12a_tx_set_ldpc(sc, txd, ni);
prot = ic->ic_htprotmode;
} else if (ic->ic_flags & IEEE80211_F_USEPROT)
prot = ic->ic_protmode;
diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c
index 855d2b0b7c80..7417098f8b3b 100644
--- a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c
+++ b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c
@@ -168,7 +168,15 @@ r12a_read_chipid_vendor(struct rtwn_softc *sc, uint32_t reg_sys_cfg)
static void
r12au_adj_devcaps(struct rtwn_softc *sc)
{
- /* TODO: LDPC, STBC etc */
+ struct r12a_softc *rs = sc->sc_priv;
+ struct ieee80211com *ic = &sc->sc_ic;
+
+ if (rs->chip & R12A_CHIP_C_CUT) {
+ ic->ic_htcaps |= IEEE80211_HTCAP_LDPC |
+ IEEE80211_HTC_TXLDPC;
+ }
+
+ /* TODO: STBC, VHT etc */
}
void
@@ -190,6 +198,7 @@ r12au_attach(struct rtwn_usb_softc *uc)
sc->sc_dump_tx_desc = r12au_dump_tx_desc;
sc->sc_tx_radiotap_flags = r12a_tx_radiotap_flags;
sc->sc_rx_radiotap_flags = r12a_rx_radiotap_flags;
+ sc->sc_get_rx_stats = r12a_get_rx_stats;
sc->sc_get_rssi_cck = r88e_get_rssi_cck;
sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm;
sc->sc_classify_intr = r12au_classify_intr;
diff --git a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c
index 6382c85916e1..952296978a88 100644
--- a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c
+++ b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c
@@ -157,10 +157,11 @@ r21au_adj_devcaps(struct rtwn_softc *sc)
struct ieee80211com *ic = &sc->sc_ic;
struct r12a_softc *rs = sc->sc_priv;
+ ic->ic_htcaps |= IEEE80211_HTC_TXLDPC;
if (rs->rs_radar != 0)
ic->ic_caps |= IEEE80211_C_DFS;
- /* TODO: LDPC etc */
+ /* TODO: VHT */
}
void
@@ -182,6 +183,7 @@ r21au_attach(struct rtwn_usb_softc *uc)
sc->sc_dump_tx_desc = r12au_dump_tx_desc;
sc->sc_tx_radiotap_flags = r12a_tx_radiotap_flags;
sc->sc_rx_radiotap_flags = r12a_rx_radiotap_flags;
+ sc->sc_get_rx_stats = r12a_get_rx_stats;
sc->sc_get_rssi_cck = r21a_get_rssi_cck;
sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm;
sc->sc_classify_intr = r12au_classify_intr;
diff --git a/sys/dev/rtwn/usb/rtwn_usb_rx.c b/sys/dev/rtwn/usb/rtwn_usb_rx.c
index 1a8345933ee0..63842222ff7d 100644
--- a/sys/dev/rtwn/usb/rtwn_usb_rx.c
+++ b/sys/dev/rtwn/usb/rtwn_usb_rx.c
@@ -236,7 +236,7 @@ rtwn_report_intr(struct rtwn_usb_softc *uc, struct usb_xfer *xfer,
}
static struct ieee80211_node *
-rtwn_rx_frame(struct rtwn_softc *sc, struct mbuf *m, int8_t *rssi)
+rtwn_rx_frame(struct rtwn_softc *sc, struct mbuf *m)
{
struct r92c_rx_stat stat;
@@ -244,7 +244,7 @@ rtwn_rx_frame(struct rtwn_softc *sc, struct mbuf *m, int8_t *rssi)
m_copydata(m, 0, sizeof(struct r92c_rx_stat), (caddr_t)&stat);
m_adj(m, sizeof(struct r92c_rx_stat));
- return (rtwn_rx_common(sc, m, &stat, rssi));
+ return (rtwn_rx_common(sc, m, &stat));
}
void
@@ -256,7 +256,6 @@ rtwn_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error)
struct ieee80211_node *ni;
struct mbuf *m = NULL, *next;
struct rtwn_data *data;
- int8_t nf, rssi;
RTWN_ASSERT_LOCKED(sc);
@@ -291,19 +290,15 @@ tr_setup:
next = m->m_next;
m->m_next = NULL;
- ni = rtwn_rx_frame(sc, m, &rssi);
+ ni = rtwn_rx_frame(sc, m);
RTWN_UNLOCK(sc);
- nf = RTWN_NOISE_FLOOR;
if (ni != NULL) {
- if (ni->ni_flags & IEEE80211_NODE_HT)
- m->m_flags |= M_AMPDU;
- (void)ieee80211_input(ni, m, rssi - nf, nf);
+ (void)ieee80211_input_mimo(ni, m);
ieee80211_free_node(ni);
} else {
- (void)ieee80211_input_all(ic, m,
- rssi - nf, nf);
+ (void)ieee80211_input_mimo_all(ic, m);
}
RTWN_LOCK(sc);
m = next;
diff --git a/sys/dev/sdhci/sdhci_fdt_gpio.c b/sys/dev/sdhci/sdhci_fdt_gpio.c
index 9935f17c66a2..be9f629aacf6 100644
--- a/sys/dev/sdhci/sdhci_fdt_gpio.c
+++ b/sys/dev/sdhci/sdhci_fdt_gpio.c
@@ -90,7 +90,7 @@ cd_setup(struct sdhci_fdt_gpio *gpio, phandle_t node)
gpio->slot->opt |= SDHCI_NON_REMOVABLE;
gpio->cd_disabled = true;
if (bootverbose)
- device_printf(dev, "Non-removable media");
+ device_printf(dev, "Non-removable media\n");
return;
}
@@ -177,8 +177,12 @@ wp_setup(struct sdhci_fdt_gpio *gpio, phandle_t node)
dev = gpio->dev;
- if (OF_hasprop(node, "wp-disable"))
+ if (OF_hasprop(node, "wp-disable")) {
+ gpio->wp_disabled = true;
+ if (bootverbose)
+ device_printf(dev, "Write protect disabled\n");
return;
+ }
if (gpio_pin_get_by_ofw_property(dev, node, "wp-gpios", &gpio->wp_pin))
return;
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index fcffbe522dfa..ac83d65f5a42 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -337,6 +337,11 @@ struct uaudio_hid {
uint8_t mute_id;
};
+#define UAUDIO_SPDIF_OUT 0x01 /* Enable S/PDIF output */
+#define UAUDIO_SPDIF_OUT_48K 0x02 /* Out sample rate = 48K */
+#define UAUDIO_SPDIF_OUT_96K 0x04 /* Out sample rate = 96K */
+#define UAUDIO_SPDIF_IN_MIX 0x10 /* Input mix enable */
+
struct uaudio_softc {
struct sbuf sc_sndstat;
struct sndcard_func sc_sndcard_func;
@@ -354,6 +359,7 @@ struct uaudio_softc {
struct usb_xfer *sc_mixer_xfer[1];
struct uaudio_mixer_node *sc_mixer_root;
struct uaudio_mixer_node *sc_mixer_curr;
+ int (*sc_set_spdif_fn) (struct uaudio_softc *, int);
uint32_t sc_mix_info;
uint32_t sc_recsrc_info;
@@ -885,6 +891,46 @@ uaudio_probe(device_t dev)
return (ENXIO);
}
+/*
+ * Set Cmedia CM6206 S/PDIF settings
+ * Source: CM6206 Datasheet v2.3.
+ */
+static int
+uaudio_set_spdif_cm6206(struct uaudio_softc *sc, int flags)
+{
+ uint8_t cmd[2][4] = {
+ {0x20, 0x20, 0x00, 0},
+ {0x20, 0x30, 0x02, 1}
+ };
+ int i;
+
+ if (flags & UAUDIO_SPDIF_OUT)
+ cmd[1][1] = 0x00;
+ else
+ cmd[1][1] = 0x02;
+
+ if (flags & UAUDIO_SPDIF_OUT_96K)
+ cmd[0][1] = 0x60; /* 96K: 3'b110 */
+
+ if (flags & UAUDIO_SPDIF_IN_MIX)
+ cmd[1][1] = 0x03; /* SPDIFMIX */
+
+ for (i = 0; i < 2; i++) {
+ if (usbd_req_set_report(sc->sc_udev, NULL,
+ cmd[i], sizeof(cmd[0]),
+ sc->sc_mixer_iface_index, UHID_OUTPUT_REPORT, 0) != 0) {
+ return (ENXIO);
+ }
+ }
+ return (0);
+}
+
+static int
+uaudio_set_spdif_dummy(struct uaudio_softc *sc, int flags)
+{
+ return (0);
+}
+
static int
uaudio_attach(device_t dev)
{
@@ -919,6 +965,12 @@ uaudio_attach(device_t dev)
if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS))
sc->sc_uq_au_vendor_class = 1;
+ /* set S/PDIF function */
+ if (usb_test_quirk(uaa, UQ_AU_SET_SPDIF_CM6206))
+ sc->sc_set_spdif_fn = uaudio_set_spdif_cm6206;
+ else
+ sc->sc_set_spdif_fn = uaudio_set_spdif_dummy;
+
umidi_init(dev);
device_set_usb_desc(dev);
@@ -1055,6 +1107,11 @@ uaudio_attach(device_t dev)
/* reload all mixer settings */
uaudio_mixer_reload_all(sc);
+ /* enable S/PDIF output, if any */
+ if (sc->sc_set_spdif_fn(sc,
+ UAUDIO_SPDIF_OUT | UAUDIO_SPDIF_OUT_48K) != 0) {
+ device_printf(dev, "Failed to enable S/PDIF at 48K\n");
+ }
return (0); /* success */
detach:
@@ -1139,6 +1196,9 @@ uaudio_detach_sub(device_t dev)
struct uaudio_softc *sc = device_get_softc(device_get_parent(dev));
int error = 0;
+ /* disable S/PDIF output, if any */
+ (void) sc->sc_set_spdif_fn(sc, 0);
+
repeat:
if (sc->sc_pcm_registered) {
error = pcm_unregister(dev);
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index c403b4ba45ab..b773c28a20b6 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -347,6 +347,7 @@ xhci_start_controller(struct xhci_softc *sc)
struct usb_page_search buf_res;
struct xhci_hw_root *phwr;
struct xhci_dev_ctx_addr *pdctxa;
+ usb_error_t err;
uint64_t addr;
uint32_t temp;
uint16_t i;
@@ -358,22 +359,9 @@ xhci_start_controller(struct xhci_softc *sc)
sc->sc_command_ccs = 1;
sc->sc_command_idx = 0;
- /* Reset controller */
- XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST);
-
- for (i = 0; i != 100; i++) {
- usb_pause_mtx(NULL, hz / 100);
- temp = (XREAD4(sc, oper, XHCI_USBCMD) & XHCI_CMD_HCRST) |
- (XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_CNR);
- if (!temp)
- break;
- }
-
- if (temp) {
- device_printf(sc->sc_bus.parent, "Controller "
- "reset timeout.\n");
- return (USB_ERR_IOERROR);
- }
+ err = xhci_reset_controller(sc);
+ if (err)
+ return (err);
/* set up number of device slots */
DPRINTF("CONFIG=0x%08x -> 0x%08x\n",
@@ -521,6 +509,33 @@ xhci_halt_controller(struct xhci_softc *sc)
}
usb_error_t
+xhci_reset_controller(struct xhci_softc *sc)
+{
+ uint32_t temp = 0;
+ uint16_t i;
+
+ DPRINTF("\n");
+
+ /* Reset controller */
+ XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST);
+
+ for (i = 0; i != 100; i++) {
+ usb_pause_mtx(NULL, hz / 100);
+ temp = (XREAD4(sc, oper, XHCI_USBCMD) & XHCI_CMD_HCRST) |
+ (XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_CNR);
+ if (!temp)
+ break;
+ }
+
+ if (temp) {
+ device_printf(sc->sc_bus.parent, "Controller "
+ "reset timeout.\n");
+ return (USB_ERR_IOERROR);
+ }
+ return (0);
+}
+
+usb_error_t
xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32)
{
uint32_t temp;
@@ -671,10 +686,12 @@ xhci_set_hw_power_sleep(struct usb_bus *bus, uint32_t state)
case USB_HW_POWER_SUSPEND:
DPRINTF("Stopping the XHCI\n");
xhci_halt_controller(sc);
+ xhci_reset_controller(sc);
break;
case USB_HW_POWER_SHUTDOWN:
DPRINTF("Stopping the XHCI\n");
xhci_halt_controller(sc);
+ xhci_reset_controller(sc);
break;
case USB_HW_POWER_RESUME:
DPRINTF("Starting the XHCI\n");
diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h
index e8bc9addb6f8..8ca628580c94 100644
--- a/sys/dev/usb/controller/xhci.h
+++ b/sys/dev/usb/controller/xhci.h
@@ -525,6 +525,7 @@ struct xhci_softc {
uint8_t xhci_use_polling(void);
usb_error_t xhci_halt_controller(struct xhci_softc *);
+usb_error_t xhci_reset_controller(struct xhci_softc *);
usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t);
usb_error_t xhci_start_controller(struct xhci_softc *);
void xhci_interrupt(struct xhci_softc *);
diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c
index cb0f3dafef5e..cada25ad5003 100644
--- a/sys/dev/usb/controller/xhci_pci.c
+++ b/sys/dev/usb/controller/xhci_pci.c
@@ -348,6 +348,7 @@ xhci_pci_detach(device_t self)
usb_callout_drain(&sc->sc_callout);
xhci_halt_controller(sc);
+ xhci_reset_controller(sc);
pci_disable_busmaster(self);
diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c
index 1c253585f40c..ae915f981860 100644
--- a/sys/dev/usb/quirk/usb_quirk.c
+++ b/sys/dev/usb/quirk/usb_quirk.c
@@ -519,6 +519,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = {
/* Non-standard USB AUDIO devices */
USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
+ USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206),
/*
* Quirks for manufacturers which USB devices does not respond
@@ -605,6 +606,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = {
[UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS",
[UQ_SINGLE_CMD_MIDI] = "UQ_SINGLE_CMD_MIDI",
[UQ_MSC_DYMO_EJECT] = "UQ_MSC_DYMO_EJECT",
+ [UQ_AU_SET_SPDIF_CM6206] = "UQ_AU_SET_SPDIF_CM6206",
};
/*------------------------------------------------------------------------*
diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h
index 7010916c42a3..f7e490ceb6b0 100644
--- a/sys/dev/usb/quirk/usb_quirk.h
+++ b/sys/dev/usb/quirk/usb_quirk.h
@@ -109,6 +109,7 @@ enum {
UQ_AU_VENDOR_CLASS, /* audio device uses vendor and not audio class */
UQ_SINGLE_CMD_MIDI, /* at most one command per USB packet */
UQ_MSC_DYMO_EJECT, /* ejects Dymo MSC device */
+ UQ_AU_SET_SPDIF_CM6206, /* enable S/PDIF audio output */
USB_QUIRK_MAX
};
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 797077e16f80..d3b81b7f7304 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -1443,6 +1443,9 @@ product CLIPSAL 5000CT2 0x0304 5000CT2 C-Bus Touch Screen
product CLIPSAL C5000CT2 0x0305 C5000CT2 C-Bus Touch Screen
product CLIPSAL L51xx 0x0401 L51xx C-Bus Dimmer
+/* C-Media products */
+product CMEDIA CM6206 0x0102 CM106 compatible sound device
+
/* CMOTECH products */
product CMOTECH CNU510 0x5141 CDMA Technologies USB modem
product CMOTECH CNU550 0x5543 CDMA 2000 1xRTT/1xEVDO USB modem
diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h
index 8cd1c4b6dcdf..37e5bbb62e3d 100644
--- a/sys/fs/tmpfs/tmpfs.h
+++ b/sys/fs/tmpfs/tmpfs.h
@@ -80,8 +80,10 @@ struct tmpfs_dirent {
uint32_t td_hash;
u_int td_namelen;
- /* Pointer to the node this entry refers to. In case this field
- * is NULL, the node is a whiteout. */
+ /*
+ * Pointer to the node this entry refers to. In case this field
+ * is NULL, the node is a whiteout.
+ */
struct tmpfs_node * td_node;
union {
@@ -94,21 +96,24 @@ struct tmpfs_dirent {
} ud;
};
-/* A directory in tmpfs holds a list of directory entries, which in
- * turn point to other files (which can be directories themselves).
+/*
+ * A directory in tmpfs holds a collection of directory entries, which
+ * in turn point to other files (which can be directories themselves).
*
- * In tmpfs, this list is managed by a RB-Tree, whose head is defined by
- * the struct tmpfs_dir type.
+ * In tmpfs, this collection is managed by a RB-Tree, whose head is
+ * defined by the struct tmpfs_dir type.
*
* It is important to notice that directories do not have entries for . and
* .. as other file systems do. These can be generated when requested
* based on information available by other means, such as the pointer to
* the node itself in the former case or the pointer to the parent directory
* in the latter case. This is done to simplify tmpfs's code and, more
- * importantly, to remove redundancy. */
+ * importantly, to remove redundancy.
+ */
RB_HEAD(tmpfs_dir, tmpfs_dirent);
-/* Each entry in a directory has a cookie that identifies it. Cookies
+/*
+ * Each entry in a directory has a cookie that identifies it. Cookies
* supersede offsets within directories because, given how tmpfs stores
* directories in memory, there is no such thing as an offset.
*
@@ -139,51 +144,67 @@ RB_HEAD(tmpfs_dir, tmpfs_dirent);
* a particular type. The code must be careful to only access those
* attributes that are actually allowed by the node's type.
*
- *
* Below is the key of locks used to protected the fields in the following
* structures.
- *
+ * (v) vnode lock in exclusive mode
+ * (vi) vnode lock in exclusive mode, or vnode lock in shared vnode and
+ * tn_interlock
+ * (i) tn_interlock
+ * (m) tmpfs_mount tm_allnode_lock
+ * (c) stable after creation
*/
struct tmpfs_node {
- /* Doubly-linked list entry which links all existing nodes for a
- * single file system. This is provided to ease the removal of
- * all nodes during the unmount operation. */
- LIST_ENTRY(tmpfs_node) tn_entries;
+ /*
+ * Doubly-linked list entry which links all existing nodes for
+ * a single file system. This is provided to ease the removal
+ * of all nodes during the unmount operation, and to support
+ * the implementation of VOP_VNTOCNP(). tn_attached is false
+ * when the node is removed from list and unlocked.
+ */
+ LIST_ENTRY(tmpfs_node) tn_entries; /* (m) */
+ bool tn_attached; /* (m) */
- /* The node's type. Any of 'VBLK', 'VCHR', 'VDIR', 'VFIFO',
+ /*
+ * The node's type. Any of 'VBLK', 'VCHR', 'VDIR', 'VFIFO',
* 'VLNK', 'VREG' and 'VSOCK' is allowed. The usage of vnode
* types instead of a custom enumeration is to make things simpler
- * and faster, as we do not need to convert between two types. */
- enum vtype tn_type;
+ * and faster, as we do not need to convert between two types.
+ */
+ enum vtype tn_type; /* (c) */
/* Node identifier. */
- ino_t tn_id;
+ ino_t tn_id; /* (c) */
- /* Node's internal status. This is used by several file system
+ /*
+ * Node's internal status. This is used by several file system
* operations to do modifications to the node in a delayed
- * fashion. */
- int tn_status;
+ * fashion.
+ */
+ int tn_status; /* (vi) */
#define TMPFS_NODE_ACCESSED (1 << 1)
#define TMPFS_NODE_MODIFIED (1 << 2)
#define TMPFS_NODE_CHANGED (1 << 3)
- /* The node size. It does not necessarily match the real amount
- * of memory consumed by it. */
- off_t tn_size;
+ /*
+ * The node size. It does not necessarily match the real amount
+ * of memory consumed by it.
+ */
+ off_t tn_size; /* (v) */
/* Generic node attributes. */
- uid_t tn_uid;
- gid_t tn_gid;
- mode_t tn_mode;
- u_long tn_flags;
- nlink_t tn_links;
- struct timespec tn_atime;
- struct timespec tn_mtime;
- struct timespec tn_ctime;
- struct timespec tn_birthtime;
- unsigned long tn_gen;
+ uid_t tn_uid; /* (v) */
+ gid_t tn_gid; /* (v) */
+ mode_t tn_mode; /* (v) */
+ u_long tn_flags; /* (v) */
+ nlink_t tn_links; /* (v) */
+ struct timespec tn_atime; /* (vi) */
+ struct timespec tn_mtime; /* (vi) */
+ struct timespec tn_ctime; /* (vi) */
+ struct timespec tn_birthtime; /* (v) */
+ unsigned long tn_gen; /* (c) */
- /* As there is a single vnode for each active file within the
+ /*
+ * As there is a single vnode for each active file within the
* system, care has to be taken to avoid allocating more than one
* vnode per file. In order to do this, a bidirectional association
* is kept between vnodes and nodes.
@@ -196,76 +217,84 @@ struct tmpfs_node {
* tn_vnode.
*
* May be NULL when the node is unused (that is, no vnode has been
- * allocated for it or it has been reclaimed). */
- struct vnode * tn_vnode;
+ * allocated for it or it has been reclaimed).
+ */
+ struct vnode * tn_vnode; /* (i) */
- /* Interlock to protect tn_vpstate, and tn_status under shared
+ /*
+ * Interlock to protect tn_vpstate, and tn_status under shared
* vnode lock.
*/
struct mtx tn_interlock;
- /* Identify if current node has vnode assiocate with
+ /*
+ * Identify if current node has vnode assiocate with
* or allocating vnode.
*/
- int tn_vpstate;
+ int tn_vpstate; /* (i) */
+
+ /* Transient refcounter on this node. */
+ u_int tn_refcount; /* (m) + (i) */
/* misc data field for different tn_type node */
union {
/* Valid when tn_type == VBLK || tn_type == VCHR. */
- dev_t tn_rdev;
+ dev_t tn_rdev; /* (c) */
/* Valid when tn_type == VDIR. */
struct tn_dir {
- /* Pointer to the parent directory. The root
+ /*
+ * Pointer to the parent directory. The root
* directory has a pointer to itself in this field;
- * this property identifies the root node. */
+ * this property identifies the root node.
+ */
struct tmpfs_node * tn_parent;
- /* Head of a tree that links the contents of
- * the directory together. */
+ /*
+ * Head of a tree that links the contents of
+ * the directory together.
+ */
struct tmpfs_dir tn_dirhead;
- /* Head of a list the contains fake directory entries
+ /*
+ * Head of a list the contains fake directory entries
* heads, i.e. entries with TMPFS_DIRCOOKIE_DUPHEAD
- * flag. */
+ * flag.
+ */
struct tmpfs_dir_duphead tn_dupindex;
- /* Number and pointer of the first directory entry
+ /*
+ * Number and pointer of the first directory entry
* returned by the readdir operation if it were
* called again to continue reading data from the
* same directory as before. This is used to speed
* up reads of long directories, assuming that no
* more than one read is in progress at a given time.
- * Otherwise, these values are discarded. */
+ * Otherwise, these values are discarded.
+ */
off_t tn_readdir_lastn;
struct tmpfs_dirent * tn_readdir_lastp;
} tn_dir;
/* Valid when tn_type == VLNK. */
/* The link's target, allocated from a string pool. */
- char * tn_link;
+ char * tn_link; /* (c) */
/* Valid when tn_type == VREG. */
struct tn_reg {
- /* The contents of regular files stored in a tmpfs
- * file system are represented by a single anonymous
- * memory object (aobj, for short). The aobj provides
- * direct access to any position within the file,
- * because its contents are always mapped in a
- * contiguous region of virtual memory. It is a task
- * of the memory management subsystem (see uvm(9)) to
- * issue the required page ins or page outs whenever
- * a position within the file is accessed. */
- vm_object_t tn_aobj;
-
- }tn_reg;
-
- /* Valid when tn_type = VFIFO */
- struct tn_fifo {
- fo_rdwr_t *tn_fo_read;
- fo_rdwr_t *tn_fo_write;
- }tn_fifo;
- }tn_spec;
+ /*
+ * The contents of regular files stored in a
+ * tmpfs file system are represented by a
+ * single anonymous memory object (aobj, for
+ * short). The aobj provides direct access to
+ * any position within the file. It is a task
+ * of the memory management subsystem to issue
+ * the required page ins or page outs whenever
+ * a position within the file is accessed.
+ */
+ vm_object_t tn_aobj; /* (c) */
+ } tn_reg;
+ } tn_spec; /* (v) */
};
LIST_HEAD(tmpfs_node_list, tmpfs_node);
@@ -283,21 +312,12 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node);
#ifdef INVARIANTS
#define TMPFS_ASSERT_LOCKED(node) do { \
- MPASS(node != NULL); \
- MPASS(node->tn_vnode != NULL); \
- if (!VOP_ISLOCKED(node->tn_vnode) && \
- !mtx_owned(TMPFS_NODE_MTX(node))) \
- panic("tmpfs: node is not locked: %p", node); \
- } while (0)
-#define TMPFS_ASSERT_ELOCKED(node) do { \
MPASS((node) != NULL); \
MPASS((node)->tn_vnode != NULL); \
- mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); \
- ASSERT_VOP_LOCKED((node)->tn_vnode, "tmpfs"); \
+ ASSERT_VOP_LOCKED((node)->tn_vnode, "tmpfs assert"); \
} while (0)
#else
#define TMPFS_ASSERT_LOCKED(node) (void)0
-#define TMPFS_ASSERT_ELOCKED(node) (void)0
#endif
#define TMPFS_VNODE_ALLOCATING 1
@@ -309,26 +329,32 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node);
* Internal representation of a tmpfs mount point.
*/
struct tmpfs_mount {
- /* Maximum number of memory pages available for use by the file
+ /*
+ * Maximum number of memory pages available for use by the file
* system, set during mount time. This variable must never be
* used directly as it may be bigger than the current amount of
* free memory; in the extreme case, it will hold the ULONG_MAX
- * value. */
+ * value.
+ */
u_long tm_pages_max;
/* Number of pages in use by the file system. */
u_long tm_pages_used;
- /* Pointer to the node representing the root directory of this
- * file system. */
+ /*
+ * Pointer to the node representing the root directory of this
+ * file system.
+ */
struct tmpfs_node * tm_root;
- /* Maximum number of possible nodes for this file system; set
+ /*
+ * Maximum number of possible nodes for this file system; set
* during mount time. We need a hard limit on the maximum number
* of nodes to avoid allocating too much of them; their objects
* cannot be released until the file system is unmounted.
* Otherwise, we could easily run out of memory by creating lots
- * of empty files and then simply removing them. */
+ * of empty files and then simply removing them.
+ */
ino_t tm_nodes_max;
/* unrhdr used to allocate inode numbers */
@@ -337,38 +363,33 @@ struct tmpfs_mount {
/* Number of nodes currently that are in use. */
ino_t tm_nodes_inuse;
+ /* Refcounter on this struct tmpfs_mount. */
+ uint64_t tm_refcount;
+
/* maximum representable file size */
u_int64_t tm_maxfilesize;
- /* Nodes are organized in two different lists. The used list
- * contains all nodes that are currently used by the file system;
- * i.e., they refer to existing files. The available list contains
- * all nodes that are currently available for use by new files.
- * Nodes must be kept in this list (instead of deleting them)
- * because we need to keep track of their generation number (tn_gen
- * field).
- *
- * Note that nodes are lazily allocated: if the available list is
- * empty and we have enough space to create more nodes, they will be
- * created and inserted in the used list. Once these are released,
- * they will go into the available list, remaining alive until the
- * file system is unmounted. */
+ /*
+ * The used list contains all nodes that are currently used by
+ * the file system; i.e., they refer to existing files.
+ */
struct tmpfs_node_list tm_nodes_used;
- /* All node lock to protect the node list and tmp_pages_used */
- struct mtx allnode_lock;
+ /* All node lock to protect the node list and tmp_pages_used. */
+ struct mtx tm_allnode_lock;
- /* Pools used to store file system meta data. These are not shared
- * across several instances of tmpfs for the reasons described in
- * tmpfs_pool.c. */
+ /* Zones used to store file system meta data, per tmpfs mount. */
uma_zone_t tm_dirent_pool;
uma_zone_t tm_node_pool;
/* Read-only status. */
- int tm_ronly;
+ bool tm_ronly;
+ /* Do not use namecache. */
+ bool tm_nonc;
};
-#define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock)
-#define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock)
+#define TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock)
+#define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock)
+#define TMPFS_MP_ASSERT_LOCKED(tm) mtx_assert(&(tm)->tm_allnode_lock, MA_OWNED)
/*
* This structure maps a file identifier to a tmpfs node. Used by the
@@ -381,15 +402,24 @@ struct tmpfs_fid {
unsigned long tf_gen;
};
+struct tmpfs_dir_cursor {
+ struct tmpfs_dirent *tdc_current;
+ struct tmpfs_dirent *tdc_tree;
+};
+
#ifdef _KERNEL
/*
* Prototypes for tmpfs_subr.c.
*/
+void tmpfs_ref_node(struct tmpfs_node *node);
+void tmpfs_ref_node_locked(struct tmpfs_node *node);
int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype,
uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *,
char *, dev_t, struct tmpfs_node **);
void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *);
+bool tmpfs_free_node_locked(struct tmpfs_mount *, struct tmpfs_node *, bool);
+void tmpfs_free_tmp(struct tmpfs_mount *);
int tmpfs_alloc_dirent(struct tmpfs_mount *, struct tmpfs_node *,
const char *, u_int, struct tmpfs_dirent **);
void tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *);
@@ -425,6 +455,10 @@ void tmpfs_itimes(struct vnode *, const struct timespec *,
void tmpfs_set_status(struct tmpfs_node *node, int status);
void tmpfs_update(struct vnode *);
int tmpfs_truncate(struct vnode *, off_t);
+struct tmpfs_dirent *tmpfs_dir_first(struct tmpfs_node *dnode,
+ struct tmpfs_dir_cursor *dc);
+struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node *dnode,
+ struct tmpfs_dir_cursor *dc);
/*
* Convenience macros to simplify some logical expressions.
@@ -450,10 +484,6 @@ int tmpfs_truncate(struct vnode *, off_t);
} while (0)
/*
- * Memory management stuff.
- */
-
-/*
* Amount of memory pages to reserve for the system (e.g., to not use by
* tmpfs).
*/
@@ -470,37 +500,41 @@ size_t tmpfs_pages_used(struct tmpfs_mount *tmp);
* specific ones.
*/
-static inline
-struct tmpfs_mount *
+static inline struct tmpfs_mount *
VFS_TO_TMPFS(struct mount *mp)
{
struct tmpfs_mount *tmp;
- MPASS((mp) != NULL && (mp)->mnt_data != NULL);
- tmp = (struct tmpfs_mount *)(mp)->mnt_data;
- return tmp;
+ MPASS(mp != NULL && mp->mnt_data != NULL);
+ tmp = (struct tmpfs_mount *)mp->mnt_data;
+ return (tmp);
}
-static inline
-struct tmpfs_node *
+static inline struct tmpfs_node *
VP_TO_TMPFS_NODE(struct vnode *vp)
{
struct tmpfs_node *node;
- MPASS((vp) != NULL && (vp)->v_data != NULL);
+ MPASS(vp != NULL && vp->v_data != NULL);
node = (struct tmpfs_node *)vp->v_data;
- return node;
+ return (node);
}
-static inline
-struct tmpfs_node *
+static inline struct tmpfs_node *
VP_TO_TMPFS_DIR(struct vnode *vp)
{
struct tmpfs_node *node;
node = VP_TO_TMPFS_NODE(vp);
TMPFS_VALIDATE_DIR(node);
- return node;
+ return (node);
+}
+
+static inline bool
+tmpfs_use_nc(struct vnode *vp)
+{
+
+ return (!(VFS_TO_TMPFS(vp->v_mount)->tm_nonc));
}
#endif /* _FS_TMPFS_TMPFS_H_ */
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 0af55eccf8bf..b04d28ba4055 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -62,11 +62,6 @@ __FBSDID("$FreeBSD$");
#include <fs/tmpfs/tmpfs_fifoops.h>
#include <fs/tmpfs/tmpfs_vnops.h>
-struct tmpfs_dir_cursor {
- struct tmpfs_dirent *tdc_current;
- struct tmpfs_dirent *tdc_tree;
-};
-
SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmpfs file system");
static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED;
@@ -136,6 +131,26 @@ tmpfs_pages_check_avail(struct tmpfs_mount *tmp, size_t req_pages)
return (1);
}
+void
+tmpfs_ref_node(struct tmpfs_node *node)
+{
+
+ TMPFS_NODE_LOCK(node);
+ tmpfs_ref_node_locked(node);
+ TMPFS_NODE_UNLOCK(node);
+}
+
+void
+tmpfs_ref_node_locked(struct tmpfs_node *node)
+{
+
+ TMPFS_NODE_ASSERT_LOCKED(node);
+ KASSERT(node->tn_refcount > 0, ("node %p zero refcount", node));
+ KASSERT(node->tn_refcount < UINT_MAX, ("node %p refcount %u", node,
+ node->tn_refcount));
+ node->tn_refcount++;
+}
+
/*
* Allocates a new node of type 'type' inside the 'tmp' mount point, with
* its owner set to 'uid', its group to 'gid' and its mode set to 'mode',
@@ -198,8 +213,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type,
return (EBUSY);
}
- nnode = (struct tmpfs_node *)uma_zalloc_arg(
- tmp->tm_node_pool, tmp, M_WAITOK);
+ nnode = (struct tmpfs_node *)uma_zalloc_arg(tmp->tm_node_pool, tmp,
+ M_WAITOK);
/* Generic initialization. */
nnode->tn_type = type;
@@ -210,6 +225,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type,
nnode->tn_gid = gid;
nnode->tn_mode = mode;
nnode->tn_id = alloc_unr(tmp->tm_ino_unr);
+ nnode->tn_refcount = 1;
/* Type-specific initialization. */
switch (nnode->tn_type) {
@@ -257,58 +273,65 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type,
break;
default:
- panic("tmpfs_alloc_node: type %p %d", nnode, (int)nnode->tn_type);
+ panic("tmpfs_alloc_node: type %p %d", nnode,
+ (int)nnode->tn_type);
}
TMPFS_LOCK(tmp);
LIST_INSERT_HEAD(&tmp->tm_nodes_used, nnode, tn_entries);
+ nnode->tn_attached = true;
tmp->tm_nodes_inuse++;
+ tmp->tm_refcount++;
TMPFS_UNLOCK(tmp);
*node = nnode;
- return 0;
+ return (0);
}
/*
* Destroys the node pointed to by node from the file system 'tmp'.
- * If the node does not belong to the given mount point, the results are
- * unpredicted.
- *
- * If the node references a directory; no entries are allowed because
- * their removal could need a recursive algorithm, something forbidden in
- * kernel space. Furthermore, there is not need to provide such
- * functionality (recursive removal) because the only primitives offered
- * to the user are the removal of empty directories and the deletion of
- * individual files.
- *
- * Note that nodes are not really deleted; in fact, when a node has been
- * allocated, it cannot be deleted during the whole life of the file
- * system. Instead, they are moved to the available list and remain there
- * until reused.
+ * If the node references a directory, no entries are allowed.
*/
void
tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node)
{
+
+ TMPFS_LOCK(tmp);
+ TMPFS_NODE_LOCK(node);
+ if (!tmpfs_free_node_locked(tmp, node, false)) {
+ TMPFS_NODE_UNLOCK(node);
+ TMPFS_UNLOCK(tmp);
+ }
+}
+
+bool
+tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node,
+ bool detach)
+{
vm_object_t uobj;
+ TMPFS_MP_ASSERT_LOCKED(tmp);
+ TMPFS_NODE_ASSERT_LOCKED(node);
+ KASSERT(node->tn_refcount > 0, ("node %p refcount zero", node));
+
+ node->tn_refcount--;
+ if (node->tn_attached && (detach || node->tn_refcount == 0)) {
+ MPASS(tmp->tm_nodes_inuse > 0);
+ tmp->tm_nodes_inuse--;
+ LIST_REMOVE(node, tn_entries);
+ node->tn_attached = false;
+ }
+ if (node->tn_refcount > 0)
+ return (false);
+
#ifdef INVARIANTS
- TMPFS_NODE_LOCK(node);
MPASS(node->tn_vnode == NULL);
MPASS((node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0);
- TMPFS_NODE_UNLOCK(node);
#endif
-
- TMPFS_LOCK(tmp);
- LIST_REMOVE(node, tn_entries);
- tmp->tm_nodes_inuse--;
+ TMPFS_NODE_UNLOCK(node);
TMPFS_UNLOCK(tmp);
switch (node->tn_type) {
- case VNON:
- /* Do not do anything. VNON is provided to let the
- * allocation routine clean itself easily by avoiding
- * duplicating code in it. */
- /* FALLTHROUGH */
case VBLK:
/* FALLTHROUGH */
case VCHR:
@@ -340,6 +363,9 @@ tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node)
free_unr(tmp->tm_ino_unr, node->tn_id);
uma_zfree(tmp->tm_node_pool, node);
+ TMPFS_LOCK(tmp);
+ tmpfs_free_tmp(tmp);
+ return (true);
}
static __inline uint32_t
@@ -485,13 +511,16 @@ tmpfs_alloc_vp(struct mount *mp, struct tmpfs_node *node, int lkflag,
struct vnode **vpp)
{
struct vnode *vp;
+ struct tmpfs_mount *tm;
vm_object_t object;
int error;
error = 0;
-loop:
+ tm = VFS_TO_TMPFS(mp);
TMPFS_NODE_LOCK(node);
-loop1:
+ tmpfs_ref_node_locked(node);
+loop:
+ TMPFS_NODE_ASSERT_LOCKED(node);
if ((vp = node->tn_vnode) != NULL) {
MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0);
VI_LOCK(vp);
@@ -511,12 +540,14 @@ loop1:
msleep(&node->tn_vnode, TMPFS_NODE_MTX(node),
0, "tmpfsE", 0);
}
- goto loop1;
+ goto loop;
}
TMPFS_NODE_UNLOCK(node);
error = vget(vp, lkflag | LK_INTERLOCK, curthread);
- if (error == ENOENT)
+ if (error == ENOENT) {
+ TMPFS_NODE_LOCK(node);
goto loop;
+ }
if (error != 0) {
vp = NULL;
goto out;
@@ -528,6 +559,7 @@ loop1:
*/
if (node->tn_vnode == NULL || node->tn_vnode != vp) {
vput(vp);
+ TMPFS_NODE_LOCK(node);
goto loop;
}
@@ -549,11 +581,9 @@ loop1:
if (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) {
node->tn_vpstate |= TMPFS_VNODE_WANT;
error = msleep((caddr_t) &node->tn_vpstate,
- TMPFS_NODE_MTX(node), PDROP | PCATCH,
- "tmpfs_alloc_vp", 0);
- if (error)
- return error;
-
+ TMPFS_NODE_MTX(node), 0, "tmpfs_alloc_vp", 0);
+ if (error != 0)
+ goto out;
goto loop;
} else
node->tn_vpstate |= TMPFS_VNODE_ALLOCATING;
@@ -561,7 +591,8 @@ loop1:
TMPFS_NODE_UNLOCK(node);
/* Get a new vnode and associate it with our node. */
- error = getnewvnode("tmpfs", mp, &tmpfs_vnodeop_entries, &vp);
+ error = getnewvnode("tmpfs", mp, VFS_TO_TMPFS(mp)->tm_nonc ?
+ &tmpfs_vnodeop_nonc_entries : &tmpfs_vnodeop_entries, &vp);
if (error != 0)
goto unlock;
MPASS(vp != NULL);
@@ -609,7 +640,7 @@ loop1:
VN_LOCK_ASHARE(vp);
error = insmntque1(vp, mp, tmpfs_insmntque_dtr, NULL);
- if (error)
+ if (error != 0)
vp = NULL;
unlock:
@@ -627,18 +658,19 @@ unlock:
TMPFS_NODE_UNLOCK(node);
out:
- *vpp = vp;
+ if (error == 0) {
+ *vpp = vp;
#ifdef INVARIANTS
- if (error == 0) {
MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp));
TMPFS_NODE_LOCK(node);
MPASS(*vpp == node->tn_vnode);
TMPFS_NODE_UNLOCK(node);
- }
#endif
+ }
+ tmpfs_free_node(tm, node);
- return error;
+ return (error);
}
/*
@@ -681,7 +713,7 @@ tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp, struct vattr *vap,
struct tmpfs_node *node;
struct tmpfs_node *parent;
- MPASS(VOP_ISLOCKED(dvp));
+ ASSERT_VOP_ELOCKED(dvp, "tmpfs_alloc_file");
MPASS(cnp->cn_flags & HASBUF);
tmp = VFS_TO_TMPFS(dvp->v_mount);
@@ -706,8 +738,8 @@ tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp, struct vattr *vap,
/* Allocate a node that represents the new file. */
error = tmpfs_alloc_node(dvp->v_mount, tmp, vap->va_type,
- cnp->cn_cred->cr_uid,
- dnode->tn_gid, vap->va_mode, parent, target, vap->va_rdev, &node);
+ cnp->cn_cred->cr_uid, dnode->tn_gid, vap->va_mode, parent,
+ target, vap->va_rdev, &node);
if (error != 0)
return (error);
@@ -736,7 +768,7 @@ tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp, struct vattr *vap,
return (0);
}
-static struct tmpfs_dirent *
+struct tmpfs_dirent *
tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc)
{
struct tmpfs_dirent *de;
@@ -750,7 +782,7 @@ tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc)
return (dc->tdc_current);
}
-static struct tmpfs_dirent *
+struct tmpfs_dirent *
tmpfs_dir_next(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc)
{
struct tmpfs_dirent *de;
@@ -1115,9 +1147,8 @@ tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struct uio *uio)
* Return ENOENT if the current node is already removed.
*/
TMPFS_ASSERT_LOCKED(node);
- if (node->tn_dir.tn_parent == NULL) {
+ if (node->tn_dir.tn_parent == NULL)
return (ENOENT);
- }
TMPFS_NODE_LOCK(node->tn_dir.tn_parent);
dent.d_fileno = node->tn_dir.tn_parent->tn_id;
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index 869b6f1feafb..4b336ba150dd 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -79,7 +79,7 @@ static void tmpfs_susp_clean(struct mount *);
static const char *tmpfs_opts[] = {
"from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export",
- "union", NULL
+ "union", "nonc", NULL
};
static const char *tmpfs_updateopts[] = {
@@ -138,6 +138,7 @@ tmpfs_mount(struct mount *mp)
struct tmpfs_node *root;
struct thread *td = curthread;
int error;
+ bool nonc;
/* Size counters. */
u_quad_t pages;
off_t nodes_max, size_max, maxfilesize;
@@ -186,11 +187,12 @@ tmpfs_mount(struct mount *mp)
size_max = 0;
if (vfs_getopt_size(mp->mnt_optnew, "maxfilesize", &maxfilesize) != 0)
maxfilesize = 0;
+ nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0;
/* Do not allow mounts if we do not have enough memory to preserve
* the minimum reserved pages. */
if (tmpfs_mem_avail() < TMPFS_PAGES_MINRESERVED)
- return ENOSPC;
+ return (ENOSPC);
/* Get the maximum number of memory pages this file system is
* allowed to use, based on the maximum size the user passed in
@@ -219,37 +221,35 @@ tmpfs_mount(struct mount *mp)
tmp = (struct tmpfs_mount *)malloc(sizeof(struct tmpfs_mount),
M_TMPFSMNT, M_WAITOK | M_ZERO);
- mtx_init(&tmp->allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF);
+ mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF);
tmp->tm_nodes_max = nodes_max;
tmp->tm_nodes_inuse = 0;
+ tmp->tm_refcount = 1;
tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX;
LIST_INIT(&tmp->tm_nodes_used);
tmp->tm_pages_max = pages;
tmp->tm_pages_used = 0;
- tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->allnode_lock);
+ tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->tm_allnode_lock);
tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent",
- sizeof(struct tmpfs_dirent),
- NULL, NULL, NULL, NULL,
+ sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, 0);
tmp->tm_node_pool = uma_zcreate("TMPFS node",
- sizeof(struct tmpfs_node),
- tmpfs_node_ctor, tmpfs_node_dtor,
- tmpfs_node_init, tmpfs_node_fini,
- UMA_ALIGN_PTR, 0);
+ sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor,
+ tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0);
tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
+ tmp->tm_nonc = nonc;
/* Allocate the root node. */
- error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid,
- root_gid, root_mode & ALLPERMS, NULL, NULL,
- VNOVAL, &root);
+ error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid,
+ root_mode & ALLPERMS, NULL, NULL, VNOVAL, &root);
if (error != 0 || root == NULL) {
- uma_zdestroy(tmp->tm_node_pool);
- uma_zdestroy(tmp->tm_dirent_pool);
- delete_unrhdr(tmp->tm_ino_unr);
- free(tmp, M_TMPFSMNT);
- return error;
+ uma_zdestroy(tmp->tm_node_pool);
+ uma_zdestroy(tmp->tm_dirent_pool);
+ delete_unrhdr(tmp->tm_ino_unr);
+ free(tmp, M_TMPFSMNT);
+ return (error);
}
KASSERT(root->tn_id == 2,
("tmpfs root with invalid ino: %ju", (uintmax_t)root->tn_id));
@@ -308,25 +308,17 @@ tmpfs_unmount(struct mount *mp, int mntflags)
TMPFS_LOCK(tmp);
while ((node = LIST_FIRST(&tmp->tm_nodes_used)) != NULL) {
- TMPFS_UNLOCK(tmp);
+ TMPFS_NODE_LOCK(node);
if (node->tn_type == VDIR)
tmpfs_dir_destroy(tmp, node);
- tmpfs_free_node(tmp, node);
- TMPFS_LOCK(tmp);
+ if (tmpfs_free_node_locked(tmp, node, true))
+ TMPFS_LOCK(tmp);
+ else
+ TMPFS_NODE_UNLOCK(node);
}
- TMPFS_UNLOCK(tmp);
-
- uma_zdestroy(tmp->tm_dirent_pool);
- uma_zdestroy(tmp->tm_node_pool);
- delete_unrhdr(tmp->tm_ino_unr);
- mtx_destroy(&tmp->allnode_lock);
- MPASS(tmp->tm_pages_used == 0);
- MPASS(tmp->tm_nodes_inuse == 0);
-
- /* Throw away the tmpfs_mount structure. */
- free(mp->mnt_data, M_TMPFSMNT);
mp->mnt_data = NULL;
+ tmpfs_free_tmp(tmp);
vfs_write_resume(mp, VR_START_WRITE);
MNT_ILOCK(mp);
@@ -336,52 +328,74 @@ tmpfs_unmount(struct mount *mp, int mntflags)
return (0);
}
+void
+tmpfs_free_tmp(struct tmpfs_mount *tmp)
+{
+
+ MPASS(tmp->tm_refcount > 0);
+ tmp->tm_refcount--;
+ if (tmp->tm_refcount > 0) {
+ TMPFS_UNLOCK(tmp);
+ return;
+ }
+ TMPFS_UNLOCK(tmp);
+
+ uma_zdestroy(tmp->tm_dirent_pool);
+ uma_zdestroy(tmp->tm_node_pool);
+ delete_unrhdr(tmp->tm_ino_unr);
+
+ mtx_destroy(&tmp->tm_allnode_lock);
+ MPASS(tmp->tm_pages_used == 0);
+ MPASS(tmp->tm_nodes_inuse == 0);
+
+ free(tmp, M_TMPFSMNT);
+}
+
static int
tmpfs_root(struct mount *mp, int flags, struct vnode **vpp)
{
int error;
- error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp);
- if (!error)
+ error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp);
+ if (error == 0)
(*vpp)->v_vflag |= VV_ROOT;
-
- return error;
+ return (error);
}
static int
tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags,
struct vnode **vpp)
{
- boolean_t found;
struct tmpfs_fid *tfhp;
struct tmpfs_mount *tmp;
struct tmpfs_node *node;
+ int error;
tmp = VFS_TO_TMPFS(mp);
tfhp = (struct tmpfs_fid *)fhp;
if (tfhp->tf_len != sizeof(struct tmpfs_fid))
- return EINVAL;
+ return (EINVAL);
if (tfhp->tf_id >= tmp->tm_nodes_max)
- return EINVAL;
-
- found = FALSE;
+ return (EINVAL);
TMPFS_LOCK(tmp);
LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) {
if (node->tn_id == tfhp->tf_id &&
node->tn_gen == tfhp->tf_gen) {
- found = TRUE;
+ tmpfs_ref_node(node);
break;
}
}
TMPFS_UNLOCK(tmp);
- if (found)
- return (tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp));
-
- return (EINVAL);
+ if (node != NULL) {
+ error = tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp);
+ tmpfs_free_node(tmp, node);
+ } else
+ error = EINVAL;
+ return (error);
}
/* ARGSUSED2 */
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 2e2fe9f11af8..a2b01213d7ae 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -76,13 +76,11 @@ tmpfs_vn_get_ino_alloc(struct mount *mp, void *arg, int lkflags,
}
static int
-tmpfs_lookup(struct vop_cachedlookup_args *v)
+tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
{
- struct vnode *dvp = v->a_dvp;
- struct vnode **vpp = v->a_vpp;
- struct componentname *cnp = v->a_cnp;
struct tmpfs_dirent *de;
- struct tmpfs_node *dnode;
+ struct tmpfs_node *dnode, *pnode;
+ struct tmpfs_mount *tm;
int error;
dnode = VP_TO_TMPFS_DIR(dvp);
@@ -104,8 +102,12 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
goto out;
}
if (cnp->cn_flags & ISDOTDOT) {
+ tm = VFS_TO_TMPFS(dvp->v_mount);
+ pnode = dnode->tn_dir.tn_parent;
+ tmpfs_ref_node(pnode);
error = vn_vget_ino_gen(dvp, tmpfs_vn_get_ino_alloc,
- dnode->tn_dir.tn_parent, cnp->cn_lkflags, vpp);
+ pnode, cnp->cn_lkflags, vpp);
+ tmpfs_free_node(tm, pnode);
if (error != 0)
goto out;
} else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
@@ -117,10 +119,12 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
if (de != NULL && de->td_node == NULL)
cnp->cn_flags |= ISWHITEOUT;
if (de == NULL || de->td_node == NULL) {
- /* The entry was not found in the directory.
+ /*
+ * The entry was not found in the directory.
* This is OK if we are creating or renaming an
* entry and are working on the last component of
- * the path name. */
+ * the path name.
+ */
if ((cnp->cn_flags & ISLASTCN) &&
(cnp->cn_nameiop == CREATE || \
cnp->cn_nameiop == RENAME ||
@@ -132,8 +136,10 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
if (error != 0)
goto out;
- /* Keep the component name in the buffer for
- * future uses. */
+ /*
+ * Keep the component name in the buffer for
+ * future uses.
+ */
cnp->cn_flags |= SAVENAME;
error = EJUSTRETURN;
@@ -142,14 +148,18 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
} else {
struct tmpfs_node *tnode;
- /* The entry was found, so get its associated
- * tmpfs_node. */
+ /*
+ * The entry was found, so get its associated
+ * tmpfs_node.
+ */
tnode = de->td_node;
- /* If we are not at the last path component and
+ /*
+ * If we are not at the last path component and
* found a non-directory or non-link entry (which
* may itself be pointing to a directory), raise
- * an error. */
+ * an error.
+ */
if ((tnode->tn_type != VDIR &&
tnode->tn_type != VLNK) &&
!(cnp->cn_flags & ISLASTCN)) {
@@ -157,9 +167,11 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
goto out;
}
- /* If we are deleting or renaming the entry, keep
+ /*
+ * If we are deleting or renaming the entry, keep
* track of its tmpfs_dirent so that it can be
- * easily deleted later. */
+ * easily deleted later.
+ */
if ((cnp->cn_flags & ISLASTCN) &&
(cnp->cn_nameiop == DELETE ||
cnp->cn_nameiop == RENAME)) {
@@ -175,8 +187,9 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
goto out;
if ((dnode->tn_mode & S_ISTXT) &&
- VOP_ACCESS(dvp, VADMIN, cnp->cn_cred, cnp->cn_thread) &&
- VOP_ACCESS(*vpp, VADMIN, cnp->cn_cred, cnp->cn_thread)) {
+ VOP_ACCESS(dvp, VADMIN, cnp->cn_cred,
+ cnp->cn_thread) && VOP_ACCESS(*vpp, VADMIN,
+ cnp->cn_cred, cnp->cn_thread)) {
error = EPERM;
vput(*vpp);
*vpp = NULL;
@@ -192,18 +205,36 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
}
}
- /* Store the result of this lookup in the cache. Avoid this if the
+ /*
+ * Store the result of this lookup in the cache. Avoid this if the
* request was for creation, as it does not improve timings on
- * emprical tests. */
- if ((cnp->cn_flags & MAKEENTRY) != 0)
+ * emprical tests.
+ */
+ if ((cnp->cn_flags & MAKEENTRY) != 0 && tmpfs_use_nc(dvp))
cache_enter(dvp, *vpp, cnp);
out:
- /* If there were no errors, *vpp cannot be null and it must be
- * locked. */
+ /*
+ * If there were no errors, *vpp cannot be null and it must be
+ * locked.
+ */
MPASS(IFF(error == 0, *vpp != NULLVP && VOP_ISLOCKED(*vpp)));
- return error;
+ return (error);
+}
+
+static int
+tmpfs_cached_lookup(struct vop_cachedlookup_args *v)
+{
+
+ return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp));
+}
+
+static int
+tmpfs_lookup(struct vop_lookup_args *v)
+{
+
+ return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp));
}
static int
@@ -218,7 +249,7 @@ tmpfs_create(struct vop_create_args *v)
MPASS(vap->va_type == VREG || vap->va_type == VSOCK);
error = tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL);
- if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0)
+ if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0 && tmpfs_use_nc(dvp))
cache_enter(dvp, *vpp, cnp);
return (error);
}
@@ -993,10 +1024,12 @@ tmpfs_rename(struct vop_rename_args *v)
tmpfs_dir_attach(tdvp, de);
- cache_purge(fvp);
- if (tvp != NULL)
- cache_purge(tvp);
- cache_purge_negative(tdvp);
+ if (tmpfs_use_nc(fvp)) {
+ cache_purge(fvp);
+ if (tvp != NULL)
+ cache_purge(tvp);
+ cache_purge_negative(tdvp);
+ }
error = 0;
@@ -1096,7 +1129,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v)
/* No vnode should be allocated for this entry from this point */
TMPFS_NODE_LOCK(node);
- TMPFS_ASSERT_ELOCKED(node);
node->tn_links--;
node->tn_dir.tn_parent = NULL;
node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED |
@@ -1105,14 +1137,15 @@ tmpfs_rmdir(struct vop_rmdir_args *v)
TMPFS_NODE_UNLOCK(node);
TMPFS_NODE_LOCK(dnode);
- TMPFS_ASSERT_ELOCKED(dnode);
dnode->tn_links--;
dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED |
TMPFS_NODE_MODIFIED;
TMPFS_NODE_UNLOCK(dnode);
- cache_purge(dvp);
- cache_purge(vp);
+ if (tmpfs_use_nc(dvp)) {
+ cache_purge(dvp);
+ cache_purge(vp);
+ }
/* Free the directory entry we just deleted. Note that the node
* referred by it will not be removed until the vnode is really
@@ -1256,10 +1289,10 @@ tmpfs_reclaim(struct vop_reclaim_args *v)
else
vnode_destroy_vobject(vp);
vp->v_object = NULL;
- cache_purge(vp);
+ if (tmpfs_use_nc(vp))
+ cache_purge(vp);
TMPFS_NODE_LOCK(node);
- TMPFS_ASSERT_ELOCKED(node);
tmpfs_free_vp(vp);
/* If the node referenced by this vnode was deleted by the user,
@@ -1389,13 +1422,139 @@ tmpfs_whiteout(struct vop_whiteout_args *ap)
}
}
+static int
+tmpfs_vptocnp_dir(struct tmpfs_node *tn, struct tmpfs_node *tnp,
+ struct tmpfs_dirent **pde)
+{
+ struct tmpfs_dir_cursor dc;
+ struct tmpfs_dirent *de;
+
+ for (de = tmpfs_dir_first(tnp, &dc); de != NULL;
+ de = tmpfs_dir_next(tnp, &dc)) {
+ if (de->td_node == tn) {
+ *pde = de;
+ return (0);
+ }
+ }
+ return (ENOENT);
+}
+
+static int
+tmpfs_vptocnp_fill(struct vnode *vp, struct tmpfs_node *tn,
+ struct tmpfs_node *tnp, char *buf, int *buflen, struct vnode **dvp)
+{
+ struct tmpfs_dirent *de;
+ int error, i;
+
+ error = vn_vget_ino_gen(vp, tmpfs_vn_get_ino_alloc, tnp, LK_SHARED,
+ dvp);
+ if (error != 0)
+ return (error);
+ error = tmpfs_vptocnp_dir(tn, tnp, &de);
+ if (error == 0) {
+ i = *buflen;
+ i -= de->td_namelen;
+ if (i < 0) {
+ error = ENOMEM;
+ } else {
+ bcopy(de->ud.td_name, buf + i, de->td_namelen);
+ *buflen = i;
+ }
+ }
+ if (error == 0) {
+ if (vp != *dvp)
+ VOP_UNLOCK(*dvp, 0);
+ } else {
+ if (vp != *dvp)
+ vput(*dvp);
+ else
+ vrele(vp);
+ }
+ return (error);
+}
+
+static int
+tmpfs_vptocnp(struct vop_vptocnp_args *ap)
+{
+ struct vnode *vp, **dvp;
+ struct tmpfs_node *tn, *tnp, *tnp1;
+ struct tmpfs_dirent *de;
+ struct tmpfs_mount *tm;
+ char *buf;
+ int *buflen;
+ int error;
+
+ vp = ap->a_vp;
+ dvp = ap->a_vpp;
+ buf = ap->a_buf;
+ buflen = ap->a_buflen;
+
+ tm = VFS_TO_TMPFS(vp->v_mount);
+ tn = VP_TO_TMPFS_NODE(vp);
+ if (tn->tn_type == VDIR) {
+ tnp = tn->tn_dir.tn_parent;
+ if (tnp == NULL)
+ return (ENOENT);
+ tmpfs_ref_node(tnp);
+ error = tmpfs_vptocnp_fill(vp, tn, tn->tn_dir.tn_parent, buf,
+ buflen, dvp);
+ tmpfs_free_node(tm, tnp);
+ return (error);
+ }
+restart:
+ TMPFS_LOCK(tm);
+ LIST_FOREACH_SAFE(tnp, &tm->tm_nodes_used, tn_entries, tnp1) {
+ if (tnp->tn_type != VDIR)
+ continue;
+ TMPFS_NODE_LOCK(tnp);
+ tmpfs_ref_node_locked(tnp);
+
+ /*
+ * tn_vnode cannot be instantiated while we hold the
+ * node lock, so the directory cannot be changed while
+ * we iterate over it. Do this to avoid instantiating
+ * vnode for directories which cannot point to our
+ * node.
+ */
+ error = tnp->tn_vnode == NULL ? tmpfs_vptocnp_dir(tn, tnp,
+ &de) : 0;
+
+ if (error == 0) {
+ TMPFS_NODE_UNLOCK(tnp);
+ TMPFS_UNLOCK(tm);
+ error = tmpfs_vptocnp_fill(vp, tn, tnp, buf, buflen,
+ dvp);
+ if (error == 0) {
+ tmpfs_free_node(tm, tnp);
+ return (0);
+ }
+ if ((vp->v_iflag & VI_DOOMED) != 0) {
+ tmpfs_free_node(tm, tnp);
+ return (ENOENT);
+ }
+ TMPFS_LOCK(tm);
+ TMPFS_NODE_LOCK(tnp);
+ }
+ if (tmpfs_free_node_locked(tm, tnp, false)) {
+ goto restart;
+ } else {
+ KASSERT(tnp->tn_refcount > 0,
+ ("node %p refcount zero", tnp));
+ tnp1 = LIST_NEXT(tnp, tn_entries);
+ TMPFS_NODE_UNLOCK(tnp);
+ }
+ }
+ TMPFS_UNLOCK(tm);
+ return (ENOENT);
+}
+
/*
- * vnode operations vector used for files stored in a tmpfs file system.
+ * Vnode operations vector used for files stored in a tmpfs file system.
*/
struct vop_vector tmpfs_vnodeop_entries = {
.vop_default = &default_vnodeops,
.vop_lookup = vfs_cache_lookup,
- .vop_cachedlookup = tmpfs_lookup,
+ .vop_cachedlookup = tmpfs_cached_lookup,
.vop_create = tmpfs_create,
.vop_mknod = tmpfs_mknod,
.vop_open = tmpfs_open,
@@ -1421,5 +1580,13 @@ struct vop_vector tmpfs_vnodeop_entries = {
.vop_vptofh = tmpfs_vptofh,
.vop_whiteout = tmpfs_whiteout,
.vop_bmap = VOP_EOPNOTSUPP,
+ .vop_vptocnp = tmpfs_vptocnp,
};
+/*
+ * Same vector for mounts which do not use namecache.
+ */
+struct vop_vector tmpfs_vnodeop_nonc_entries = {
+ .vop_default = &tmpfs_vnodeop_entries,
+ .vop_lookup = tmpfs_lookup,
+};
diff --git a/sys/fs/tmpfs/tmpfs_vnops.h b/sys/fs/tmpfs/tmpfs_vnops.h
index 1e06c135fe76..db614a051291 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.h
+++ b/sys/fs/tmpfs/tmpfs_vnops.h
@@ -44,6 +44,7 @@
*/
extern struct vop_vector tmpfs_vnodeop_entries;
+extern struct vop_vector tmpfs_vnodeop_nonc_entries;
vop_access_t tmpfs_access;
vop_getattr_t tmpfs_getattr;
diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c
index b461747bf356..0c24cd35891b 100644
--- a/sys/geom/multipath/g_multipath.c
+++ b/sys/geom/multipath/g_multipath.c
@@ -923,6 +923,7 @@ g_multipath_ctl_add_name(struct gctl_req *req, struct g_class *mp,
struct g_provider *pp;
const char *mpname;
static const char devpf[6] = "/dev/";
+ int error;
g_topology_assert();
@@ -972,10 +973,9 @@ g_multipath_ctl_add_name(struct gctl_req *req, struct g_class *mp,
return;
}
- /*
- * Now add....
- */
- (void) g_multipath_add_disk(gp, pp);
+ error = g_multipath_add_disk(gp, pp);
+ if (error != 0)
+ gctl_error(req, "Provider addition error: %d", error);
}
static void
diff --git a/sys/i386/cloudabi32/cloudabi32_sysvec.c b/sys/i386/cloudabi32/cloudabi32_sysvec.c
index 1ecd8d52df89..9e1dac4122ab 100644
--- a/sys/i386/cloudabi32/cloudabi32_sysvec.c
+++ b/sys/i386/cloudabi32/cloudabi32_sysvec.c
@@ -156,7 +156,7 @@ cloudabi32_thread_setregs(struct thread *td,
/* Perform standard register initialization. */
stack.ss_sp = TO_PTR(attr->stack);
- stack.ss_size = attr->stack_size - sizeof(args);
+ stack.ss_size = attr->stack_len - sizeof(args);
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
/*
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 1dc61ad4002d..763c711ad8b3 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -1283,16 +1283,16 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva, boolean_t force)
return;
#endif
/*
- * Otherwise, do per-cache line flush. Use the mfence
+ * Otherwise, do per-cache line flush. Use the sfence
* instruction to insure that previous stores are
* included in the write-back. The processor
* propagates flush to other processors in the cache
* coherence domain.
*/
- mfence();
+ sfence();
for (; sva < eva; sva += cpu_clflush_line_size)
clflushopt(sva);
- mfence();
+ sfence();
} else if ((cpu_feature & CPUID_CLFSH) != 0 &&
eva - sva < PMAP_CLFLUSH_THRESHOLD) {
#ifdef DEV_APIC
@@ -5300,12 +5300,14 @@ pmap_flush_page(vm_page_t m)
eva = sva + PAGE_SIZE;
/*
- * Use mfence despite the ordering implied by
+ * Use mfence or sfence despite the ordering implied by
* mtx_{un,}lock() because clflush on non-Intel CPUs
* and clflushopt are not guaranteed to be ordered by
* any other instruction.
*/
- if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL)
+ if (useclflushopt)
+ sfence();
+ else if (cpu_vendor_id != CPU_VENDOR_INTEL)
mfence();
for (; sva < eva; sva += cpu_clflush_line_size) {
if (useclflushopt)
@@ -5313,7 +5315,9 @@ pmap_flush_page(vm_page_t m)
else
clflush(sva);
}
- if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL)
+ if (useclflushopt)
+ sfence();
+ else if (cpu_vendor_id != CPU_VENDOR_INTEL)
mfence();
*cmap_pte2 = 0;
sched_unpin();
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index f43319476d3f..23be5a3cdd00 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -158,6 +158,13 @@ mfence(void)
__asm __volatile("mfence" : : : "memory");
}
+static __inline void
+sfence(void)
+{
+
+ __asm __volatile("sfence" : : : "memory");
+}
+
#ifdef _KERNEL
#define HAVE_INLINE_FFS
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index bb57edf42155..c25ef3f3c89b 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -1160,7 +1160,7 @@ struct coredump_params {
static void cb_put_phdr(vm_map_entry_t, void *);
static void cb_size_segment(vm_map_entry_t, void *);
-static int core_write(struct coredump_params *, void *, size_t, off_t,
+static int core_write(struct coredump_params *, const void *, size_t, off_t,
enum uio_seg);
static void each_dumpable_segment(struct thread *, segment_callback, void *);
static int __elfN(corehdr)(struct coredump_params *, int, void *, size_t,
@@ -1202,7 +1202,14 @@ compress_chunk(struct coredump_params *p, char *base, char *buf, u_int len)
while (len > 0) {
chunk_len = MIN(len, CORE_BUF_SIZE);
- copyin(base, buf, chunk_len);
+
+ /*
+ * We can get EFAULT error here.
+ * In that case zero out the current chunk of the segment.
+ */
+ error = copyin(base, buf, chunk_len);
+ if (error != 0)
+ bzero(buf, chunk_len);
error = gzio_write(p->gzs, buf, chunk_len);
if (error != 0)
break;
@@ -1222,12 +1229,12 @@ core_gz_write(void *base, size_t len, off_t offset, void *arg)
#endif /* GZIO */
static int
-core_write(struct coredump_params *p, void *base, size_t len, off_t offset,
- enum uio_seg seg)
+core_write(struct coredump_params *p, const void *base, size_t len,
+ off_t offset, enum uio_seg seg)
{
- return (vn_rdwr_inchunks(UIO_WRITE, p->vp, base, len, offset,
- seg, IO_UNIT | IO_DIRECT | IO_RANGELOCKED,
+ return (vn_rdwr_inchunks(UIO_WRITE, p->vp, __DECONST(void *, base),
+ len, offset, seg, IO_UNIT | IO_DIRECT | IO_RANGELOCKED,
p->active_cred, p->file_cred, NULL, p->td));
}
@@ -1235,12 +1242,32 @@ static int
core_output(void *base, size_t len, off_t offset, struct coredump_params *p,
void *tmpbuf)
{
+ int error;
#ifdef GZIO
if (p->gzs != NULL)
return (compress_chunk(p, base, tmpbuf, len));
#endif
- return (core_write(p, base, len, offset, UIO_USERSPACE));
+ /*
+ * EFAULT is a non-fatal error that we can get, for example,
+ * if the segment is backed by a file but extends beyond its
+ * end.
+ */
+ error = core_write(p, base, len, offset, UIO_USERSPACE);
+ if (error == EFAULT) {
+ log(LOG_WARNING, "Failed to fully fault in a core file segment "
+ "at VA %p with size 0x%zx to be written at offset 0x%jx "
+ "for process %s\n", base, len, offset, curproc->p_comm);
+
+ /*
+ * Write a "real" zero byte at the end of the target region
+ * in the case this is the last segment.
+ * The intermediate space will be implicitly zero-filled.
+ */
+ error = core_write(p, zero_region, 1, offset + len - 1,
+ UIO_SYSSPACE);
+ }
+ return (error);
}
/*
diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c
index 7f7769d7a51a..8bacff61d2d7 100644
--- a/sys/kern/kern_clocksource.c
+++ b/sys/kern/kern_clocksource.c
@@ -207,7 +207,7 @@ handleevents(sbintime_t now, int fake)
}
} else
state->nextprof = state->nextstat;
- if (now >= state->nextcallopt) {
+ if (now >= state->nextcallopt || now >= state->nextcall) {
state->nextcall = state->nextcallopt = SBT_MAX;
callout_process(now);
}
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 3ec2940bbd22..472017cdbbe6 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -437,9 +437,7 @@ ktr_freeproc(struct proc *p, struct ucred **uc, struct vnode **vp)
}
void
-ktrsyscall(code, narg, args)
- int code, narg;
- register_t args[];
+ktrsyscall(int code, int narg, register_t args[])
{
struct ktr_request *req;
struct ktr_syscall *ktp;
@@ -468,9 +466,7 @@ ktrsyscall(code, narg, args)
}
void
-ktrsysret(code, error, retval)
- int code, error;
- register_t retval;
+ktrsysret(int code, int error, register_t retval)
{
struct ktr_request *req;
struct ktr_sysret *ktp;
@@ -637,9 +633,7 @@ ktrnamei(path)
}
void
-ktrsysctl(name, namelen)
- int *name;
- u_int namelen;
+ktrsysctl(int *name, u_int namelen)
{
struct ktr_request *req;
u_int mib[CTL_MAXNAME + 2];
@@ -671,11 +665,7 @@ ktrsysctl(name, namelen)
}
void
-ktrgenio(fd, rw, uio, error)
- int fd;
- enum uio_rw rw;
- struct uio *uio;
- int error;
+ktrgenio(int fd, enum uio_rw rw, struct uio *uio, int error)
{
struct ktr_request *req;
struct ktr_genio *ktg;
@@ -710,11 +700,7 @@ ktrgenio(fd, rw, uio, error)
}
void
-ktrpsig(sig, action, mask, code)
- int sig;
- sig_t action;
- sigset_t *mask;
- int code;
+ktrpsig(int sig, sig_t action, sigset_t *mask, int code)
{
struct thread *td = curthread;
struct ktr_request *req;
@@ -733,9 +719,7 @@ ktrpsig(sig, action, mask, code)
}
void
-ktrcsw(out, user, wmesg)
- int out, user;
- const char *wmesg;
+ktrcsw(int out, int user, const char *wmesg)
{
struct thread *td = curthread;
struct ktr_request *req;
@@ -756,10 +740,7 @@ ktrcsw(out, user, wmesg)
}
void
-ktrstruct(name, data, datalen)
- const char *name;
- void *data;
- size_t datalen;
+ktrstruct(const char *name, void *data, size_t datalen)
{
struct ktr_request *req;
char *buf;
@@ -782,10 +763,8 @@ ktrstruct(name, data, datalen)
}
void
-ktrcapfail(type, needed, held)
- enum ktr_cap_fail_type type;
- const cap_rights_t *needed;
- const cap_rights_t *held;
+ktrcapfail(enum ktr_cap_fail_type type, const cap_rights_t *needed,
+ const cap_rights_t *held)
{
struct thread *td = curthread;
struct ktr_request *req;
@@ -809,9 +788,7 @@ ktrcapfail(type, needed, held)
}
void
-ktrfault(vaddr, type)
- vm_offset_t vaddr;
- int type;
+ktrfault(vm_offset_t vaddr, int type)
{
struct thread *td = curthread;
struct ktr_request *req;
@@ -828,8 +805,7 @@ ktrfault(vaddr, type)
}
void
-ktrfaultend(result)
- int result;
+ktrfaultend(int result)
{
struct thread *td = curthread;
struct ktr_request *req;
@@ -857,13 +833,11 @@ struct ktrace_args {
#endif
/* ARGSUSED */
int
-sys_ktrace(td, uap)
- struct thread *td;
- register struct ktrace_args *uap;
+sys_ktrace(struct thread *td, struct ktrace_args *uap)
{
#ifdef KTRACE
- register struct vnode *vp = NULL;
- register struct proc *p;
+ struct vnode *vp = NULL;
+ struct proc *p;
struct pgrp *pg;
int facs = uap->facs & ~KTRFAC_ROOT;
int ops = KTROP(uap->ops);
@@ -1002,9 +976,7 @@ done:
/* ARGSUSED */
int
-sys_utrace(td, uap)
- struct thread *td;
- register struct utrace_args *uap;
+sys_utrace(struct thread *td, struct utrace_args *uap)
{
#ifdef KTRACE
@@ -1038,11 +1010,7 @@ sys_utrace(td, uap)
#ifdef KTRACE
static int
-ktrops(td, p, ops, facs, vp)
- struct thread *td;
- struct proc *p;
- int ops, facs;
- struct vnode *vp;
+ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp)
{
struct vnode *tracevp = NULL;
struct ucred *tracecred = NULL;
@@ -1093,14 +1061,11 @@ ktrops(td, p, ops, facs, vp)
}
static int
-ktrsetchildren(td, top, ops, facs, vp)
- struct thread *td;
- struct proc *top;
- int ops, facs;
- struct vnode *vp;
+ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs,
+ struct vnode *vp)
{
- register struct proc *p;
- register int ret = 0;
+ struct proc *p;
+ int ret = 0;
p = top;
PROC_LOCK_ASSERT(p, MA_OWNED);
@@ -1260,9 +1225,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req)
* so, only root may further change it.
*/
static int
-ktrcanset(td, targetp)
- struct thread *td;
- struct proc *targetp;
+ktrcanset(struct thread *td, struct proc *targetp)
{
PROC_LOCK_ASSERT(targetp, MA_OWNED);
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index 8c2f0ac034dd..03677663d806 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -443,12 +443,8 @@ racct_sub_racct(struct racct *dest, const struct racct *src)
}
if (RACCT_CAN_DROP(i)) {
dest->r_resources[i] -= src->r_resources[i];
- if (dest->r_resources[i] < 0) {
- KASSERT(RACCT_IS_SLOPPY(i) ||
- RACCT_IS_DECAYING(i),
- ("%s: resource %d usage < 0", __func__, i));
+ if (dest->r_resources[i] < 0)
dest->r_resources[i] = 0;
- }
}
}
}
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index ea2f969a8bad..a3c502a6c4d9 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -132,9 +132,12 @@ LOCK_DELAY_SYSINIT(rw_delay_sysinit);
* Return a pointer to the owning thread if the lock is write-locked or
* NULL if the lock is unlocked or read-locked.
*/
-#define rw_wowner(rw) \
- ((rw)->rw_lock & RW_LOCK_READ ? NULL : \
- (struct thread *)RW_OWNER((rw)->rw_lock))
+
+#define lv_rw_wowner(v) \
+ ((v) & RW_LOCK_READ ? NULL : \
+ (struct thread *)RW_OWNER((v)))
+
+#define rw_wowner(rw) lv_rw_wowner(RW_READ_VALUE(rw))
/*
* Returns if a write owner is recursed. Write ownership is not assured
@@ -415,7 +418,10 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
#ifdef KDTRACE_HOOKS
all_time -= lockstat_nsecs(&rw->lock_object);
- state = rw->rw_lock;
+#endif
+ v = RW_READ_VALUE(rw);
+#ifdef KDTRACE_HOOKS
+ state = v;
#endif
for (;;) {
/*
@@ -428,7 +434,6 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
* completely unlocked rwlock since such a lock is encoded
* as a read lock with no waiters.
*/
- v = rw->rw_lock;
if (RW_CAN_READ(v)) {
/*
* The RW_LOCK_READ_WAITERS flag should only be set
@@ -444,6 +449,7 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
(void *)(v + RW_ONE_READER));
break;
}
+ v = RW_READ_VALUE(rw);
continue;
}
#ifdef KDTRACE_HOOKS
@@ -471,9 +477,11 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
KTR_STATE1(KTR_SCHED, "thread",
sched_tdname(curthread), "spinning",
"lockname:\"%s\"", rw->lock_object.lo_name);
- while ((struct thread*)RW_OWNER(rw->rw_lock) ==
- owner && TD_IS_RUNNING(owner))
+ do {
lock_delay(&lda);
+ v = RW_READ_VALUE(rw);
+ owner = lv_rw_wowner(v);
+ } while (owner != NULL && TD_IS_RUNNING(owner));
KTR_STATE0(KTR_SCHED, "thread",
sched_tdname(curthread), "running");
continue;
@@ -484,11 +492,12 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
"spinning", "lockname:\"%s\"",
rw->lock_object.lo_name);
for (i = 0; i < rowner_loops; i++) {
- v = rw->rw_lock;
+ v = RW_READ_VALUE(rw);
if ((v & RW_LOCK_READ) == 0 || RW_CAN_READ(v))
break;
cpu_spinwait();
}
+ v = RW_READ_VALUE(rw);
#ifdef KDTRACE_HOOKS
lda.spin_cnt += rowner_loops - i;
#endif
@@ -511,7 +520,7 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
* The lock might have been released while we spun, so
* recheck its state and restart the loop if needed.
*/
- v = rw->rw_lock;
+ v = RW_READ_VALUE(rw);
if (RW_CAN_READ(v)) {
turnstile_cancel(ts);
continue;
@@ -549,6 +558,7 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
if (!atomic_cmpset_ptr(&rw->rw_lock, v,
v | RW_LOCK_READ_WAITERS)) {
turnstile_cancel(ts);
+ v = RW_READ_VALUE(rw);
continue;
}
if (LOCK_LOG_TEST(&rw->lock_object, 0))
@@ -574,6 +584,7 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
if (LOCK_LOG_TEST(&rw->lock_object, 0))
CTR2(KTR_LOCK, "%s: %p resuming from turnstile",
__func__, rw);
+ v = RW_READ_VALUE(rw);
}
#ifdef KDTRACE_HOOKS
all_time += lockstat_nsecs(&rw->lock_object);
@@ -657,13 +668,12 @@ _rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line)
LOCK_LOG_LOCK("RUNLOCK", &rw->lock_object, 0, 0, file, line);
/* TODO: drop "owner of record" here. */
-
+ x = RW_READ_VALUE(rw);
for (;;) {
/*
* See if there is more than one read lock held. If so,
* just drop one and return.
*/
- x = rw->rw_lock;
if (RW_READERS(x) > 1) {
if (atomic_cmpset_rel_ptr(&rw->rw_lock, x,
x - RW_ONE_READER)) {
@@ -674,6 +684,7 @@ _rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line)
(void *)(x - RW_ONE_READER));
break;
}
+ x = RW_READ_VALUE(rw);
continue;
}
/*
@@ -690,6 +701,7 @@ _rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line)
__func__, rw);
break;
}
+ x = RW_READ_VALUE(rw);
continue;
}
/*
@@ -725,6 +737,7 @@ _rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line)
if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
x)) {
turnstile_chain_unlock(&rw->lock_object);
+ x = RW_READ_VALUE(rw);
continue;
}
if (LOCK_LOG_TEST(&rw->lock_object, 0))
@@ -790,8 +803,9 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
lock_delay_arg_init(&lda, NULL);
#endif
rw = rwlock2rw(c);
+ v = RW_READ_VALUE(rw);
- if (rw_wlocked(rw)) {
+ if (__predict_false(lv_rw_wowner(v) == (struct thread *)tid)) {
KASSERT(rw->lock_object.lo_flags & LO_RECURSABLE,
("%s: recursing but non-recursive rw %s @ %s:%d\n",
__func__, rw->lock_object.lo_name, file, line));
@@ -807,11 +821,15 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
#ifdef KDTRACE_HOOKS
all_time -= lockstat_nsecs(&rw->lock_object);
- state = rw->rw_lock;
+ state = v;
#endif
for (;;) {
- if (rw->rw_lock == RW_UNLOCKED && _rw_write_lock(rw, tid))
- break;
+ if (v == RW_UNLOCKED) {
+ if (_rw_write_lock(rw, tid))
+ break;
+ v = RW_READ_VALUE(rw);
+ continue;
+ }
#ifdef KDTRACE_HOOKS
lda.spin_cnt++;
#endif
@@ -826,8 +844,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
* running on another CPU, spin until the owner stops
* running or the state of the lock changes.
*/
- v = rw->rw_lock;
- owner = (struct thread *)RW_OWNER(v);
+ owner = lv_rw_wowner(v);
if (!(v & RW_LOCK_READ) && TD_IS_RUNNING(owner)) {
if (LOCK_LOG_TEST(&rw->lock_object, 0))
CTR3(KTR_LOCK, "%s: spinning on %p held by %p",
@@ -835,9 +852,11 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread),
"spinning", "lockname:\"%s\"",
rw->lock_object.lo_name);
- while ((struct thread*)RW_OWNER(rw->rw_lock) == owner &&
- TD_IS_RUNNING(owner))
+ do {
lock_delay(&lda);
+ v = RW_READ_VALUE(rw);
+ owner = lv_rw_wowner(v);
+ } while (owner != NULL && TD_IS_RUNNING(owner));
KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread),
"running");
continue;
@@ -847,6 +866,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
if (!(v & RW_LOCK_WRITE_SPINNER)) {
if (!atomic_cmpset_ptr(&rw->rw_lock, v,
v | RW_LOCK_WRITE_SPINNER)) {
+ v = RW_READ_VALUE(rw);
continue;
}
}
@@ -861,6 +881,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
}
KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread),
"running");
+ v = RW_READ_VALUE(rw);
#ifdef KDTRACE_HOOKS
lda.spin_cnt += rowner_loops - i;
#endif
@@ -869,7 +890,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
}
#endif
ts = turnstile_trywait(&rw->lock_object);
- v = rw->rw_lock;
+ v = RW_READ_VALUE(rw);
#ifdef ADAPTIVE_RWLOCKS
/*
@@ -905,6 +926,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
break;
}
turnstile_cancel(ts);
+ v = RW_READ_VALUE(rw);
continue;
}
/*
@@ -916,6 +938,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
if (!atomic_cmpset_ptr(&rw->rw_lock, v,
v | RW_LOCK_WRITE_WAITERS)) {
turnstile_cancel(ts);
+ v = RW_READ_VALUE(rw);
continue;
}
if (LOCK_LOG_TEST(&rw->lock_object, 0))
@@ -943,6 +966,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
#ifdef ADAPTIVE_RWLOCKS
spintries = 0;
#endif
+ v = RW_READ_VALUE(rw);
}
#ifdef KDTRACE_HOOKS
all_time += lockstat_nsecs(&rw->lock_object);
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index 0036734caff1..d89df3b5bcc8 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -563,8 +563,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
lock_delay_arg_init(&lda, NULL);
#endif
+ x = SX_READ_VALUE(sx);
+
/* If we already hold an exclusive lock, then recurse. */
- if (sx_xlocked(sx)) {
+ if (__predict_false(lv_sx_owner(x) == (struct thread *)tid)) {
KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0,
("_sx_xlock_hard: recursed on non-recursive sx %s @ %s:%d\n",
sx->lock_object.lo_name, file, line));
@@ -581,12 +583,15 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
#ifdef KDTRACE_HOOKS
all_time -= lockstat_nsecs(&sx->lock_object);
- state = sx->sx_lock;
+ state = x;
#endif
for (;;) {
- if (sx->sx_lock == SX_LOCK_UNLOCKED &&
- atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid))
- break;
+ if (x == SX_LOCK_UNLOCKED) {
+ if (atomic_cmpset_acq_ptr(&sx->sx_lock, x, tid))
+ break;
+ x = SX_READ_VALUE(sx);
+ continue;
+ }
#ifdef KDTRACE_HOOKS
lda.spin_cnt++;
#endif
@@ -601,11 +606,9 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
* running on another CPU, spin until the owner stops
* running or the state of the lock changes.
*/
- x = sx->sx_lock;
if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) {
if ((x & SX_LOCK_SHARED) == 0) {
- x = SX_OWNER(x);
- owner = (struct thread *)x;
+ owner = lv_sx_owner(x);
if (TD_IS_RUNNING(owner)) {
if (LOCK_LOG_TEST(&sx->lock_object, 0))
CTR3(KTR_LOCK,
@@ -616,9 +619,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
"lockname:\"%s\"",
sx->lock_object.lo_name);
GIANT_SAVE();
- while (SX_OWNER(sx->sx_lock) == x &&
- TD_IS_RUNNING(owner))
+ do {
lock_delay(&lda);
+ x = SX_READ_VALUE(sx);
+ owner = lv_sx_owner(x);
+ } while (owner != NULL &&
+ TD_IS_RUNNING(owner));
KTR_STATE0(KTR_SCHED, "thread",
sched_tdname(curthread), "running");
continue;
@@ -645,6 +651,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
}
KTR_STATE0(KTR_SCHED, "thread",
sched_tdname(curthread), "running");
+ x = SX_READ_VALUE(sx);
if (i != asx_loops)
continue;
}
@@ -652,7 +659,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
#endif
sleepq_lock(&sx->lock_object);
- x = sx->sx_lock;
+ x = SX_READ_VALUE(sx);
/*
* If the lock was released while spinning on the
@@ -701,6 +708,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
break;
}
sleepq_release(&sx->lock_object);
+ x = SX_READ_VALUE(sx);
continue;
}
@@ -712,6 +720,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
if (!atomic_cmpset_ptr(&sx->sx_lock, x,
x | SX_LOCK_EXCLUSIVE_WAITERS)) {
sleepq_release(&sx->lock_object);
+ x = SX_READ_VALUE(sx);
continue;
}
if (LOCK_LOG_TEST(&sx->lock_object, 0))
@@ -753,6 +762,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
if (LOCK_LOG_TEST(&sx->lock_object, 0))
CTR2(KTR_LOCK, "%s: %p resuming from sleep queue",
__func__, sx);
+ x = SX_READ_VALUE(sx);
}
#ifdef KDTRACE_HOOKS
all_time += lockstat_nsecs(&sx->lock_object);
@@ -872,20 +882,18 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
lock_delay_arg_init(&lda, NULL);
#endif
#ifdef KDTRACE_HOOKS
- state = sx->sx_lock;
all_time -= lockstat_nsecs(&sx->lock_object);
#endif
+ x = SX_READ_VALUE(sx);
+#ifdef KDTRACE_HOOKS
+ state = x;
+#endif
/*
* As with rwlocks, we don't make any attempt to try to block
* shared locks once there is an exclusive waiter.
*/
for (;;) {
-#ifdef KDTRACE_HOOKS
- lda.spin_cnt++;
-#endif
- x = sx->sx_lock;
-
/*
* If no other thread has an exclusive lock then try to bump up
* the count of sharers. Since we have to preserve the state
@@ -903,8 +911,13 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
(void *)(x + SX_ONE_SHARER));
break;
}
+ x = SX_READ_VALUE(sx);
continue;
}
+#ifdef KDTRACE_HOOKS
+ lda.spin_cnt++;
+#endif
+
#ifdef HWPMC_HOOKS
PMC_SOFT_CALL( , , lock, failed);
#endif
@@ -918,8 +931,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
* changes.
*/
if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) {
- x = SX_OWNER(x);
- owner = (struct thread *)x;
+ owner = lv_sx_owner(x);
if (TD_IS_RUNNING(owner)) {
if (LOCK_LOG_TEST(&sx->lock_object, 0))
CTR3(KTR_LOCK,
@@ -929,9 +941,11 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
sched_tdname(curthread), "spinning",
"lockname:\"%s\"", sx->lock_object.lo_name);
GIANT_SAVE();
- while (SX_OWNER(sx->sx_lock) == x &&
- TD_IS_RUNNING(owner))
+ do {
lock_delay(&lda);
+ x = SX_READ_VALUE(sx);
+ owner = lv_sx_owner(x);
+ } while (owner != NULL && TD_IS_RUNNING(owner));
KTR_STATE0(KTR_SCHED, "thread",
sched_tdname(curthread), "running");
continue;
@@ -944,7 +958,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
* start the process of blocking.
*/
sleepq_lock(&sx->lock_object);
- x = sx->sx_lock;
+ x = SX_READ_VALUE(sx);
/*
* The lock could have been released while we spun.
@@ -966,6 +980,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
owner = (struct thread *)SX_OWNER(x);
if (TD_IS_RUNNING(owner)) {
sleepq_release(&sx->lock_object);
+ x = SX_READ_VALUE(sx);
continue;
}
}
@@ -980,6 +995,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
if (!atomic_cmpset_ptr(&sx->sx_lock, x,
x | SX_LOCK_SHARED_WAITERS)) {
sleepq_release(&sx->lock_object);
+ x = SX_READ_VALUE(sx);
continue;
}
if (LOCK_LOG_TEST(&sx->lock_object, 0))
@@ -1020,6 +1036,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
if (LOCK_LOG_TEST(&sx->lock_object, 0))
CTR2(KTR_LOCK, "%s: %p resuming from sleep queue",
__func__, sx);
+ x = SX_READ_VALUE(sx);
}
#ifdef KDTRACE_HOOKS
all_time += lockstat_nsecs(&sx->lock_object);
@@ -1054,9 +1071,8 @@ _sx_sunlock_hard(struct sx *sx, const char *file, int line)
if (SCHEDULER_STOPPED())
return;
+ x = SX_READ_VALUE(sx);
for (;;) {
- x = sx->sx_lock;
-
/*
* We should never have sharers while at least one thread
* holds a shared lock.
@@ -1078,6 +1094,8 @@ _sx_sunlock_hard(struct sx *sx, const char *file, int line)
(void *)(x - SX_ONE_SHARER));
break;
}
+
+ x = SX_READ_VALUE(sx);
continue;
}
@@ -1094,6 +1112,7 @@ _sx_sunlock_hard(struct sx *sx, const char *file, int line)
__func__, sx);
break;
}
+ x = SX_READ_VALUE(sx);
continue;
}
@@ -1115,6 +1134,7 @@ _sx_sunlock_hard(struct sx *sx, const char *file, int line)
SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS,
SX_LOCK_UNLOCKED)) {
sleepq_release(&sx->lock_object);
+ x = SX_READ_VALUE(sx);
continue;
}
if (LOCK_LOG_TEST(&sx->lock_object, 0))
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index b1b497928c86..847c6d70ad94 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -152,8 +152,8 @@ _sleep(void *ident, struct lock_object *lock, int priority,
"Sleeping on \"%s\"", wmesg);
KASSERT(sbt != 0 || mtx_owned(&Giant) || lock != NULL,
("sleeping without a lock"));
- KASSERT(p != NULL, ("msleep1"));
- KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
+ KASSERT(ident != NULL, ("_sleep: NULL ident"));
+ KASSERT(TD_IS_RUNNING(td), ("_sleep: curthread not running"));
if (priority & PDROP)
KASSERT(lock != NULL && lock != &Giant.lock_object,
("PDROP requires a non-Giant lock"));
@@ -247,8 +247,8 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const char *wmesg,
td = curthread;
p = td->td_proc;
KASSERT(mtx != NULL, ("sleeping without a mutex"));
- KASSERT(p != NULL, ("msleep1"));
- KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
+ KASSERT(ident != NULL, ("msleep_spin_sbt: NULL ident"));
+ KASSERT(TD_IS_RUNNING(td), ("msleep_spin_sbt: curthread not running"));
if (SCHEDULER_STOPPED())
return (0);
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index f97da1714681..534f59cd5a42 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -968,8 +968,8 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
sched_load_rem();
td->td_lastcpu = td->td_oncpu;
- preempted = !((td->td_flags & TDF_SLICEEND) ||
- (flags & SWT_RELINQUISH));
+ preempted = (td->td_flags & TDF_SLICEEND) == 0 &&
+ (flags & SW_PREEMPT) != 0;
td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND);
td->td_owepreempt = 0;
td->td_oncpu = NOCPU;
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 8bbd70952751..b650f24db9e5 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -1898,8 +1898,8 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
ts->ts_rltick = ticks;
td->td_lastcpu = td->td_oncpu;
td->td_oncpu = NOCPU;
- preempted = !((td->td_flags & TDF_SLICEEND) ||
- (flags & SWT_RELINQUISH));
+ preempted = (td->td_flags & TDF_SLICEEND) == 0 &&
+ (flags & SW_PREEMPT) != 0;
td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND);
td->td_owepreempt = 0;
if (!TD_IS_IDLETHREAD(td))
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index af33643a9a07..d7193d77f75a 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -2699,6 +2699,14 @@ sosetopt(struct socket *so, struct sockopt *sopt)
so->so_ts_clock = optval;
break;
+ case SO_MAX_PACING_RATE:
+ error = sooptcopyin(sopt, &val32, sizeof(val32),
+ sizeof(val32));
+ if (error)
+ goto bad;
+ so->so_max_pacing_rate = val32;
+ break;
+
default:
if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0)
error = hhook_run_socket(so, sopt,
@@ -2890,6 +2898,10 @@ integer:
optval = so->so_ts_clock;
goto integer;
+ case SO_MAX_PACING_RATE:
+ optval = so->so_max_pacing_rate;
+ goto integer;
+
default:
if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0)
error = hhook_run_socket(so, sopt,
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index d9c380c10023..792fbb610a84 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1489,12 +1489,14 @@ alloc:
vp->v_op = vops;
v_init_counters(vp);
vp->v_bufobj.bo_ops = &buf_ops_bio;
+#ifdef DIAGNOSTIC
+ if (mp == NULL && vops != &dead_vnodeops)
+ printf("NULL mp in getnewvnode(9), tag %s\n", tag);
+#endif
#ifdef MAC
mac_vnode_init(vp);
if (mp != NULL && (mp->mnt_flag & MNT_MULTILABEL) == 0)
mac_vnode_associate_singlelabel(mp, vp);
- else if (mp == NULL && vops != &dead_vnodeops)
- printf("NULL mp in getnewvnode()\n");
#endif
if (mp != NULL) {
vp->v_bufobj.bo_bsize = mp->mnt_stat.f_iosize;
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 026837be9edd..8e1bd621d64e 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1539,27 +1539,26 @@ _vn_lock(struct vnode *vp, int flags, char *file, int line)
VNASSERT((flags & LK_TYPE_MASK) != 0, vp,
("vn_lock called with no locktype."));
- do {
#ifdef DEBUG_VFS_LOCKS
- KASSERT(vp->v_holdcnt != 0,
- ("vn_lock %p: zero hold count", vp));
+ KASSERT(vp->v_holdcnt != 0,
+ ("vn_lock %p: zero hold count", vp));
#endif
- error = VOP_LOCK1(vp, flags, file, line);
- flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */
- KASSERT((flags & LK_RETRY) == 0 || error == 0,
- ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)",
- flags, error));
- /*
- * Callers specify LK_RETRY if they wish to get dead vnodes.
- * If RETRY is not set, we return ENOENT instead.
- */
- if (error == 0 && vp->v_iflag & VI_DOOMED &&
- (flags & LK_RETRY) == 0) {
+retry:
+ error = VOP_LOCK1(vp, flags, file, line);
+ flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */
+ KASSERT((flags & LK_RETRY) == 0 || error == 0,
+ ("LK_RETRY set with incompatible flags (0x%x) or "
+ " an error occurred (%d)", flags, error));
+
+ if ((flags & LK_RETRY) == 0) {
+ if (error == 0 && vp->v_iflag & VI_DOOMED) {
VOP_UNLOCK(vp, 0);
error = ENOENT;
- break;
}
- } while (flags & LK_RETRY && error != 0);
+ } else {
+ if (error != 0)
+ goto retry;
+ }
return (error);
}
@@ -1578,12 +1577,12 @@ vn_closefile(fp, td)
vp = fp->f_vnode;
fp->f_ops = &badfileops;
- if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK)
- vref(vp);
+ if (__predict_false(fp->f_flag & FHASLOCK) && fp->f_type == DTYPE_VNODE)
+ vrefact(vp);
error = vn_close(vp, fp->f_flag, fp->f_cred, td);
- if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) {
+ if (__predict_false(fp->f_flag & FHASLOCK) && fp->f_type == DTYPE_VNODE) {
lf.l_whence = SEEK_SET;
lf.l_start = 0;
lf.l_len = 0;
diff --git a/sys/mips/conf/std.MALTA b/sys/mips/conf/std.MALTA
index c0e5cdbd07b4..3731eadf6ec4 100644
--- a/sys/mips/conf/std.MALTA
+++ b/sys/mips/conf/std.MALTA
@@ -27,6 +27,8 @@ options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+options TMPFS #Efficient memory filesystem
+
options FFS #Berkeley Fast Filesystem
options SOFTUPDATES #Enable FFS soft updates support
options UFS_ACL #Support for access control lists
diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile
index 332eb75714de..9bfc29c15f5e 100644
--- a/sys/modules/ath/Makefile
+++ b/sys/modules/ath/Makefile
@@ -31,8 +31,8 @@
ATH_RATE?= sample # tx rate control algorithm
-.PATH: ${.CURDIR}/../../dev/ath
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
KMOD= if_ath
SRCS= if_ath.c if_ath_alq.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c
@@ -46,7 +46,7 @@ SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
#
# AR5210 support; these are first generation 11a-only devices.
#
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5210
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5210
SRCS+= ah_eeprom_v1.c \
ar5210_attach.c ar5210_beacon.c ar5210_interrupts.c \
ar5210_keycache.c ar5210_misc.c ar5210_phy.c ar5210_power.c \
@@ -56,7 +56,7 @@ SRCS+= ah_eeprom_v1.c \
# AR5211 support; these are second generation 11b/g/a devices
# (but 11g was OFDM only and is not supported).
#
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5211
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5211
SRCS+= ar5211_attach.c ar5211_beacon.c ar5211_interrupts.c \
ar5211_keycache.c ar5211_misc.c ar5211_phy.c ar5211_power.c \
ar5211_recv.c ar5211_reset.c ar5211_xmit.c
@@ -64,7 +64,7 @@ SRCS+= ar5211_attach.c ar5211_beacon.c ar5211_interrupts.c \
#
# AR5212 support; this covers all other pci/cardbus legacy parts.
#
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5212
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5212
SRCS+= ar5212_ani.c ar5212_attach.c ar5212_beacon.c ar5212_eeprom.c \
ar5212_gpio.c ar5212_interrupts.c ar5212_keycache.c ar5212_misc.c \
ar5212_phy.c ar5212_power.c ar5212_recv.c ar5212_reset.c \
@@ -85,7 +85,7 @@ SRCS+= ar5413.c
# NB: 9160 depends on 5416 but 5416 does not require 9160
#
# + 5416 (Owl)
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5416
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5416
SRCS+= ah_eeprom_v14.c ah_eeprom_v4k.c \
ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_btcoex.c \
ar5416_cal.c ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \
@@ -97,7 +97,7 @@ SRCS+= ah_eeprom_v14.c ah_eeprom_v4k.c \
SRCS+= ar2133.c
# + AR9160 (Sowl)
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9001
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9001
SRCS+= ar9160_attach.c
# + AR9130 - (Sowl) - Embedded (AR913x SoC)
@@ -111,7 +111,7 @@ SRCS+= ar9130_attach.c ar9130_eeprom.c ar9130_phy.c
# AR9002 series chips
# + AR9220/AR9280 - Merlin
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9002
SRCS+= ar9280.c ar9280_attach.c ar9280_olc.c
# + AR9285 - Kite
@@ -119,13 +119,13 @@ SRCS+= ar9285.c ar9285_reset.c ar9285_attach.c ar9285_cal.c ar9285_phy.c
SRCS+= ar9285_diversity.c ar9285_btcoex.c
# + AR9287 - Kiwi
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
SRCS+= ah_eeprom_9287.c
-.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9002
SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c
# + AR9300 HAL
-.PATH: ${.CURDIR}/../../contrib/dev/ath/ath_hal/ar9300
+.PATH: ${SRCTOP}/sys/contrib/dev/ath/ath_hal/ar9300
SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c
SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c
SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c
@@ -135,22 +135,22 @@ SRCS+= ar9300_power.c ar9300_timer.c ar9300_spectral.c
# NB: rate control is bound to the driver by symbol names so only pick one
.if ${ATH_RATE} == "sample"
-.PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample
+.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/sample
SRCS+= sample.c
.elif ${ATH_RATE} == "onoe"
-.PATH: ${.CURDIR}/../../dev/ath/ath_rate/onoe
+.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/onoe
SRCS+= onoe.c
.elif ${ATH_RATE} == "amrr"
-.PATH: ${.CURDIR}/../../dev/ath/ath_rate/amrr
+.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/amrr
SRCS+= amrr.c
.endif
# DFS
-.PATH: ${.CURDIR}/../../dev/ath/ath_dfs/null
+.PATH: ${SRCTOP}/sys/dev/ath/ath_dfs/null
SRCS+= dfs_null.c
-CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal
-CFLAGS+= -I. -I${.CURDIR}/../../contrib/dev/ath/ath_hal/
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
.if !defined(KERNBUILDDIR)
opt_ah.h:
diff --git a/sys/modules/if_lagg/Makefile b/sys/modules/if_lagg/Makefile
index cdcc8928f6c7..227c95f35eec 100644
--- a/sys/modules/if_lagg/Makefile
+++ b/sys/modules/if_lagg/Makefile
@@ -2,6 +2,6 @@
.PATH: ${.CURDIR}/../../net
KMOD= if_lagg
-SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h
+SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h opt_ratelimit.h
.include <bsd.kmod.mk>
diff --git a/sys/modules/if_vlan/Makefile b/sys/modules/if_vlan/Makefile
index 9842619b35da..5f3f7e87794c 100644
--- a/sys/modules/if_vlan/Makefile
+++ b/sys/modules/if_vlan/Makefile
@@ -4,6 +4,6 @@
KMOD= if_vlan
SRCS= if_vlan.c
-SRCS+= opt_inet.h opt_vlan.h
+SRCS+= opt_inet.h opt_vlan.h opt_ratelimit.h
.include <bsd.kmod.mk>
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index 4863ac98035b..bf73a5c75e2b 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -30,6 +30,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_ratelimit.h"
+
#include <sys/param.h>
#include <sys/callout.h>
#include <sys/eventhandler.h>
@@ -853,6 +855,35 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf *m)
return (lp->lp_lagg);
}
+
+#ifdef RATELIMIT
+struct lagg_port *
+lacp_select_tx_port_by_hash(struct lagg_softc *sc, uint32_t flowid)
+{
+ struct lacp_softc *lsc = LACP_SOFTC(sc);
+ struct lacp_portmap *pm;
+ struct lacp_port *lp;
+ uint32_t hash;
+
+ if (__predict_false(lsc->lsc_suppress_distributing)) {
+ LACP_DPRINTF((NULL, "%s: waiting transit\n", __func__));
+ return (NULL);
+ }
+
+ pm = &lsc->lsc_pmap[lsc->lsc_activemap];
+ if (pm->pm_count == 0) {
+ LACP_DPRINTF((NULL, "%s: no active aggregator\n", __func__));
+ return (NULL);
+ }
+
+ hash = flowid >> sc->flowid_shift;
+ hash %= pm->pm_count;
+ lp = pm->pm_map[hash];
+
+ return (lp->lp_lagg);
+}
+#endif
+
/*
* lacp_suppress_distributing: drop transmit packets for a while
* to preserve packet ordering.
diff --git a/sys/net/ieee8023ad_lacp.h b/sys/net/ieee8023ad_lacp.h
index 8f0f51a71c48..b26e2c9251f2 100644
--- a/sys/net/ieee8023ad_lacp.h
+++ b/sys/net/ieee8023ad_lacp.h
@@ -284,6 +284,9 @@ struct lacp_softc {
struct mbuf *lacp_input(struct lagg_port *, struct mbuf *);
struct lagg_port *lacp_select_tx_port(struct lagg_softc *, struct mbuf *);
+#ifdef RATELIMIT
+struct lagg_port *lacp_select_tx_port_by_hash(struct lagg_softc *, uint32_t);
+#endif
void lacp_attach(struct lagg_softc *);
void lacp_detach(void *);
void lacp_init(struct lagg_softc *);
diff --git a/sys/net/if.h b/sys/net/if.h
index 98ae0a823cd3..26f078700100 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -239,6 +239,7 @@ struct if_data {
#define IFCAP_RXCSUM_IPV6 0x200000 /* can offload checksum on IPv6 RX */
#define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */
#define IFCAP_HWSTATS 0x800000 /* manages counters internally */
+#define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */
#define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
diff --git a/sys/net/if_dead.c b/sys/net/if_dead.c
index 8b36ab348628..0e32dcf29116 100644
--- a/sys/net/if_dead.c
+++ b/sys/net/if_dead.c
@@ -100,6 +100,30 @@ ifdead_get_counter(struct ifnet *ifp, ift_counter cnt)
return (0);
}
+static int
+ifdead_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params,
+ struct m_snd_tag **ppmt)
+{
+ return (EOPNOTSUPP);
+}
+
+static int
+ifdead_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params)
+{
+ return (EOPNOTSUPP);
+}
+
+static int
+ifdead_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params)
+{
+ return (EOPNOTSUPP);
+}
+
+static void
+ifdead_snd_tag_free(struct m_snd_tag *pmt)
+{
+}
+
void
if_dead(struct ifnet *ifp)
{
@@ -112,4 +136,8 @@ if_dead(struct ifnet *ifp)
ifp->if_qflush = ifdead_qflush;
ifp->if_transmit = ifdead_transmit;
ifp->if_get_counter = ifdead_get_counter;
+ ifp->if_snd_tag_alloc = ifdead_snd_tag_alloc;
+ ifp->if_snd_tag_modify = ifdead_snd_tag_modify;
+ ifp->if_snd_tag_query = ifdead_snd_tag_query;
+ ifp->if_snd_tag_free = ifdead_snd_tag_free;
}
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 0a5fc159e57b..b44fdc6e6c9c 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$");
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_ratelimit.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -118,6 +119,11 @@ static void lagg_port2req(struct lagg_port *, struct lagg_reqport *);
static void lagg_init(void *);
static void lagg_stop(struct lagg_softc *);
static int lagg_ioctl(struct ifnet *, u_long, caddr_t);
+#ifdef RATELIMIT
+static int lagg_snd_tag_alloc(struct ifnet *,
+ union if_snd_tag_alloc_params *,
+ struct m_snd_tag **);
+#endif
static int lagg_ether_setmulti(struct lagg_softc *);
static int lagg_ether_cmdmulti(struct lagg_port *, int);
static int lagg_setflag(struct lagg_port *, int, int,
@@ -503,7 +509,12 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
ifp->if_ioctl = lagg_ioctl;
ifp->if_get_counter = lagg_get_counter;
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
+#ifdef RATELIMIT
+ ifp->if_snd_tag_alloc = lagg_snd_tag_alloc;
+ ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS | IFCAP_TXRTLMT;
+#else
ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS;
+#endif
/*
* Attach as an ordinary ethernet device, children will be attached
@@ -1549,6 +1560,52 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error);
}
+#ifdef RATELIMIT
+static int
+lagg_snd_tag_alloc(struct ifnet *ifp,
+ union if_snd_tag_alloc_params *params,
+ struct m_snd_tag **ppmt)
+{
+ struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc;
+ struct lagg_port *lp;
+ struct lagg_lb *lb;
+ uint32_t p;
+
+ switch (sc->sc_proto) {
+ case LAGG_PROTO_FAILOVER:
+ lp = lagg_link_active(sc, sc->sc_primary);
+ break;
+ case LAGG_PROTO_LOADBALANCE:
+ if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 ||
+ params->hdr.flowtype == M_HASHTYPE_NONE)
+ return (EOPNOTSUPP);
+ p = params->hdr.flowid >> sc->flowid_shift;
+ p %= sc->sc_count;
+ lb = (struct lagg_lb *)sc->sc_psc;
+ lp = lb->lb_ports[p];
+ lp = lagg_link_active(sc, lp);
+ break;
+ case LAGG_PROTO_LACP:
+ if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 ||
+ params->hdr.flowtype == M_HASHTYPE_NONE)
+ return (EOPNOTSUPP);
+ lp = lacp_select_tx_port_by_hash(sc, params->hdr.flowid);
+ break;
+ default:
+ return (EOPNOTSUPP);
+ }
+ if (lp == NULL)
+ return (EOPNOTSUPP);
+ ifp = lp->lp_ifp;
+ if (ifp == NULL || ifp->if_snd_tag_alloc == NULL ||
+ (ifp->if_capenable & IFCAP_TXRTLMT) == 0)
+ return (EOPNOTSUPP);
+
+ /* forward allocation request */
+ return (ifp->if_snd_tag_alloc(ifp, params, ppmt));
+}
+#endif
+
static int
lagg_ether_setmulti(struct lagg_softc *sc)
{
diff --git a/sys/net/if_media.c b/sys/net/if_media.c
index abdfa2b0c4d2..9834d525befa 100644
--- a/sys/net/if_media.c
+++ b/sys/net/if_media.c
@@ -107,6 +107,7 @@ ifmedia_removeall(ifm)
LIST_REMOVE(entry, ifm_list);
free(entry, M_IFADDR);
}
+ ifm->ifm_cur = NULL;
}
/*
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 62c4bfdd33fb..7c8fd7ec80a4 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -175,6 +175,49 @@ struct if_encap_req {
#define IFENCAP_FLAG_BROADCAST 0x02 /* Destination is broadcast */
+/*
+ * Network interface send tag support. The storage of "struct
+ * m_snd_tag" comes from the network driver and it is free to allocate
+ * as much additional space as it wants for its own use.
+ */
+struct m_snd_tag;
+
+#define IF_SND_TAG_TYPE_RATE_LIMIT 0
+#define IF_SND_TAG_TYPE_MAX 1
+
+struct if_snd_tag_alloc_header {
+ uint32_t type; /* send tag type, see IF_SND_TAG_XXX */
+ uint32_t flowid; /* mbuf hash value */
+ uint32_t flowtype; /* mbuf hash type */
+};
+
+struct if_snd_tag_alloc_rate_limit {
+ struct if_snd_tag_alloc_header hdr;
+ uint64_t max_rate; /* in bytes/s */
+};
+
+struct if_snd_tag_rate_limit_params {
+ uint64_t max_rate; /* in bytes/s */
+};
+
+union if_snd_tag_alloc_params {
+ struct if_snd_tag_alloc_header hdr;
+ struct if_snd_tag_alloc_rate_limit rate_limit;
+};
+
+union if_snd_tag_modify_params {
+ struct if_snd_tag_rate_limit_params rate_limit;
+};
+
+union if_snd_tag_query_params {
+ struct if_snd_tag_rate_limit_params rate_limit;
+};
+
+typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *,
+ struct m_snd_tag **);
+typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *);
+typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *);
+typedef void (if_snd_tag_free_t)(struct m_snd_tag *);
/*
* Structure defining a network interface.
@@ -304,12 +347,19 @@ struct ifnet {
u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */
/*
+ * Network adapter send tag support:
+ */
+ if_snd_tag_alloc_t *if_snd_tag_alloc;
+ if_snd_tag_modify_t *if_snd_tag_modify;
+ if_snd_tag_query_t *if_snd_tag_query;
+ if_snd_tag_free_t *if_snd_tag_free;
+
+ /*
* Spare fields to be added before branching a stable branch, so
* that structure can be enhanced without changing the kernel
* binary interface.
*/
- void *if_pspare[4]; /* packet pacing / general use */
- int if_ispare[4]; /* packet pacing / general use */
+ int if_ispare[4]; /* general use */
};
/* for compatibility with other BSDs */
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 73470dc80e3f..608826a6dc92 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include "opt_inet.h"
#include "opt_vlan.h"
+#include "opt_ratelimit.h"
#include <sys/param.h>
#include <sys/eventhandler.h>
@@ -212,6 +213,10 @@ static void trunk_destroy(struct ifvlantrunk *trunk);
static void vlan_init(void *foo);
static void vlan_input(struct ifnet *ifp, struct mbuf *m);
static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr);
+#ifdef RATELIMIT
+static int vlan_snd_tag_alloc(struct ifnet *,
+ union if_snd_tag_alloc_params *, struct m_snd_tag **);
+#endif
static void vlan_qflush(struct ifnet *ifp);
static int vlan_setflag(struct ifnet *ifp, int flag, int status,
int (*func)(struct ifnet *, int));
@@ -971,6 +976,9 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
ifp->if_transmit = vlan_transmit;
ifp->if_qflush = vlan_qflush;
ifp->if_ioctl = vlan_ioctl;
+#ifdef RATELIMIT
+ ifp->if_snd_tag_alloc = vlan_snd_tag_alloc;
+#endif
ifp->if_flags = VLAN_IFFLAGS;
ether_ifattach(ifp, eaddr);
/* Now undo some of the damage... */
@@ -1591,6 +1599,15 @@ vlan_capabilities(struct ifvlan *ifv)
TOEDEV(ifp) = TOEDEV(p);
ifp->if_capenable |= p->if_capenable & IFCAP_TOE;
}
+
+#ifdef RATELIMIT
+ /*
+ * If the parent interface supports ratelimiting, so does the
+ * VLAN interface.
+ */
+ ifp->if_capabilities |= (p->if_capabilities & IFCAP_TXRTLMT);
+ ifp->if_capenable |= (p->if_capenable & IFCAP_TXRTLMT);
+#endif
}
static void
@@ -1801,3 +1818,19 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error);
}
+
+#ifdef RATELIMIT
+static int
+vlan_snd_tag_alloc(struct ifnet *ifp,
+ union if_snd_tag_alloc_params *params,
+ struct m_snd_tag **ppmt)
+{
+
+ /* get trunk device */
+ ifp = vlan_trunkdev(ifp);
+ if (ifp == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0)
+ return (EOPNOTSUPP);
+ /* forward allocation request */
+ return (ifp->if_snd_tag_alloc(ifp, params, ppmt));
+}
+#endif
diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h
index 12f3ad8c84d2..e7ae5d0cb4fd 100644
--- a/sys/net80211/_ieee80211.h
+++ b/sys/net80211/_ieee80211.h
@@ -517,9 +517,10 @@ struct ieee80211_mimo_info {
#define IEEE80211_HTC_RXMCS32 0x00400000 /* CAPABILITY: MCS32 support */
#define IEEE80211_HTC_TXUNEQUAL 0x00800000 /* CAPABILITY: TX unequal MCS */
#define IEEE80211_HTC_TXMCS32 0x01000000 /* CAPABILITY: MCS32 support */
+#define IEEE80211_HTC_TXLDPC 0x02000000 /* CAPABILITY: TX using LDPC */
#define IEEE80211_C_HTCAP_BITS \
"\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \
- "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS"
+ "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS\32TXLDPC"
#endif /* _NET80211__IEEE80211_H_ */
diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h
index ff5635aaec98..9fef8c441d4c 100644
--- a/sys/net80211/ieee80211.h
+++ b/sys/net80211/ieee80211.h
@@ -617,7 +617,7 @@ struct ieee80211_ie_htcap {
} __packed;
/* HT capability flags (ht_cap) */
-#define IEEE80211_HTCAP_LDPC 0x0001 /* LDPC supported */
+#define IEEE80211_HTCAP_LDPC 0x0001 /* LDPC rx supported */
#define IEEE80211_HTCAP_CHWIDTH40 0x0002 /* 20/40 supported */
#define IEEE80211_HTCAP_SMPS 0x000c /* SM Power Save mode */
#define IEEE80211_HTCAP_SMPS_OFF 0x000c /* disabled */
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index 2f28f002ec32..9a14643c6705 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -298,6 +298,11 @@ ieee80211_ht_vattach(struct ieee80211vap *vap)
vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX;
if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC)
vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX;
+
+ if (vap->iv_htcaps & IEEE80211_HTCAP_LDPC)
+ vap->iv_flags_ht |= IEEE80211_FHT_LDPC_RX;
+ if (vap->iv_htcaps & IEEE80211_HTC_TXLDPC)
+ vap->iv_flags_ht |= IEEE80211_FHT_LDPC_TX;
}
/* NB: disable default legacy WDS, too many issues right now */
if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY)
@@ -1650,6 +1655,20 @@ htcap_update_shortgi(struct ieee80211_node *ni)
}
/*
+ * Update LDPC state according to received htcap
+ * and local settings.
+ */
+static __inline void
+htcap_update_ldpc(struct ieee80211_node *ni)
+{
+ struct ieee80211vap *vap = ni->ni_vap;
+
+ if ((ni->ni_htcap & IEEE80211_HTCAP_LDPC) &&
+ (vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX))
+ ni->ni_flags |= IEEE80211_NODE_LDPC;
+}
+
+/*
* Parse and update HT-related state extracted from
* the HT cap and info ie's.
*
@@ -1669,6 +1688,7 @@ ieee80211_ht_updateparams(struct ieee80211_node *ni,
if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
htcap_update_mimo_ps(ni);
htcap_update_shortgi(ni);
+ htcap_update_ldpc(ni);
if (htinfoie[0] == IEEE80211_ELEMID_VENDOR)
htinfoie += 4;
@@ -1821,6 +1841,7 @@ ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie)
if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
htcap_update_mimo_ps(ni);
htcap_update_shortgi(ni);
+ htcap_update_ldpc(ni);
}
/*
@@ -3027,7 +3048,9 @@ ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni)
if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0)
caps &= ~IEEE80211_HTCAP_RXSTBC;
- /* XXX TODO: adjust LDPC based on receive capabilities */
+ /* adjust LDPC based on receive capabilites */
+ if ((vap->iv_flags_ht & IEEE80211_FHT_LDPC_RX) == 0)
+ caps &= ~IEEE80211_HTCAP_LDPC;
ADDSHORT(frm, caps);
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 4675291d9da7..613eb84a05ef 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -1136,6 +1136,13 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd,
if (vap->iv_flags_ht & IEEE80211_FHT_STBC_RX)
ireq->i_val |= 2;
break;
+ case IEEE80211_IOC_LDPC:
+ ireq->i_val = 0;
+ if (vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX)
+ ireq->i_val |= 1;
+ if (vap->iv_flags_ht & IEEE80211_FHT_LDPC_RX)
+ ireq->i_val |= 2;
+ break;
/* VHT */
case IEEE80211_IOC_VHTCONF:
@@ -2225,7 +2232,7 @@ checkmcs(int mcs)
return 1;
if ((mcs & IEEE80211_RATE_MCS) == 0) /* MCS always have 0x80 set */
return 0;
- return (mcs & 0x7f) <= 15; /* XXX could search ht rate set */
+ return (mcs & 0x7f) <= 31; /* XXX could search ht rate set */
}
static int
@@ -3372,6 +3379,31 @@ ieee80211_ioctl_set80211(struct ieee80211vap *vap, u_long cmd, struct ieee80211r
if (isvapht(vap))
error = ERESTART;
break;
+ case IEEE80211_IOC_LDPC:
+ /* Check if we can do LDPC TX/RX before changing the setting */
+ if ((ireq->i_val & 1) &&
+ (vap->iv_htcaps & IEEE80211_HTC_TXLDPC) == 0)
+ return EOPNOTSUPP;
+ if ((ireq->i_val & 2) &&
+ (vap->iv_htcaps & IEEE80211_HTCAP_LDPC) == 0)
+ return EOPNOTSUPP;
+
+ /* TX */
+ if (ireq->i_val & 1)
+ vap->iv_flags_ht |= IEEE80211_FHT_LDPC_TX;
+ else
+ vap->iv_flags_ht &= ~IEEE80211_FHT_LDPC_TX;
+
+ /* RX */
+ if (ireq->i_val & 2)
+ vap->iv_flags_ht |= IEEE80211_FHT_LDPC_RX;
+ else
+ vap->iv_flags_ht &= ~IEEE80211_FHT_LDPC_RX;
+
+ /* NB: reset only if we're operating on an 11n channel */
+ if (isvapht(vap))
+ error = ERESTART;
+ break;
/* VHT */
case IEEE80211_IOC_VHTCONF:
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index 7ca24c1862f3..0ba500329c16 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -143,6 +143,7 @@ struct ieee80211_node {
#define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */
#define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */
#define IEEE80211_NODE_VHT 0x100000 /* VHT enabled */
+#define IEEE80211_NODE_LDPC 0x200000 /* LDPC enabled */
uint16_t ni_associd; /* association ID */
uint16_t ni_vlan; /* vlan tag */
uint16_t ni_txpower; /* current transmit power */
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 48b9196846e3..5e48ba7afa19 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -641,6 +641,8 @@ MALLOC_DECLARE(M_80211_VAP);
/* ic_flags_ht/iv_flags_ht */
#define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */
+#define IEEE80211_FHT_LDPC_TX 0x00010000 /* CONF: LDPC tx enabled */
+#define IEEE80211_FHT_LDPC_RX 0x00020000 /* CONF: LDPC rx enabled */
#define IEEE80211_FHT_GF 0x00040000 /* CONF: Greenfield enabled */
#define IEEE80211_FHT_HT 0x00080000 /* CONF: HT supported */
#define IEEE80211_FHT_AMPDU_TX 0x00100000 /* CONF: A-MPDU tx supported */
diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c
index 76f4c3b89b4f..3ffcdcd62ae6 100644
--- a/sys/netgraph/ng_mppc.c
+++ b/sys/netgraph/ng_mppc.c
@@ -66,7 +66,7 @@
#if !defined(NETGRAPH_MPPC_COMPRESSION) && !defined(NETGRAPH_MPPC_ENCRYPTION)
#ifdef KLD_MODULE
-/* XXX NETGRAPH_MPPC_COMPRESSION isn't functional yet */
+#define NETGRAPH_MPPC_COMPRESSION
#define NETGRAPH_MPPC_ENCRYPTION
#else
/* This case is indicative of an error in sys/conf files */
@@ -81,7 +81,6 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "netgraph_mppc", "netgraph mppc node");
#endif
#ifdef NETGRAPH_MPPC_COMPRESSION
-/* XXX this file doesn't exist yet, but hopefully someday it will... */
#include <net/mppc.h>
#endif
#ifdef NETGRAPH_MPPC_ENCRYPTION
@@ -543,7 +542,7 @@ err1:
&destCnt, d->history, flags, 0);
/* Check return value */
- KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__));
+ /* KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); */
if ((rtn & MPPC_EXPANDED) == 0
&& (rtn & MPPC_COMP_OK) == MPPC_COMP_OK) {
outlen -= destCnt;
@@ -805,7 +804,7 @@ failed:
&sourceCnt, &destCnt, d->history, flags);
/* Check return value */
- KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__));
+ /* KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); */
if ((rtn & MPPC_DEST_EXHAUSTED) != 0
|| (rtn & MPPC_DECOMP_OK) != MPPC_DECOMP_OK) {
log(LOG_ERR, "%s: decomp returned 0x%x",
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index da64dd31a07c..a14f78595e85 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include "opt_ipsec.h"
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_ratelimit.h"
#include "opt_pcbgroup.h"
#include "opt_rss.h"
@@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rmlock.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
+#include <sys/sockio.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/refcount.h>
@@ -1140,6 +1142,10 @@ in_pcbdetach(struct inpcb *inp)
KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__));
+#ifdef RATELIMIT
+ if (inp->inp_snd_tag != NULL)
+ in_pcbdetach_txrtlmt(inp);
+#endif
inp->inp_socket->so_pcb = NULL;
inp->inp_socket = NULL;
}
@@ -2677,3 +2683,253 @@ DB_SHOW_COMMAND(inpcb, db_show_inpcb)
db_print_inpcb(inp, "inpcb", 0);
}
#endif /* DDB */
+
+#ifdef RATELIMIT
+/*
+ * Modify TX rate limit based on the existing "inp->inp_snd_tag",
+ * if any.
+ */
+int
+in_pcbmodify_txrtlmt(struct inpcb *inp, uint32_t max_pacing_rate)
+{
+ union if_snd_tag_modify_params params = {
+ .rate_limit.max_rate = max_pacing_rate,
+ };
+ struct m_snd_tag *mst;
+ struct ifnet *ifp;
+ int error;
+
+ mst = inp->inp_snd_tag;
+ if (mst == NULL)
+ return (EINVAL);
+
+ ifp = mst->ifp;
+ if (ifp == NULL)
+ return (EINVAL);
+
+ if (ifp->if_snd_tag_modify == NULL) {
+ error = EOPNOTSUPP;
+ } else {
+ error = ifp->if_snd_tag_modify(mst, &params);
+ }
+ return (error);
+}
+
+/*
+ * Query existing TX rate limit based on the existing
+ * "inp->inp_snd_tag", if any.
+ */
+int
+in_pcbquery_txrtlmt(struct inpcb *inp, uint32_t *p_max_pacing_rate)
+{
+ union if_snd_tag_query_params params = { };
+ struct m_snd_tag *mst;
+ struct ifnet *ifp;
+ int error;
+
+ mst = inp->inp_snd_tag;
+ if (mst == NULL)
+ return (EINVAL);
+
+ ifp = mst->ifp;
+ if (ifp == NULL)
+ return (EINVAL);
+
+ if (ifp->if_snd_tag_query == NULL) {
+ error = EOPNOTSUPP;
+ } else {
+ error = ifp->if_snd_tag_query(mst, &params);
+ if (error == 0 && p_max_pacing_rate != NULL)
+ *p_max_pacing_rate = params.rate_limit.max_rate;
+ }
+ return (error);
+}
+
+/*
+ * Allocate a new TX rate limit send tag from the network interface
+ * given by the "ifp" argument and save it in "inp->inp_snd_tag":
+ */
+int
+in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *ifp,
+ uint32_t flowtype, uint32_t flowid, uint32_t max_pacing_rate)
+{
+ union if_snd_tag_alloc_params params = {
+ .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT,
+ .rate_limit.hdr.flowid = flowid,
+ .rate_limit.hdr.flowtype = flowtype,
+ .rate_limit.max_rate = max_pacing_rate,
+ };
+ int error;
+
+ INP_WLOCK_ASSERT(inp);
+
+ if (inp->inp_snd_tag != NULL)
+ return (EINVAL);
+
+ if (ifp->if_snd_tag_alloc == NULL) {
+ error = EOPNOTSUPP;
+ } else {
+ error = ifp->if_snd_tag_alloc(ifp, &params, &inp->inp_snd_tag);
+
+ /*
+ * At success increment the refcount on
+ * the send tag's network interface:
+ */
+ if (error == 0)
+ if_ref(inp->inp_snd_tag->ifp);
+ }
+ return (error);
+}
+
+/*
+ * Free an existing TX rate limit tag based on the "inp->inp_snd_tag",
+ * if any:
+ */
+void
+in_pcbdetach_txrtlmt(struct inpcb *inp)
+{
+ struct m_snd_tag *mst;
+ struct ifnet *ifp;
+
+ INP_WLOCK_ASSERT(inp);
+
+ mst = inp->inp_snd_tag;
+ inp->inp_snd_tag = NULL;
+
+ if (mst == NULL)
+ return;
+
+ ifp = mst->ifp;
+ if (ifp == NULL)
+ return;
+
+ /*
+ * If the device was detached while we still had reference(s)
+ * on the ifp, we assume if_snd_tag_free() was replaced with
+ * stubs.
+ */
+ ifp->if_snd_tag_free(mst);
+
+ /* release reference count on network interface */
+ if_rele(ifp);
+}
+
+/*
+ * This function should be called when the INP_RATE_LIMIT_CHANGED flag
+ * is set in the fast path and will attach/detach/modify the TX rate
+ * limit send tag based on the socket's so_max_pacing_rate value.
+ */
+void
+in_pcboutput_txrtlmt(struct inpcb *inp, struct ifnet *ifp, struct mbuf *mb)
+{
+ struct socket *socket;
+ uint32_t max_pacing_rate;
+ bool did_upgrade;
+ int error;
+
+ if (inp == NULL)
+ return;
+
+ socket = inp->inp_socket;
+ if (socket == NULL)
+ return;
+
+ if (!INP_WLOCKED(inp)) {
+ /*
+ * NOTE: If the write locking fails, we need to bail
+ * out and use the non-ratelimited ring for the
+ * transmit until there is a new chance to get the
+ * write lock.
+ */
+ if (!INP_TRY_UPGRADE(inp))
+ return;
+ did_upgrade = 1;
+ } else {
+ did_upgrade = 0;
+ }
+
+ /*
+ * NOTE: The so_max_pacing_rate value is read unlocked,
+ * because atomic updates are not required since the variable
+ * is checked at every mbuf we send. It is assumed that the
+ * variable read itself will be atomic.
+ */
+ max_pacing_rate = socket->so_max_pacing_rate;
+
+ /*
+ * NOTE: When attaching to a network interface a reference is
+ * made to ensure the network interface doesn't go away until
+ * all ratelimit connections are gone. The network interface
+ * pointers compared below represent valid network interfaces,
+ * except when comparing towards NULL.
+ */
+ if (max_pacing_rate == 0 && inp->inp_snd_tag == NULL) {
+ error = 0;
+ } else if (!(ifp->if_capenable & IFCAP_TXRTLMT)) {
+ if (inp->inp_snd_tag != NULL)
+ in_pcbdetach_txrtlmt(inp);
+ error = 0;
+ } else if (inp->inp_snd_tag == NULL) {
+ /*
+ * In order to utilize packet pacing with RSS, we need
+ * to wait until there is a valid RSS hash before we
+ * can proceed:
+ */
+ if (M_HASHTYPE_GET(mb) == M_HASHTYPE_NONE) {
+ error = EAGAIN;
+ } else {
+ error = in_pcbattach_txrtlmt(inp, ifp, M_HASHTYPE_GET(mb),
+ mb->m_pkthdr.flowid, max_pacing_rate);
+ }
+ } else {
+ error = in_pcbmodify_txrtlmt(inp, max_pacing_rate);
+ }
+ if (error == 0 || error == EOPNOTSUPP)
+ inp->inp_flags2 &= ~INP_RATE_LIMIT_CHANGED;
+ if (did_upgrade)
+ INP_DOWNGRADE(inp);
+}
+
+/*
+ * Track route changes for TX rate limiting.
+ */
+void
+in_pcboutput_eagain(struct inpcb *inp)
+{
+ struct socket *socket;
+ bool did_upgrade;
+
+ if (inp == NULL)
+ return;
+
+ socket = inp->inp_socket;
+ if (socket == NULL)
+ return;
+
+ if (inp->inp_snd_tag == NULL)
+ return;
+
+ if (!INP_WLOCKED(inp)) {
+ /*
+ * NOTE: If the write locking fails, we need to bail
+ * out and use the non-ratelimited ring for the
+ * transmit until there is a new chance to get the
+ * write lock.
+ */
+ if (!INP_TRY_UPGRADE(inp))
+ return;
+ did_upgrade = 1;
+ } else {
+ did_upgrade = 0;
+ }
+
+ /* detach rate limiting */
+ in_pcbdetach_txrtlmt(inp);
+
+ /* make sure new mbuf send tag allocation is made */
+ inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED;
+
+ if (did_upgrade)
+ INP_DOWNGRADE(inp);
+}
+#endif /* RATELIMIT */
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 4e3fbe5595bf..3842695597c6 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -181,6 +181,7 @@ struct icmp6_filter;
* read-lock usage during modification, this model can be applied to other
* protocols (especially SCTP).
*/
+struct m_snd_tag;
struct inpcb {
LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */
LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */
@@ -202,11 +203,11 @@ struct inpcb {
u_char inp_ip_minttl; /* (i) minimum TTL or drop */
uint32_t inp_flowid; /* (x) flow id / queue id */
u_int inp_refcount; /* (i) refcount */
- void *inp_pspare[5]; /* (x) packet pacing / general use */
+ struct m_snd_tag *inp_snd_tag; /* (i) send tag for outgoing mbufs */
+ void *inp_pspare[4]; /* (x) general use */
uint32_t inp_flowtype; /* (x) M_HASHTYPE value */
uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */
- u_int inp_ispare[4]; /* (x) packet pacing / user cookie /
- * general use */
+ u_int inp_ispare[4]; /* (x) user cookie / general use */
/* Local and foreign ports, local and foreign addr. */
struct in_conninfo inp_inc; /* (i) list for PCB's local port */
@@ -616,6 +617,7 @@ short inp_so_options(const struct inpcb *inp);
#define INP_RSS_BUCKET_SET 0x00000080 /* IP_RSS_LISTEN_BUCKET is set */
#define INP_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */
#define INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */
+#define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */
/*
* Flags passed to in_pcblookup*() functions.
@@ -736,6 +738,14 @@ int in_getsockaddr(struct socket *so, struct sockaddr **nam);
struct sockaddr *
in_sockaddr(in_port_t port, struct in_addr *addr);
void in_pcbsosetlabel(struct socket *so);
+#ifdef RATELIMIT
+int in_pcbattach_txrtlmt(struct inpcb *, struct ifnet *, uint32_t, uint32_t, uint32_t);
+void in_pcbdetach_txrtlmt(struct inpcb *);
+int in_pcbmodify_txrtlmt(struct inpcb *, uint32_t);
+int in_pcbquery_txrtlmt(struct inpcb *, uint32_t *);
+void in_pcboutput_txrtlmt(struct inpcb *, struct ifnet *, struct mbuf *);
+void in_pcboutput_eagain(struct inpcb *);
+#endif
#endif /* _KERNEL */
#endif /* !_NETINET_IN_PCB_H_ */
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 78a5cc37f032..81f8264ce5cf 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -33,6 +33,7 @@
__FBSDID("$FreeBSD$");
#include "opt_inet.h"
+#include "opt_ratelimit.h"
#include "opt_ipsec.h"
#include "opt_mbuf_stress_test.h"
#include "opt_mpath.h"
@@ -661,8 +662,23 @@ sendit:
*/
m_clrprotoflags(m);
IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL);
+#ifdef RATELIMIT
+ if (inp != NULL) {
+ if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED)
+ in_pcboutput_txrtlmt(inp, ifp, m);
+ /* stamp send tag on mbuf */
+ m->m_pkthdr.snd_tag = inp->inp_snd_tag;
+ } else {
+ m->m_pkthdr.snd_tag = NULL;
+ }
+#endif
error = (*ifp->if_output)(ifp, m,
(const struct sockaddr *)gw, ro);
+#ifdef RATELIMIT
+ /* check for route change */
+ if (error == EAGAIN)
+ in_pcboutput_eagain(inp);
+#endif
goto done;
}
@@ -698,8 +714,23 @@ sendit:
IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp,
mtod(m, struct ip *), NULL);
+#ifdef RATELIMIT
+ if (inp != NULL) {
+ if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED)
+ in_pcboutput_txrtlmt(inp, ifp, m);
+ /* stamp send tag on mbuf */
+ m->m_pkthdr.snd_tag = inp->inp_snd_tag;
+ } else {
+ m->m_pkthdr.snd_tag = NULL;
+ }
+#endif
error = (*ifp->if_output)(ifp, m,
(const struct sockaddr *)gw, ro);
+#ifdef RATELIMIT
+ /* check for route change */
+ if (error == EAGAIN)
+ in_pcboutput_eagain(inp);
+#endif
} else
m_freem(m);
}
@@ -974,6 +1005,16 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
INP_WUNLOCK(inp);
error = 0;
break;
+ case SO_MAX_PACING_RATE:
+#ifdef RATELIMIT
+ INP_WLOCK(inp);
+ inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED;
+ INP_WUNLOCK(inp);
+ error = 0;
+#else
+ error = EOPNOTSUPP;
+#endif
+ break;
default:
break;
}
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 49b89564b978..be05c8ade522 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_ratelimit.h"
#include "opt_ipsec.h"
#include "opt_sctp.h"
#include "opt_route.h"
@@ -954,8 +955,23 @@ passout:
m->m_pkthdr.len);
ifa_free(&ia6->ia_ifa);
}
+#ifdef RATELIMIT
+ if (inp != NULL) {
+ if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED)
+ in_pcboutput_txrtlmt(inp, ifp, m);
+ /* stamp send tag on mbuf */
+ m->m_pkthdr.snd_tag = inp->inp_snd_tag;
+ } else {
+ m->m_pkthdr.snd_tag = NULL;
+ }
+#endif
error = nd6_output_ifp(ifp, origifp, m, dst,
(struct route *)ro);
+#ifdef RATELIMIT
+ /* check for route change */
+ if (error == EAGAIN)
+ in_pcboutput_eagain(inp);
+#endif
goto done;
}
@@ -1054,8 +1070,23 @@ sendorfree:
counter_u64_add(ia->ia_ifa.ifa_obytes,
m->m_pkthdr.len);
}
+#ifdef RATELIMIT
+ if (inp != NULL) {
+ if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED)
+ in_pcboutput_txrtlmt(inp, ifp, m);
+ /* stamp send tag on mbuf */
+ m->m_pkthdr.snd_tag = inp->inp_snd_tag;
+ } else {
+ m->m_pkthdr.snd_tag = NULL;
+ }
+#endif
error = nd6_output_ifp(ifp, origifp, m, dst,
(struct route *)ro);
+#ifdef RATELIMIT
+ /* check for route change */
+ if (error == EAGAIN)
+ in_pcboutput_eagain(inp);
+#endif
} else
m_freem(m);
}
@@ -1441,6 +1472,16 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt)
INP_WUNLOCK(in6p);
error = 0;
break;
+ case SO_MAX_PACING_RATE:
+#ifdef RATELIMIT
+ INP_WLOCK(in6p);
+ in6p->inp_flags2 |= INP_RATE_LIMIT_CHANGED;
+ INP_WUNLOCK(in6p);
+ error = 0;
+#else
+ error = EOPNOTSUPP;
+#endif
+ break;
default:
break;
}
diff --git a/sys/netpfil/ipfw/ip_fw_private.h b/sys/netpfil/ipfw/ip_fw_private.h
index 3b483625c86e..ed8e57450cf2 100644
--- a/sys/netpfil/ipfw/ip_fw_private.h
+++ b/sys/netpfil/ipfw/ip_fw_private.h
@@ -414,7 +414,7 @@ struct ipfw_ifc {
#define IPFW_PF_RUNLOCK(p) IPFW_RUNLOCK(p)
#else /* FreeBSD */
#define IPFW_LOCK_INIT(_chain) do { \
- rm_init(&(_chain)->rwmtx, "IPFW static rules"); \
+ rm_init_flags(&(_chain)->rwmtx, "IPFW static rules", RM_RECURSE); \
rw_init(&(_chain)->uh_lock, "IPFW UH lock"); \
} while (0)
diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S
index 056c07323675..4f691e7edb5c 100644
--- a/sys/powerpc/aim/trap_subr32.S
+++ b/sys/powerpc/aim/trap_subr32.S
@@ -406,7 +406,7 @@ im0:
mtctr %r1 /* load counter */
im1:
lwzu %r1, 8(%r2) /* get next pte */
- cmp 0, %r1, %r3 /* see if found pte */
+ cmp 0, 0, %r1, %r3 /* see if found pte */
bdnzf 2, im1 /* dec count br if cmp ne and if
* count not zero */
bne instr_sec_hash /* if not found set up second hash
diff --git a/sys/powerpc/include/frame.h b/sys/powerpc/include/frame.h
index e6fb103c7af5..667b58c4b447 100644
--- a/sys/powerpc/include/frame.h
+++ b/sys/powerpc/include/frame.h
@@ -109,7 +109,5 @@ struct callframe {
/* Definitions for syscalls */
#define FIRSTARG 3 /* first arg in reg 3 */
#define NARGREG 8 /* 8 args in regs */
-#define MOREARGS(sp) ((caddr_t)((uintptr_t)(sp) + \
- sizeof(struct callframe) - 3*sizeof(register_t))) /* more args go here */
#endif /* _MACHINE_FRAME_H_ */
diff --git a/sys/powerpc/mpc85xx/fsl_diu.c b/sys/powerpc/mpc85xx/fsl_diu.c
index 91675e43ec08..2fffaae69a45 100644
--- a/sys/powerpc/mpc85xx/fsl_diu.c
+++ b/sys/powerpc/mpc85xx/fsl_diu.c
@@ -344,7 +344,7 @@ diu_init(struct diu_softc *sc)
static int
diu_attach(device_t dev)
{
- struct edid_info *edid;
+ struct edid_info edid;
struct diu_softc *sc;
const struct videomode *videomode;
void *edid_cells;
@@ -384,12 +384,12 @@ diu_attach(device_t dev)
}
}
if (edid_cells != NULL) {
- if (edid_parse(edid_cells, edid) != 0) {
+ if (edid_parse(edid_cells, &edid) != 0) {
device_printf(dev, "Error parsing EDID\n");
OF_prop_free(edid_cells);
return (ENXIO);
}
- videomode = edid->edid_preferred_mode;
+ videomode = edid.edid_preferred_mode;
} else {
/* Parse video-mode kenv variable. */
if ((err = sscanf(vm_name, "fslfb:%dx%d@%d", &w, &h, &r)) != 3) {
diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c
index 6611703771d9..d58cba3e1c61 100644
--- a/sys/powerpc/powerpc/trap.c
+++ b/sys/powerpc/powerpc/trap.c
@@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$");
#define FAULTBUF_CR 22
#define FAULTBUF_R14 3
+#define MOREARGS(sp) ((caddr_t)((uintptr_t)(sp) + \
+ sizeof(struct callframe) - 3*sizeof(register_t))) /* more args go here */
+
static void trap_fatal(struct trapframe *frame);
static void printtrap(u_int vector, struct trapframe *frame, int isfatal,
int user);
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 7db4f25542b3..179a60955d1c 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -793,6 +793,13 @@
#if !(defined(__clang__) && __has_feature(nullability))
#define _Nonnull
#define _Nullable
+#define _Null_unspecified
+#define __NULLABILITY_PRAGMA_PUSH
+#define __NULLABILITY_PRAGMA_POP
+#else
+#define __NULLABILITY_PRAGMA_PUSH _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wnullability-completeness\"")
+#define __NULLABILITY_PRAGMA_POP _Pragma("clang diagnostic pop")
#endif
/*
diff --git a/sys/sys/elf32.h b/sys/sys/elf32.h
index 03a546c892c3..0aa3142ed119 100644
--- a/sys/sys/elf32.h
+++ b/sys/sys/elf32.h
@@ -254,4 +254,10 @@ typedef struct {
Elf32_Half si_flags; /* per symbol flags */
} Elf32_Syminfo;
+typedef struct {
+ Elf32_Word ch_type;
+ Elf32_Word ch_size;
+ Elf32_Word ch_addralign;
+} Elf32_Chdr;
+
#endif /* !_SYS_ELF32_H_ */
diff --git a/sys/sys/elf64.h b/sys/sys/elf64.h
index f0696196d55f..a309dfc6843e 100644
--- a/sys/sys/elf64.h
+++ b/sys/sys/elf64.h
@@ -257,4 +257,11 @@ typedef struct {
Elf64_Half si_flags; /* per symbol flags */
} Elf64_Syminfo;
+typedef struct {
+ Elf64_Word ch_type;
+ Elf64_Word ch_reserved;
+ Elf64_Xword ch_size;
+ Elf64_Xword ch_addralign;
+} Elf64_Chdr;
+
#endif /* !_SYS_ELF64_H_ */
diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h
index ede4b13a2c5e..e8a8709f37ef 100644
--- a/sys/sys/elf_common.h
+++ b/sys/sys/elf_common.h
@@ -849,6 +849,13 @@ typedef struct {
#define SYMINFO_CURRENT 1
#define SYMINFO_NUM 2
+/* Values for ch_type (compressed section headers). */
+#define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE */
+#define ELFCOMPRESS_LOOS 0x60000000 /* OS-specific */
+#define ELFCOMPRESS_HIOS 0x6fffffff
+#define ELFCOMPRESS_LOPROC 0x70000000 /* Processor-specific */
+#define ELFCOMPRESS_HIPROC 0x7fffffff
+
/*
* Relocation types.
*
diff --git a/sys/sys/extattr.h b/sys/sys/extattr.h
index ce5619bef162..2b358c92d740 100644
--- a/sys/sys/extattr.h
+++ b/sys/sys/extattr.h
@@ -57,10 +57,11 @@
EXTATTR_NAMESPACE_USER_STRING, \
EXTATTR_NAMESPACE_SYSTEM_STRING }
+#define EXTATTR_MAXNAMELEN NAME_MAX
+
#ifdef _KERNEL
#include <sys/types.h>
-#define EXTATTR_MAXNAMELEN NAME_MAX
struct thread;
struct ucred;
struct vnode;
diff --git a/sys/sys/gtaskqueue.h b/sys/sys/gtaskqueue.h
index 9a00a8a34342..3a9aeadc0a40 100644
--- a/sys/sys/gtaskqueue.h
+++ b/sys/sys/gtaskqueue.h
@@ -81,7 +81,7 @@ int taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride);
extern struct taskqgroup *qgroup_##name
-#ifdef EARLY_AP_STARTUP
+#if (!defined(SMP) || defined(EARLY_AP_STARTUP))
#define TASKQGROUP_DEFINE(name, cnt, stride) \
\
struct taskqgroup *qgroup_##name; \
@@ -95,7 +95,7 @@ taskqgroup_define_##name(void *arg) \
\
SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
taskqgroup_define_##name, NULL)
-#else
+#else /* SMP && !EARLY_AP_STARTUP */
#define TASKQGROUP_DEFINE(name, cnt, stride) \
\
struct taskqgroup *qgroup_##name; \
@@ -104,6 +104,15 @@ static void \
taskqgroup_define_##name(void *arg) \
{ \
qgroup_##name = taskqgroup_create(#name); \
+ /* Adjustment will be null unless smp_cpus == 1. */ \
+ /* \
+ * XXX this was intended to fix the smp_cpus == 1 case, but \
+ * doesn't actually work for that. It gives thes same strange \
+ * panic as adjustment at SI_SUB_INIT_IF:SI_ORDER_ANY for a \
+ * device that works with a pure UP kernel. \
+ */ \
+ /* XXX this code is common now, so should not be ifdefed. */ \
+ taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \
} \
\
SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
@@ -112,14 +121,18 @@ SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
static void \
taskqgroup_adjust_##name(void *arg) \
{ \
+ /* \
+ * Adjustment when smp_cpus > 1 only works accidentally \
+ * (when there is no device interrupt before adjustment). \
+ */ \
taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \
} \
\
-SYSINIT(taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY, \
+SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \
taskqgroup_adjust_##name, NULL); \
- \
-struct __hack
-#endif
+
+#endif /* !SMP || EARLY_AP_STARTUP */
+
TASKQGROUP_DECLARE(net);
#endif /* !_SYS_GTASKQUEUE_H_ */
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index eac039a462b0..1651767687d8 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -130,6 +130,14 @@ struct m_tag {
};
/*
+ * Static network interface owned tag.
+ * Allocated through ifp->if_snd_tag_alloc().
+ */
+struct m_snd_tag {
+ struct ifnet *ifp; /* network interface tag belongs to */
+};
+
+/*
* Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set.
* Size ILP32: 48
* LP64: 56
@@ -137,7 +145,10 @@ struct m_tag {
* they are correct.
*/
struct pkthdr {
- struct ifnet *rcvif; /* rcv interface */
+ union {
+ struct m_snd_tag *snd_tag; /* send tag, if any */
+ struct ifnet *rcvif; /* rcv interface */
+ };
SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */
int32_t len; /* total packet length */
diff --git a/sys/sys/rwlock.h b/sys/sys/rwlock.h
index 6b4f505e0d01..e5b1166cedc6 100644
--- a/sys/sys/rwlock.h
+++ b/sys/sys/rwlock.h
@@ -76,6 +76,8 @@
#define rw_recurse lock_object.lo_data
+#define RW_READ_VALUE(x) ((x)->rw_lock)
+
/* Very simple operations on rw_lock. */
/* Try to obtain a write lock once. */
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index a97b1eefe050..68f7b5d45338 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -159,6 +159,7 @@ typedef __uintptr_t uintptr_t;
#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */
#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */
#define SO_TS_CLOCK 0x1017 /* clock type used for SO_TIMESTAMP */
+#define SO_MAX_PACING_RATE 0x1018 /* socket's max TX pacing rate (Linux name) */
#endif
#if __BSD_VISIBLE
@@ -424,28 +425,36 @@ struct msghdr {
int msg_flags; /* flags on received message */
};
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
+#define MSG_OOB 0x00000001 /* process out-of-band data */
+#define MSG_PEEK 0x00000002 /* peek at incoming message */
+#define MSG_DONTROUTE 0x00000004 /* send without using routing tables */
+#define MSG_EOR 0x00000008 /* data completes record */
+#define MSG_TRUNC 0x00000010 /* data discarded before delivery */
+#define MSG_CTRUNC 0x00000020 /* control data lost before delivery */
+#define MSG_WAITALL 0x00000040 /* wait for full request or error */
+#if __BSD_VISIBLE
+#define MSG_DONTWAIT 0x00000080 /* this message should be nonblocking */
+#define MSG_EOF 0x00000100 /* data completes connection */
+/* 0x00000200 unused */
+/* 0x00000400 unused */
+/* 0x00000800 unused */
+/* 0x00001000 unused */
+#define MSG_NOTIFICATION 0x00002000 /* SCTP notification */
+#define MSG_NBIO 0x00004000 /* FIONBIO mode, used by fifofs */
+#define MSG_COMPAT 0x00008000 /* used in sendit() */
+#endif
+#ifdef _KERNEL
+#define MSG_SOCALLBCK 0x00010000 /* for use by socket callbacks - soreceive (TCP) */
+#endif
#if __POSIX_VISIBLE >= 200809
-#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */
+#define MSG_NOSIGNAL 0x00020000 /* do not generate SIGPIPE on EOF */
#endif
#if __BSD_VISIBLE
-#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
-#define MSG_EOF 0x100 /* data completes connection */
-#define MSG_NOTIFICATION 0x2000 /* SCTP notification */
-#define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */
-#define MSG_COMPAT 0x8000 /* used in sendit() */
-#define MSG_CMSG_CLOEXEC 0x40000 /* make received fds close-on-exec */
-#define MSG_WAITFORONE 0x80000 /* for recvmmsg() */
+#define MSG_CMSG_CLOEXEC 0x00040000 /* make received fds close-on-exec */
+#define MSG_WAITFORONE 0x00080000 /* for recvmmsg() */
#endif
#ifdef _KERNEL
-#define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */
-#define MSG_MORETOCOME 0x20000 /* additional data pending */
+#define MSG_MORETOCOME 0x00100000 /* additional data pending */
#endif
/*
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 7dc341ca4833..33d5b59e0f3f 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -128,9 +128,10 @@ struct socket {
uint32_t so_user_cookie;
int so_ts_clock; /* type of the clock used for timestamps */
+ uint32_t so_max_pacing_rate; /* (f) TX rate limit in bytes/s */
- void *so_pspare[2]; /* packet pacing / general use */
- int so_ispare[2]; /* packet pacing / general use */
+ void *so_pspare[2]; /* general use */
+ int so_ispare[2]; /* general use */
};
/*
diff --git a/sys/sys/sx.h b/sys/sys/sx.h
index 57a31d9aace8..e8cffaa2593d 100644
--- a/sys/sys/sx.h
+++ b/sys/sys/sx.h
@@ -88,6 +88,11 @@
#define sx_recurse lock_object.lo_data
+#define SX_READ_VALUE(sx) ((sx)->sx_lock)
+
+#define lv_sx_owner(v) \
+ ((v & SX_LOCK_SHARED) ? NULL : (struct thread *)SX_OWNER(v))
+
/*
* Function prototipes. Routines that start with an underscore are not part
* of the public interface and are wrappered with a macro.
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index f5a45f1c1787..0b5c61765d7a 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -100,6 +100,9 @@ __FBSDID("$FreeBSD$");
#include "opt_directio.h"
#include "opt_ffs.h"
+#define ALIGNED_TO(ptr, s) \
+ (((uintptr_t)(ptr) & (_Alignof(s) - 1)) == 0)
+
#ifdef DIRECTIO
extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone);
#endif
@@ -1100,46 +1103,30 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *ucred)
* the length of the EA, and possibly the pointer to the entry and to the data.
*/
static int
-ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name, u_char **eap, u_char **eac)
+ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
+ struct extattr **eapp, u_char **eac)
{
- u_char *p, *pe, *pn, *p0;
- int eapad1, eapad2, ealength, ealen, nlen;
- uint32_t ul;
+ struct extattr *eap, *eaend;
+ size_t nlen;
- pe = ptr + length;
nlen = strlen(name);
-
- for (p = ptr; p < pe; p = pn) {
- p0 = p;
- bcopy(p, &ul, sizeof(ul));
- pn = p + ul;
+ KASSERT(ALIGNED_TO(ptr, struct extattr), ("unaligned"));
+ eap = (struct extattr *)ptr;
+ eaend = (struct extattr *)(ptr + length);
+ for (; eap < eaend; eap = EXTATTR_NEXT(eap)) {
/* make sure this entry is complete */
- if (pn > pe)
+ if (EXTATTR_NEXT(eap) > eaend)
break;
- p += sizeof(uint32_t);
- if (*p != nspace)
- continue;
- p++;
- eapad2 = *p++;
- if (*p != nlen)
- continue;
- p++;
- if (bcmp(p, name, nlen))
+ if (eap->ea_namespace != nspace || eap->ea_namelength != nlen
+ || memcmp(eap->ea_name, name, nlen) != 0)
continue;
- ealength = sizeof(uint32_t) + 3 + nlen;
- eapad1 = 8 - (ealength % 8);
- if (eapad1 == 8)
- eapad1 = 0;
- ealength += eapad1;
- ealen = ul - ealength - eapad2;
- p += nlen + eapad1;
- if (eap != NULL)
- *eap = p0;
+ if (eapp != NULL)
+ *eapp = eap;
if (eac != NULL)
- *eac = p;
- return (ealen);
+ *eac = EXTATTR_CONTENT(eap);
+ return (EXTATTR_CONTENT_SIZE(eap));
}
- return(-1);
+ return (-1);
}
static int
@@ -1380,9 +1367,11 @@ vop_deleteextattr {
{
struct inode *ip;
struct fs *fs;
- uint32_t ealength, ul;
- int ealen, olen, eapad1, eapad2, error, i, easize;
- u_char *eae, *p;
+ struct extattr *eap;
+ uint32_t ul;
+ int olen, error, i, easize;
+ u_char *eae;
+ void *tmp;
ip = VTOI(ap->a_vp);
fs = ITOFS(ip);
@@ -1413,39 +1402,30 @@ vop_deleteextattr {
if (error)
return (error);
- ealength = eapad1 = ealen = eapad2 = 0;
-
+ /* CEM: delete could be done in-place instead */
eae = malloc(ip->i_ea_len, M_TEMP, M_WAITOK);
bcopy(ip->i_ea_area, eae, ip->i_ea_len);
easize = ip->i_ea_len;
olen = ffs_findextattr(eae, easize, ap->a_attrnamespace, ap->a_name,
- &p, NULL);
+ &eap, NULL);
if (olen == -1) {
/* delete but nonexistent */
free(eae, M_TEMP);
ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
- return(ENOATTR);
+ return (ENOATTR);
}
- bcopy(p, &ul, sizeof ul);
- i = p - eae + ul;
- if (ul != ealength) {
- bcopy(p + ul, p + ealength, easize - i);
- easize += (ealength - ul);
- }
- if (easize > NXADDR * fs->fs_bsize) {
- free(eae, M_TEMP);
- ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
- if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
- ip->i_ea_error = ENOSPC;
- return(ENOSPC);
- }
- p = ip->i_ea_area;
+ ul = eap->ea_length;
+ i = (u_char *)EXTATTR_NEXT(eap) - eae;
+ bcopy(EXTATTR_NEXT(eap), eap, easize - i);
+ easize -= ul;
+
+ tmp = ip->i_ea_area;
ip->i_ea_area = eae;
ip->i_ea_len = easize;
- free(p, M_TEMP);
+ free(tmp, M_TEMP);
error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td);
- return(error);
+ return (error);
}
/*
@@ -1499,7 +1479,7 @@ vop_getextattr {
error = ENOATTR;
ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
- return(error);
+ return (error);
}
/*
@@ -1519,9 +1499,7 @@ vop_listextattr {
*/
{
struct inode *ip;
- u_char *eae, *p, *pe, *pn;
- unsigned easize;
- uint32_t ul;
+ struct extattr *eap, *eaend;
int error, ealen;
ip = VTOI(ap->a_vp);
@@ -1537,31 +1515,31 @@ vop_listextattr {
error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td);
if (error)
return (error);
- eae = ip->i_ea_area;
- easize = ip->i_ea_len;
error = 0;
if (ap->a_size != NULL)
*ap->a_size = 0;
- pe = eae + easize;
- for(p = eae; error == 0 && p < pe; p = pn) {
- bcopy(p, &ul, sizeof(ul));
- pn = p + ul;
- if (pn > pe)
+
+ KASSERT(ALIGNED_TO(ip->i_ea_area, struct extattr), ("unaligned"));
+ eap = (struct extattr *)ip->i_ea_area;
+ eaend = (struct extattr *)(ip->i_ea_area + ip->i_ea_len);
+ for (; error == 0 && eap < eaend; eap = EXTATTR_NEXT(eap)) {
+ /* make sure this entry is complete */
+ if (EXTATTR_NEXT(eap) > eaend)
break;
- p += sizeof(ul);
- if (*p++ != ap->a_attrnamespace)
+ if (eap->ea_namespace != ap->a_attrnamespace)
continue;
- p++; /* pad2 */
- ealen = *p;
- if (ap->a_size != NULL) {
+
+ ealen = eap->ea_namelength;
+ if (ap->a_size != NULL)
*ap->a_size += ealen + 1;
- } else if (ap->a_uio != NULL) {
- error = uiomove(p, ealen + 1, ap->a_uio);
- }
+ else if (ap->a_uio != NULL)
+ error = uiomove(&eap->ea_namelength, ealen + 1,
+ ap->a_uio);
}
+
ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
- return(error);
+ return (error);
}
/*
@@ -1582,10 +1560,12 @@ vop_setextattr {
{
struct inode *ip;
struct fs *fs;
+ struct extattr *eap;
uint32_t ealength, ul;
ssize_t ealen;
int olen, eapad1, eapad2, error, i, easize;
- u_char *eae, *p;
+ u_char *eae;
+ void *tmp;
ip = VTOI(ap->a_vp);
fs = ITOFS(ip);
@@ -1625,29 +1605,33 @@ vop_setextattr {
return (error);
ealength = sizeof(uint32_t) + 3 + strlen(ap->a_name);
- eapad1 = 8 - (ealength % 8);
- if (eapad1 == 8)
- eapad1 = 0;
- eapad2 = 8 - (ealen % 8);
- if (eapad2 == 8)
- eapad2 = 0;
+ eapad1 = roundup2(ealength, 8) - ealength;
+ eapad2 = roundup2(ealen, 8) - ealen;
ealength += eapad1 + ealen + eapad2;
+ /*
+ * CEM: rewrites of the same size or smaller could be done in-place
+ * instead. (We don't acquire any fine-grained locks in here either,
+ * so we could also do bigger writes in-place.)
+ */
eae = malloc(ip->i_ea_len + ealength, M_TEMP, M_WAITOK);
bcopy(ip->i_ea_area, eae, ip->i_ea_len);
easize = ip->i_ea_len;
- olen = ffs_findextattr(eae, easize,
- ap->a_attrnamespace, ap->a_name, &p, NULL);
+ olen = ffs_findextattr(eae, easize, ap->a_attrnamespace, ap->a_name,
+ &eap, NULL);
if (olen == -1) {
/* new, append at end */
- p = eae + easize;
+ KASSERT(ALIGNED_TO(eae + easize, struct extattr),
+ ("unaligned"));
+ eap = (struct extattr *)(eae + easize);
easize += ealength;
} else {
- bcopy(p, &ul, sizeof ul);
- i = p - eae + ul;
+ ul = eap->ea_length;
+ i = (u_char *)EXTATTR_NEXT(eap) - eae;
if (ul != ealength) {
- bcopy(p + ul, p + ealength, easize - i);
+ bcopy(EXTATTR_NEXT(eap), (u_char *)eap + ealength,
+ easize - i);
easize += (ealength - ul);
}
}
@@ -1656,34 +1640,30 @@ vop_setextattr {
ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
ip->i_ea_error = ENOSPC;
- return(ENOSPC);
+ return (ENOSPC);
}
- bcopy(&ealength, p, sizeof(ealength));
- p += sizeof(ealength);
- *p++ = ap->a_attrnamespace;
- *p++ = eapad2;
- *p++ = strlen(ap->a_name);
- strcpy(p, ap->a_name);
- p += strlen(ap->a_name);
- bzero(p, eapad1);
- p += eapad1;
- error = uiomove(p, ealen, ap->a_uio);
+ eap->ea_length = ealength;
+ eap->ea_namespace = ap->a_attrnamespace;
+ eap->ea_contentpadlen = eapad2;
+ eap->ea_namelength = strlen(ap->a_name);
+ memcpy(eap->ea_name, ap->a_name, strlen(ap->a_name));
+ bzero(&eap->ea_name[strlen(ap->a_name)], eapad1);
+ error = uiomove(EXTATTR_CONTENT(eap), ealen, ap->a_uio);
if (error) {
free(eae, M_TEMP);
ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td);
if (ip->i_ea_area != NULL && ip->i_ea_error == 0)
ip->i_ea_error = error;
- return(error);
+ return (error);
}
- p += ealen;
- bzero(p, eapad2);
+ bzero((u_char *)EXTATTR_CONTENT(eap) + ealen, eapad2);
- p = ip->i_ea_area;
+ tmp = ip->i_ea_area;
ip->i_ea_area = eae;
ip->i_ea_len = easize;
- free(p, M_TEMP);
+ free(tmp, M_TEMP);
error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td);
- return(error);
+ return (error);
}
/*
diff --git a/sys/ufs/ufs/extattr.h b/sys/ufs/ufs/extattr.h
index 6b4987cc2b69..73f97556c6e4 100644
--- a/sys/ufs/ufs/extattr.h
+++ b/sys/ufs/ufs/extattr.h
@@ -73,11 +73,12 @@ struct ufs_extattr_header {
* This structure defines the required fields of an extended-attribute header.
*/
struct extattr {
- int32_t ea_length; /* length of this attribute */
- int8_t ea_namespace; /* name space of this attribute */
- int8_t ea_contentpadlen; /* bytes of padding at end of attribute */
- int8_t ea_namelength; /* length of attribute name */
- char ea_name[1]; /* null-terminated attribute name */
+ uint32_t ea_length; /* length of this attribute */
+ uint8_t ea_namespace; /* name space of this attribute */
+ uint8_t ea_contentpadlen; /* bytes of padding at end of attribute */
+ uint8_t ea_namelength; /* length of attribute name */
+ char ea_name[1]; /* attribute name (NOT nul-terminated) */
+ /* padding, if any, to align attribute content to 8 byte boundary */
/* extended attribute content follows */
};
@@ -90,26 +91,16 @@ struct extattr {
* content referenced by eap.
* EXTATTR_CONTENT_SIZE(eap) returns the size of the extended attribute
* content referenced by eap.
- * EXTATTR_SET_LENGTHS(eap, contentsize) called after initializing the
- * attribute name to calculate and set the ea_length, ea_namelength,
- * and ea_contentpadlen fields of the extended attribute structure.
*/
#define EXTATTR_NEXT(eap) \
- ((struct extattr *)(((void *)(eap)) + (eap)->ea_length))
-#define EXTATTR_CONTENT(eap) (((void *)(eap)) + EXTATTR_BASE_LENGTH(eap))
+ ((struct extattr *)(((u_char *)(eap)) + (eap)->ea_length))
+#define EXTATTR_CONTENT(eap) \
+ (void *)(((u_char *)(eap)) + EXTATTR_BASE_LENGTH(eap))
#define EXTATTR_CONTENT_SIZE(eap) \
((eap)->ea_length - EXTATTR_BASE_LENGTH(eap) - (eap)->ea_contentpadlen)
+/* -1 below compensates for ea_name[1] */
#define EXTATTR_BASE_LENGTH(eap) \
- ((sizeof(struct extattr) + (eap)->ea_namelength + 7) & ~7)
-#define EXTATTR_SET_LENGTHS(eap, contentsize) do { \
- KASSERT(((eap)->ea_name[0] != 0), \
- ("Must initialize name before setting lengths")); \
- (eap)->ea_namelength = strlen((eap)->ea_name); \
- (eap)->ea_contentpadlen = ((contentsize) % 8) ? \
- 8 - ((contentsize) % 8) : 0; \
- (eap)->ea_length = EXTATTR_BASE_LENGTH(eap) + \
- (contentsize) + (eap)->ea_contentpadlen; \
-} while (0)
+ roundup2((sizeof(struct extattr) - 1 + (eap)->ea_namelength), 8)
#ifdef _KERNEL
@@ -149,13 +140,6 @@ int ufs_deleteextattr(struct vop_deleteextattr_args *ap);
int ufs_setextattr(struct vop_setextattr_args *ap);
void ufs_extattr_vnode_inactive(struct vnode *vp, struct thread *td);
-#else
-
-/* User-level definition of KASSERT for macros above */
-#define KASSERT(cond, str) do { \
- if (!(cond)) { printf("panic: "); printf(str); printf("\n"); exit(1); }\
-} while (0)
-
#endif /* !_KERNEL */
#endif /* !_UFS_UFS_EXTATTR_H_ */